How to use PowerShell Core in a Cross-Platform Automation Workflow

Mac OS X Addendum

With the current release 2021.12 is also a Mac OS X version of the assistant available. As participant of the private preview I tried this approach, which I presented here, also on a Mac OX X environment.

The sequence looks like this:

It is nearly the same as above, the only difference is here, that the Invoke Code Activity is not in an own workflow.

The arguments are:
FilePath - Path to PowerShell source: System.Environment.CurrentDirectory() & “/Test.ps1”
Parameters - Arguments of the PowerShell script: String.Empty
TimeOut - Period of time to wait for the process to exit: -1
PwshPath - Path to PowerShell interpreter: “/Users/root1/Language/PowerShell”

My example PowerShell script is a reduced variant from above:

#-Begin---------------------------------------------------------------

$Return = "Hello World from PowerShell Core " + `
(Get-Host).Version.Major.ToString() + "." + `
(Get-Host).Version.Minor.ToString() + "." + `
(Get-Host).Version.Build.ToString();

$Return | Out-String;

#-End-----------------------------------------------------------------

It delivers only the current version of PowerShell Core.

The C# code is exactly the same as above.

Here is the orchestrator displaying the log message:

And last but not least the UiPath Assistant on Mac OS X which displays the executed process:

Conclusion

It was very exciting to use UiPath Assistant on Mac OS X with PowerShell Core. What I wrote above, I can only repeat, but with the addition of Mac OS X:

PowerShell Core is available for Windows, a lot of Linux platforms and Mac OS X, so it is only logical to integrate it into a cross-platform project. On this way we have the possibility to create automation workflows, with PowerShell Core integration, which works on Windows, Linux and Mac OS X platform equally, under the control of the UiPath Orchestrator. At the moment, the range of Activities is limited, but look at the potential of this development, it gives me goose pimples.

1 Like