相关疑难解决方法(0)

从Powershell ISE中的另一个PS1脚本调用PowerShell脚本PS1

我希望在Powershell ISE内的第二个myScript2.ps1脚本中调用myScript1.ps1脚本.

MyScript2.ps1中的以下代码在Powershell Administration中运行良好,但在PowerShell ISE中不起作用:

#Call myScript1 from myScript2
invoke-expression -Command .\myScript1.ps1
Run Code Online (Sandbox Code Playgroud)

从PowerShell ISE执行MyScript2.ps1时出现以下错误:

术语".\ myScript1.ps1"未被识别为cmdlet,函数,脚本文件或可操作程序的名称.检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试.

powershell

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

标签 统计

powershell ×1