PowerShell for Windows Admins:

May, 2018


May 31, 2018  3:43 AM

Splitting into pairs

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

During my session on scriptblocks at Summit 2018 I showed how to split a string into pairs of values Start with this string PS> $str = 'Jack,Jill,Bill,Ben,Eric,Ernie,Cagney,Lacey' You want the string split in the commas – but every other comma so you get pairs if values separated by a...

May 31, 2018  3:28 AM

Summit 2018 sessions

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The code and slides from my Summit 2018 sessions can be found at 0 Comments     RSS Feed     Email a friend


May 31, 2018  3:13 AM

PowerShell functionality

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell functionality – in the form of modules – comes from a number of different sources. These are: Powershell itself including the Microsoft.PowerShell.* modules and CIM cmdlets Windows Team – this includes the modules such as NetAdapter, NetTCPIP, Storage that were first...


May 28, 2018  9:48 AM

Hyper-V book

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Hyper-V

The Month of Lunches Hyper-V book I was working on was cancelled by the publisher. The good news is that it’s most likely going to be resurrected with another publisher and will hopefully be available later this year. More to follow when the details are finalised


May 26, 2018  10:11 AM

WMI and CIM accelerators

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Powershell, WMI

In PowerShell an accelerator is a shortcut to a .NET type. The WMI accelerators have been around since PowerShell v1. The WMI accelerators were heavily used in v1 fill some of the gaps in cmdlet coverage. The CIM accelerators appeared in PowerShell v3 (I think – only discovered them recently!)....


May 22, 2018  1:01 PM

PowerShell parameter sets

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell parameter sets allow you to control which parameters can be used together. If a parameter isn’t in the parameter set you’re trying to use you’ll get an error message.

PS> Get-VM -Name XYZ -id (New-Guid)
Get-VM : Parameter set cannot be resolved using the specified named...


May 22, 2018  8:52 AM

PowerShell version

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Discovering the PowerShell version you’re using can be an interesting task. The automatic variable $PSVersionTable was introduced in PowerShell v2. On my Windows 10 version 1803 machine for Windows PowerShell I get PS> $PSVersionTable Name Value ---- ----- PSVersion...


May 18, 2018  11:39 AM

Format Data

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell will format the output of objects that it knows about. For instance Get-Process shows different sets of properties depending on whether you choose a table or list view. The format data is stored in files named *.format.ps1xml. In Windows PowerShell the format files are found in...


May 15, 2018  8:11 AM

where –not

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell v6.1 preview 2 has added the where –not option. The option adds another parameter to the syntax where-object <property name> <operator like parameter> <value> Couple of examples of using the syntax Get-Process | where CPU -gt 12 Get-Service | where...


May 11, 2018  8:52 AM

Calculating standard deviation

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Calculating a standard deviation isn’t a difficult exercise but PowerShell v6.1 offers an easier method. In Windows PowerShell v5.1 and PowerShell v6.0 the Measure-Object cmdlet has this syntax PS> Get-Command Measure-Object -Syntax Measure-Object [[-Property] <string[]>]...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: