我正在通过ssh
Linux 服务器运行 PowerShell 命令,我需要$ProgressPreference = 'SilentlyContinue'
在一个行中指定一个Invoke-Request
命令。
ssh [email protected] PowerShell \$ProgressPreference='SilentlyContinue'; Invoke-WebRequest -Uri https://example.com/archive.zip -OutFile archive.zip;
由于失败
SilentlyContinue : The term 'SilentlyContinue' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:21
+ $ProgressPreference=SilentlyContinue
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (SilentlyContinue:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我试过了
- 省略转义
$
- 各种报价
'
及其"
组合\"
导致非常相似的错误消息表明找不到命令或对象。
我在 Google Compute Platfrom VM 的 Windows Server 2019 Datacenter 上运行 OpenSSH,并从运行在 Google Kubernetes 上的 Google Cloud SDK Docker 映像 327.0.0 进行连接。