Category: Powershell

Windows PowerShell PSSnapin

PowerShell Add-PSSnapin A PowerShell snapin contains extra cmdlets, usually for a specialist purpose such as Quest’s Active directory family of cmdlets.  The trick is to append, inject, register, or wire up PowerShell to accept additional Verb-Noun pairs from other providers. PowerShell Topics for Add-PSSnapin Example 1 – Add-PSSnapin Example 2 …

PowerShell Get-WinEvent

Examine Your Logs with the Get-WinEvent Cmdlet Get-WinEvent in PowerShell v2.0 is a successor to Get-Eventlog in version 1.0. Take the opportunity to learn more about PowerShell while you undertake the worthwhile task of examining the various event logs, for example, system, Windows or DNS. PowerShell Get-WinEvent Topics Example 1: …

Windows PowerShell Methods

Windows PowerShell Methods This section concentrates on pure PowerShell techniques.  I will explain how to take those first few tentative steps on your journey to master PowerShell.  If you review my techniques below, then you will get an idea of the range of PowerShell methods available.  My aim is to …

Windows PowerShell 4.0

Windows PowerShell 4.0 Version 4 seem like a routine upgrade of a mature product.  In truth, PowerShell V4.0 lacks the excitement or killer new feature of V3 (Intellisense) or V2 (Remoting). PowerShell 4.0 New Features Installing PowerShell 4.0 Windows Management Framework 4.0 PowerShell Desired State Configuration Check Your Version of …

PowerShell Import-Module

Introduction to PowerShell’s Import Modules Clever programmers are making more and more modules for PowerShell. Make sure you benefit from their manifest, binary and script modules. You have probably used existing cmdlets such as Get-Process, Get-ChildItem or Restart-Service.  Well, Import-Module extends your toolbox by adding specialist functions such as Get-RegString.  …

PowerShell New-AdComputer

Windows PowerShell New-AdComputer Cmdlet Here is the Active Directory cmdlet to create computer objects in your domain.  Note, the verb is ‘New’ (and not ‘Add’ and the noun is ‘AdComputer’ not plain Computer. If you are new to configuring Active Directory with PowerShell, then I recommend you look at the …

PowerShell Parameters Intro

Introduction to PowerShell’s Parameters A PowerShell parameter works in a similar fashion to a DOS switch.  Introduced with a dash, -Parameters modify, clarify, and improve the underlying cmdlet. Getting Started with PowerShell Parameters Our Vehicle to Learn About Parameters -Path parameter Parameters Modify a Cmdlet’s Behaviour Parameter Refinement: -Recurse PowerShell …

Windows PowerShell Read-Host

Windows PowerShell Read-Host (Input Box) When you need user input, then employ Read-Host with associated variables.  This is PowerShell’s equivalent of MsgBox() in VBScript. Windows PowerShell Read-Host Topics PowerShell Script To Generate an Input Box Further Research on Read-Host Creating a Pop-up Message  ♣ PowerShell Script To Generate an Input …