首页 > 解决方案 > -File 参数的参数“install-sshed.ps1”不存在| 电源外壳

问题描述

我正在使用 powershell 向 Windows 7 x64 添加密钥

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

powershell -executionpolicy bypass -file install-sshed.ps1

我收到这样的错误:

-File 参数的参数“install-sshed.ps1”不存在。提供现有“.ps1”文件的路径作为 -File 参数的参数

我做错了什么?

标签: powershellsshwindows-7-x64

解决方案


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

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

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

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

推荐阅读