powershell - -File 参数的参数“install-sshed.ps1”不存在| 电源外壳
问题描述
我正在使用 powershell 向 Windows 7 x64 添加密钥
到目前为止,我已经使用 powershell 尝试了以下命令
powershell -executionpolicy bypass -file install-sshed.ps1
我收到这样的错误:
-File 参数的参数“install-sshed.ps1”不存在。提供现有“.ps1”文件的路径作为 -File 参数的参数
我做错了什么?
解决方案
您的 PowerShell 会话似乎是在与 PowerShell 脚本不同的文件夹中启动的。尝试将完整路径添加到您的 PowerShell 脚本:
powershell -executionpolicy bypass -file "c:\scripts\install-sshed.ps1"
或者,首先切换到文件所在的目录*.ps1
:
cd c:\scripts
powershell -executionpolicy bypass -file install-sshed.ps1
推荐阅读
- python - 在 python 单元测试中模拟嵌套函数
- sql-server - 在制作 SSRS 报告时在 Visual Studio 中写四个字时出现问题
- pygame - 当球击中桨的侧面时,对我的代码和错误发表意见
- python - 在穿过网格的线段中,如何在每个网格中提取该线的点
- python - 如何使用 Python 在 csv 或 excel 中制作树视图
- apache-zookeeper - UDDI 与服务注册中心
- c# - 在 C# wpf 中将数据从窗口传递到视图模型
- java - Ashot 屏幕截图无法正确裁剪屏幕截图中的元素
- android - 对讲未读取 NumberPicker 的最终条目
- big-o - 用于检查子集的 js 函数的大 O 表示法