小编Bri*_*one的帖子

从具有"路径中的非法字符"的位置在CMD.EXE中执行Powershell脚本

我试图在cmd.exe中调用Powershell脚本,脚本位于如下所示的位置:c:Data\foo - bar\_ location-1\ShellScript.ps1

当我调用此脚本时,我尝试在路径周围使用单引号和双引号,但没有运气.

PowerShell.exe -File "c:\Data\foo - bar\location-1\ShellScript.ps1" Arg1 Arg2
Run Code Online (Sandbox Code Playgroud)

根据我的阅读,我认为上述内容可行,但这不起作用,也没有单引号.

我很欣赏任何想法.

谢谢*编辑*我的示例路径上的Mistype.抱歉.

powershell cmd

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

cmd ×1

powershell ×1