Set Active Roles (ARS) Scheduled (PowerShell) Script Modules to Execute in PWSH.exe (v6+) vs POWERSHELL.exe

How can I explicitly instruct ARS to execute scripts in PowerShell v7

Parents
  • Currently Active Roles uses Windows PowerShell for its PowerShell runtime environment. There is no way to tell it to use the newer PowerShell in its place (good feature request idea though).

    With that said, you definitely can use PowerShell 6/7 to run the Active Roles Management Shell cmdlets outside of Active Roles. In fact, they actually run significantly faster when ran in a PowerShell 7 terminal. I haven’t tested every cmdlet with every parameter though so I would not be able to confidently say they will all work. I've passed this information onto some folks to see if we can get this tested to potentially list it as supported (still referring to outside the Active Roles runtime environment). I wouldn't be able to provide any sort of ETA on that as it would have to be properly reviewed and placed in the appropriate priority queue to get done.

    You could try using the start-process cmdlet to launch PWSH.exe with an external script file. You won't have the amount of integration as you do with a script module but it should work. Unfortunately I'm not in a position to test it at the moment so you'd have to test that on your own.

Reply
  • Currently Active Roles uses Windows PowerShell for its PowerShell runtime environment. There is no way to tell it to use the newer PowerShell in its place (good feature request idea though).

    With that said, you definitely can use PowerShell 6/7 to run the Active Roles Management Shell cmdlets outside of Active Roles. In fact, they actually run significantly faster when ran in a PowerShell 7 terminal. I haven’t tested every cmdlet with every parameter though so I would not be able to confidently say they will all work. I've passed this information onto some folks to see if we can get this tested to potentially list it as supported (still referring to outside the Active Roles runtime environment). I wouldn't be able to provide any sort of ETA on that as it would have to be properly reviewed and placed in the appropriate priority queue to get done.

    You could try using the start-process cmdlet to launch PWSH.exe with an external script file. You won't have the amount of integration as you do with a script module but it should work. Unfortunately I'm not in a position to test it at the moment so you'd have to test that on your own.

Children
No Data