For PS SSH Remoting, I can’t seem to find a non-interactive way to to obtain a session using New-PSSession, which for my command must include -HostName and -SSHTransport:
PS /home/gmonkey/scripts> $session = New-PSSession -HostName windns -Credential $cred -SSHTransport New-PSSession : Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided. At line:1 char:12 + $session = New-PSSession -HostName windns -Credential $cred -SSHTrans ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-PSSession], ParameterBindingException + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.NewPSSessionCommand
Is there a way to achieve this ?