我试图在mac上的vs代码中从终端运行代码生成脚本,但每次我收到以下错误:
cmd: "..\node_modules\.bin\nswag" run
cmd : The term 'cmd' 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 ...
这是我试图运行的 ps1 脚本:
$invocation = (Get-Variable MyInvocation).Value
$directorypath = Split-Path $invocation.MyCommand.Path
Set-Location $directorypath
$cmdString = """" + "..\node_modules\.bin\nswag" + """" + " run";
Write-Host 'cmd:' $cmdString
cmd /c $cmdString