If you get [WayBack] “A parameter cannot be found that matches parameter name ‘PassThru'” as PowerShell error, then likely the PowerShell version is too old to support -PassThru
, which likely means you have are running pre-Windows 10 version.
PowerShell 3 (introduced in 2012) added the -PassThru
parameter that allowed to chain multiple commands from one list pipe.
Another reason for the error might be that the command you use does not support the -PassThru
parameter.
To check which commandlets support -PassThru
, use the below command (the output is from a Windows 8.1 machine running PowerShell 4.0).