小编Ari*_*Ari的帖子

如何将脚本添加到路径?

我将常用的 powershell 脚本存储在%USERPROFILE%\Bin. 我创建了一个USER_BIN环境变量,我PATH通过Control Panel > System and Security > System > Advanced system setting > Environment Variables.

当我在cmd 或 powershell 提示符中输入存储在Bin, 即中的脚本的名称时,my-script.ps1我收到消息my-script.ps1 : The term 'my-script.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

如果我提供完整路径,即C:\Users\Ari\Bin\my-script.ps1脚本工作正常。

script powershell path windows-8

5
推荐指数
1
解决办法
7428
查看次数

标签 统计

path ×1

powershell ×1

script ×1

windows-8 ×1