如何删除脚本和可执行文件前面带有".\"的PowerShell要求?
输入"a.exe"而不是".\ a.exe"时显示的PowerShell警告消息:
The command a.exe was not found, but does exist in the current location. Windows PowerShell doesn't load commands from the current location by default. If you trust this command, instead type ".\a.exe".
Run Code Online (Sandbox Code Playgroud)
man*_*lds 20
它是一种安全功能,因此您可以运行您认为正在运行的脚本.这就是为什么与cmd不同,你.在PATH中没有(当前目录)而你必须这样做.\my.exe等等.
如果您不想这样做并破坏此预防措施,请添加.到您的路径:
$env:PATH =$env:PATH+";."
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21408 次 |
| 最近记录: |