我正在嘗試輸入新的PSSession。如果我手動運行它的每一行,但是當我將它作爲腳本的一部分運行時,出現錯誤。這些信用是有效的,看起來會話是創建的,我只是不能在腳本中輸入它。引用的行號是寫主機。即使我只是有一個賦值給一個變量,它也存在錯誤。試圖進入psssession時Powershell錯誤
$cred = New-Object Management.Automation.PSCredential ($username, $pw)
New-PSSession -ComputerName App02 -Credential $cred
Get-PSSession | Enter-PSSession
Write-Host "ERROR: Partial Service Deployment. See error log file(s)"
我得到這個作爲一個錯誤:
Cannot perform operation because operation "NewNotImplementedException at offset 63 in file:line:column :0:0 " is not implemented. At C:\DEV\Sandbox\Sandbox.ps1:29 char:14 + Write-Host "ERROR: Partial Service Deployment. See error log file(s ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotImplemented: (:) [], RuntimeException + FullyQualifiedErrorId : NotImplemented