Às vezes, quando tento executar um comando remoto em uma sessão do PowerShell a partir do PowerShell no Linux, recebo este erro:
Invoke-Command : Windows Principal functionality is not supported on this platform.
Do PowerShell no Mac funciona bem, mas com o PowerShell no Linux não funciona.
Do Ubuntu com:
$PSVersionTable
Name Value
---- -----
PSVersion 6.0.1
PSEdition Core
GitCommitId v6.0.1
OS Linux 4.4.0-1041-aws #50-Ubuntu SMP Wed Nov 15 22:18:17 UTC 2017
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Do CentOS com:
$PSVersionTable
Name Value
---- -----
PSVersion 6.0.2
PSEdition Core
GitCommitId v6.0.2
OS Linux 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Se eu tentar com o Enter-PSSession, obtenho sempre:
Enter-PSSession : You are currently in a PowerShell PSSession and cannot use the Enter-PSSession cmdlet to enter another PSSession.
E então, Invoke-Command funciona bem.
Tags powershell ubuntu centos