Passing a Switch parameter using Splatting
suggest changeTo 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
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents