My remote runspaces works fine when I'm using PS 3.0+ but as soon as I'm running my code using PS 2.0, SessionStateProxy
property is null (but only when I try to create remote runspace.
powershell -version 2
$Uri = New-Object System.Uri("http://WIN-10NL6N4THGJ:5985/wsman")
$connectionInfo = New-Object System.Management.Automation.Runspaces.WSManConnectionInfo($Uri)
$runspace = [runspacefactory]::CreateRunspace($connectionInfo)
$runspace.Open()
$runspace |select *
$runspace.SessionStateProxy
SessionStateProxy
property should be System.Management.Automation.RemoteSessionStateProxy
but it is $null
. Any clue?