Passing a Switch parameter using Splatting

suggest change

To call Get-Process with the -FileVersionInfo switch by splatting, start from this call:

Get-Process -FileVersionInfo

This is the call using splatting:

$MyParameters = @{
    FileVersionInfo = $true
}

Get-Process @MyParameters

Note: This is useful because you can create a default set of parameters and make the call many times like this:

$MyParameters = @{
    FileVersionInfo = $true
}

Get-Process @MyParameters -Name WmiPrvSE
Get-Process @MyParameters -Name explorer

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents