我想我找到了答案 這是從本地Get-Host
Name : Windows PowerShell ISE Host
Version : 4.0
InstanceId : 14cd6e79-2839-4297-8c7e-ac003f9715a2
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.Host.ISE.ISEOptions
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
他是從遠程Get-Host
PSComputerName : meculab13001.global.sdl.corp
RunspaceId : 34fca087-793c-4c87-bab8-8be5d61d06e5
Name : ServerRemoteHost
Version : 1.0.0.0
InstanceId : 3fcb51c2-30c1-49af-8898-afbd5574b20b
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData :
Runspace : System.Management.Automation.Runspaces.LocalRunspace
我認識兩個區別 在一個遠程執行上下文,PSComputerName
是定義爲 在遠程執行上下文中,Name
是ServerRemoteHost
而不是