Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从另一个powershell窗口访问powershell会话?_Powershell - Fatal编程技术网

如何从另一个powershell窗口访问powershell会话?

如何从另一个powershell窗口访问powershell会话?,powershell,Powershell,我有一个由创建的powershell会话 New-PSSession -ComputerName localhost 我可以通过以下方式访问上述会话: PS C:\> Get-PSSession Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- -----------------

我有一个由创建的powershell会话

New-PSSession -ComputerName localhost
我可以通过以下方式访问上述会话:

PS C:\> Get-PSSession

 Id Name            ComputerName    State    ConfigurationName     Availability
 -- ----            ------------    -----    -----------------     ------------
  1 Session1        localhost       Opened   Microsoft.PowerShell     Available

PS C:\> Enter-PSSession -Id 1
现在,如果我打开另一个powershell窗口,那么我可以访问上面创建的会话吗?
我确实尝试过,但“进入PSSession-ID1”对我来说不起作用。这可能吗?

您无法从一个实例连接到另一个实例中创建的会话,会话是隔离的,仅对创建它们的主机可用