Call Windows PowerShell from Orchestrator

Call Windows PowerShell in different ways from System Center Orchestrator.

John Savill

October 7, 2013

1 Min Read
Call Windows PowerShell from Orchestrator

Q: Why are there different ways to call Windows PowerShell from System Center Orchestrator, and why do I need multiple methods?

A: System Center Orchestrator has a built-in activity, Run .Net Script, that's part of the System activities group. It enables the language to be set to PowerShell, allowing PowerShell scripts to be run. However, there's a problem: System Center Orchestrator (even System Center 2012 R2) is a 32-bit application, which means the native PowerShell execution runs in a V2.0, 32-bit PowerShell session. Therefore, it's common to need to trigger PowerShell using other methods.

  1. One easy option is to place the PowerShell within Powershell.exe { } which runs the code in a V3-but-still-32-bit PowerShell environment.

  2. To run in a V3, 64-bit PowerShell environment, use C:WindowssysnativeWindowsPowerShellv1.0powershell.exe { }.

  3. The last option is to use Invoke-Command -ComputerName localhost -ScriptBlock { }. This will also launch in a V3, 64-bit PowerShell environment, but it has the added benefit that the execution could also be done on a remote machine by changing localhost to a remote server.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like