【发布时间】:2011-09-19 09:56:31
【问题描述】:
尝试通过 Cygwin/OpenSHH 从 Ubuntu 主机到 Windows 客户端执行以下命令。
ssh USER@HOSTNAME powershell -Command "& {Get-Host}"
输出:
Cannot process the command because of a missing parameter. A command must follow -Command.
但是,当我在 windows 客户端中通过 cygwin 尝试相同的命令时,我得到了正确的输出。
$ powershell -Command "& {Get-Host}"
Welcome to Powershell augmented with NaviNet tools.
Bootstrapped ScmToolsProjectConfiguration.
Name : ConsoleHost
Version : 2.0
InstanceId : 0b2e578e-50b9-42ab-a07c-0c4ef762ba0c
UI : System.Management.Automation.Internal.Host.InternalHostUser
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
【问题讨论】:
-
SSH 可能在那里吃引号。
标签: python linux powershell ssh cygwin