我看过此脚本https://github.com/danielbohannon/Out-FINcodedCommand/blob/master/README.md
并且当我尝试给出的示例时出现错误
Out-FINcodedCommand.ps1 : The term 'Out-FINcodedCommand.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.
At line:1 char:1
Out-FINcodedCommand.ps1 -command "iex (iwr https://github.com/danielb ...
CategoryInfo : ObjectNotFound: (Out-FINcodedCommand.ps1:String) [], CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundException
您能帮忙吗?
您在哪里运行它。在其前面添加。\
.\Out-FINcodedCommand.ps1
如果它不是CD的目录,则。\必须位于整个字符串的前面
.\Downloads\Out-FINcodedCommand-master\Out-FINcodedCommand-master\Out-FINcodedCommand.ps1
用背景信息补充SureThing's effective solution:
通过设计,出于安全考虑,PowerShell-与cmd.exe
不同-不通过文件name调用current目录中的可执行文件(包括scripts)仅。
Path
([C0 ])。例如$env:PATH
,其目录findstr.exe
在C:\WINDOWS\system32
中列出。要在命令查找路径中调用not的可执行文件,必须使用文件path:
文件路径可能是absolute(完整)或relative(并且可能基于变量)。
因此,调用位于[[current目录中的脚本,在文件名前加上$env:PATH
(.\
指当前目录),在当前情况下,这意味着.