2017-07-24 242 views
1

我正在使用powershell腳本,腳本正在調用.ps1中的.bat文件來運行nmake,這對我沒有意義,所以我希望將所有內容都移動到一個ps腳本中,添加編寫腳本會引發此錯誤The term 'NMAKE' is not recognized as the name of a cmdlet, function, script file...。無論如何,從PowerShell運行nmake?在powershell中運行nmake

+2

要麼將​​nmake文件夾添加到PATH環境變量,要麼提供nmake.exe的完整路徑。 (如果你在這個位置有引號,比如'&「C:\ path \ to \ nmake.exe」',那麼在前面放一個'&' – BenH

回答

2

如果它不在PATH環境變量中,請將文件路徑包含到可執行文件中。例如:

& 'Path\to\nmake.exe' /arg1 pass /arg2 in