I am getting an error when trying to deploy the following code to multiple machines, see below.
Code:
$remote = new-pssession -computername teststation-2, teststation-1
import-pssession -session $remote -commandname *-process -prefix remote
get-remoteprocess -name fwt | stop-remoteprocess -force
Error:
Import-PSSession : Cannot convert 'System.Object[]' to the type 'System.Management.Automation.Runspaces.PSSession'required by parameter 'Session'. Specified method is not supported.
At line:1 char:27
+ import-pssession -session $remote -commandname *-process -prefix remote
+ ~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Import-PSSession], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.ImportPSSessionCommand