我正在使用 powershell 将 key 添加到 windows 7 x64

到目前为止,我已经使用 powershell 尝试了以下命令

powershell -executionpolicy bypass -file install-sshed.ps1 

我遇到这样的错误:

The argument 'install-sshed.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter

我做错了什么?

请您参考如下方法:

您的 PowerShell session 似乎是在与您的 PowerShell 脚本不同的文件夹中启动的。尝试将完整路径添加到您的 PowerShell 脚本:

powershell -executionpolicy bypass -file "c:\scripts\install-sshed.ps1" 

或者,先切换到*.ps1 文件所在的目录:

cd c:\scripts 
powershell -executionpolicy bypass -file install-sshed.ps1 


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!