我想援引Powershell文件从C#Visual Studio的解决方案。
显然,调试时,它的出现,它没有做任何事情的时命线调用PS1文件。
我得到这个消息:
我有这些行内部C#:
using System.Management.Automation;
PowerShell ps = PowerShell.Create();
ps.AddScript(File.ReadAllText(@"C:\Users\Justin\source\repos\HttpTrigger_1119\HttpTrigger_1119\list.ps1")).Invoke();
我的下一次尝试把断点内ps1文件本身。
但是,它的出现,它甚至没有停止在断点的ps1文件。
因为,它没有打断点内ps1文件,可能会有东西丢失援引PS1文件,不是吗?
任何东西添加从现有的两条线?
PowerShell ps = PowerShell.Create();
ps.AddScript(File.ReadAllText(@"C:\Users\Justin\source\repos\HttpTrigger_1119\HttpTrigger_1119\list.ps1")).Invoke();