PowerShell v7 instead of Microsoft PowerShell v5.1 in the script activity of SCORCH 2019

Charles 21 Reputation points
2023-04-13T05:46:10.1266667+00:00

Do you know if I can use PS v7 instead of Microsoft PowerShell v5.1 in the script activity of SCORCH 2019?

System Center Orchestrator
System Center Orchestrator
A family of System Center products that provide an automation platform for orchestrating and integrating both Microsoft and non-Microsoft IT tools.
214 questions
0 comments No comments
{count} votes

Accepted answer
  1. Stefan Horz 3,461 Reputation points
    2023-04-13T16:07:20.13+00:00

    Hi, the steps are:

    • Install PowerShell Core on the Runbook Server(s)
    • Enable Remoting
    • Invoke PowerShell with pwsh {#yourscript } in
       $Result = pwsh {
           $version=(get-host).Version
           return $version
       }2>&1
    

    Activity

    Result

    Regards, Stefan

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Andreas Baumgarten 96,361 Reputation points MVP
    2023-04-13T06:18:56.63+00:00

    Hi @carlos , there is a workaround to use PowerShell 7 with SCORCH: https://www.miru.ch/how-to-execute-64-bit-powershell-scripts-in-system-center-orchestrator/ Instead of the 64bit PowerShell executable you have to provide the exe of PowerShell v7 in the script followed by the scriptblock in curly brackets.


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten

    1 person found this answer helpful.