powershell - -File 参数的参数 'install-sshed.ps1' 不存在 |电源外壳

标签 powershell ssh windows-7-x64

我正在使用 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

关于powershell - -File 参数的参数 'install-sshed.ps1' 不存在 |电源外壳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55324936/

相关文章:

powershell - 如何使用 PowerShell 以编程方式更改 Windows Shell 设置?

powershell - 连接 2 个变量 (Powershell)

c# - 从 .Net Core 运行 Powershell - 无法加载文件或程序集 Microsoft.Management.Infrastruct

windows - Git,无法在 Windows 上克隆 repo 协议(protocol)

python - 如何使 USB 摄像头与 OpenCV 配合使用?

android - 我在尝试运行 Android 虚拟设备时收到错误列表

windows - 使用PowerShell 创建AppPool 没有设置AppPool Identity

git - MacOS:使用 Bitbucket 和 Github、SSH key ?

hadoop - 用于 Hadoop 开发的 Eclipse 设置

github - 如何让 Jenkins 通过 Composer 检查私有(private)供应商 repo