我尝试使用以下方法运行powershell脚本:
> PowerShellInstance.AddScript(
> @"write-output balls;Start-Sleep -s 2;write-output balls;Start-Sleep -s 2;write-output balls;Start-Sleep -s 2");
这样可以正常工作,但以下情况并非如此。有什么想法吗?
PowerShellInstance.AddScript(
@"c:\folder\script.ps1");
答案 0 :(得分:-1)
这就是为什么......
PowerShellInstance.AddScript(
@"& ""c:\folder\script.ps1""");