Category: Powershell

PowerShell Get-Job

Display PowerShell's Background Jobs The purpose of Get-Job is to list both the PowerShell jobs running in the background, and those that have completed. Windows PowerShell Get-Job Topics Introduction to the Get-Job Cmdlet Example 1: List Running Services in a Job Filtering with Get-Job Example 2: Start-Job | Format-List  ♣ …

PowerShell Registry Get-ItemProperty

Accessing the Registry with PowerShell With PowerShell’s Get-ItemProperty you can interrogate the registry.  Once you are comfortable with the technique you can progress to making registry changes with Set-ItemProperty. Investigating the Registry with PowerShell’s ItemProperty Listing Registry Values with Get-ItemProperty Changing Registry Values with Set-ItemProperty The_Beginners_Conundrum PowerShell’s ItemProperty New-ItemProperty  ♣ …

Windows PowerShell Get-Credential

PowerShell Get-Credential Cmdlet PowerShell's Get-Credential disappointed me.  I had hoped that this cmdlet would 'capture' my current credentials and encrypt them. I now realize that Get-Credential has a different purpose, which is to supply a dialog box for us to enter an alternative name and its password. Topics for PowerShell …

Windows PowerShell Set-Service Cmdlet

Windows PowerShell  Set-Service One problem controlling Windows services with PowerShell is that the Startup Type maybe ‘Disabled’.  The benefit of changing the startupType property to ‘Manual’, that you can then start the service. In order to get a grounding in the PowerShell syntax associated with this ‘Service’ family of commands, …

Windows PowerShell Nouns

Introduction to Windows PowerShell Nouns In PowerShell, nouns always come after the verb.  For instance: Verb-Noun, Get-Process, New-Alias or Set-Location.  One advantage of researching a noun is that it can lead to other interesting cmdlets in the same family. Noun Experiments Experiment with these commands, just substitute the noun that …

PowerShell Backup with Copy-Item

PowerShell Script to Backup Outlook.pst Here is a PowerShell script that will backup your Outlook.pst email file.  While there is no backup verb in PowerShell, you can get the job done with the Copy-Item cmdlet. Topics for PowerShell Backup Copy-Item Parameters -Path and -Destination PowerShell Backup with Task Scheduler Troubleshooting …

Windows PowerShell Variables

Introduction to Windows PowerShell Variables All scripting languages use placeholders or variables to hold data.  Furthermore, each language has its own rules and symbols.  I have found that using PowerShell variables is straightforward, just remember to introduce your variable with a dollar sign, for example: $Memory. Topics for PowerShell’s Variables …

PowerShell New-Object

How PowerShell Can Download Files from the Internet The purpose of this page is two fold; firstly, the practical task of downloading a file.  Secondly, to explore one of the many uses of the New-Object cmdlet. Windows PowerShell New-Object Topics Download a File from the Internet Using PowerShell Help with …

PowerShell Get-PSDrive

Windows PowerShell’s Get-PSDrive This cmdlet is not only useful for researching the local disk structure, but it also gives us an insight into how PowerShell views the registry as a drive. Topics for PowerShell’s Get-PSDrive Cmdlet List PowerShell’s PSProviders List Disk Capacity and Calculate FreeSpace % Get-PSDrive’s Properties Real-life Task: …

Windows PowerShell Loops

Windows PowerShell Loops Automating repetitive tasks is what scripting is all about.  Therefore, each scripting language needs at least one method for cycling, or looping through a block of instructions.  PowerShell provides a rich variety of looping techniques.  However, because loops can go spectacularly wrong, I recommend you test a …