【发布时间】:2019-03-24 14:42:07
【问题描述】:
我正在使用 powershell 向 Windows 7 x64 添加密钥
到目前为止,我已经使用 powershell 尝试了以下命令
powershell -executionpolicy bypass -file install-sshed.ps1
我收到这样的错误:
-File 参数的参数“install-sshed.ps1”不存在。提供现有“.ps1”文件的路径作为 -File 参数的参数
我做错了什么?
【问题讨论】:
-
Powershell not 如果没有提供路径,则默认使用当前目录,以显式引用当前文件夹在文件名前加上
.\=>.\install-sshed.ps1或使用@engineerer's answer建议的绝对路径 -
@LotPings:需要显式路径仅适用于
-Command,不适用于-File;如果后者引用当前目录中的文件,则后者很乐意接受仅文件名参数。
标签: powershell ssh windows-7-x64