【发布时间】:2015-05-19 10:40:36
【问题描述】:
我正在尝试运行此代码:
using (PowerShell PowerShellInstance = PowerShell.Create())
{
_outputCollection.DataAdded += outputCollection_DataAdded;
PowerShellInstance.AddScript(@"workflow test { Write-Warning 'this is a warning'; }; test");
IAsyncResult result = PowerShellInstance.BeginInvoke<PSObject, PSObject>(null, _outputCollection);
}
但我收到此错误:
Windows PowerShell 不支持 Windows PowerShell 工作流 基于 x86 的控制台。打开基于 Windows PowerShell x64 的控制台,然后 然后再试一次。
如何从 C# 打开基于 x64 的 Powershell 实例?
【问题讨论】:
-
是否可以选择将程序集的目标平台更改为 x86?
-
不,不幸的是
-
您为什么要问与问题标题不同的问题?请考虑将您的问题重命名为“如何从 C# 打开基于 x64 的 Powershell 实例?”
标签: c# powershell workflow powershell-workflow