0
私は$remote = New-PsSesion ...
でセッションを作成しました。後で対話的に使用したいと思います。既存セッションのEnter-PSSession
私はを試しましたが、Enter-PSSession:指定された名前付きパラメータを使用してパラメータセットを解決することはできません。 Id
パラメータを使用する場合も同様です。
=== === EDIT
> New-PSSession
Id Name ComputerName ComputerType State ConfigurationName Availability
-- ---- ------------ ------------ ----- ----------------- ------------
1 Session1 localhost RemoteMachine Opened Microsoft.PowerShell Available
> etsn -Id 1
Enter-PSSession : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ etsn -Id 1
+ ~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Enter-PSSession], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.EnterPSSessionCommand
> $host
Name : ConsoleHost
Version : 5.1.14393.1198
InstanceId : ab8e55cd-69ae-4587-a70a-c66f197028a4
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : sr-Latn-RS
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
他のパラメータは使用していますか?私はテスト環境でテストしたところ、すべて正常に動作しました。以下のコメントの私の環境からの出力。また、New-PSSessionでSが見つからないように、あなたの質問を再読してください。あなたはNew-PSSesionを持っています。 –
PS C:\ WINDOWS \ SYSTEM32> $ dc1remote =新-PSSessionコマンド-VMName DC1 -Credential timhaintz \管理者 PS C:\ WINDOWS \ SYSTEM32>入力し-PSSessionは$ dc1remote [DC1]:PS C:\ Users \ユーザーPS C:\ WINDOWS \ system32> Enter-PSSession -Session $ dc1remote [dc1]:PS C:\ Users \ Administrator \ Documents>終了 –
PS版は何ですか?あなたは完全なセッションの定義は、あなたが好きならスクラブのように見えます。 – Matt