8.2. Executing PowerShell Scripts from Other Environments

No matter how strongly we wish it, the entire world is not using PowerShell—yet! We will have to integrate our PowerShell code with existing solutions. We can write a useful script and execute it from a Windows scheduled task. We can transition an existing scripting solution piece by piece by developing new parts in PowerShell or porting existing functionality to PowerShell and integrating them with the existing solution by using command execution. All automation environments, task scheduler services, software build systems, and so on can execute an external command. That is where we can plug in a PowerShell script.

How do we run a PowerShell script from an external program then? Let's ...

Get Pro Windows PowerShell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.