All templates
ScriptingIntermediate
Display PowerShell Output
Robomotion•Updated 6 months ago

Overview
Runs a PowerShell script and displays the captured standard output in a dialog.
Display PowerShell Output
PowerShell is a cross-platform shell and scripting language that allows users to interact with the operating system. Flows support the implementation of PowerShell scripts to retrieve system information and automate administrative operations.
What Display PowerShell Output can do
- Run PowerShell script (
Core.Process.StartProcess) — runspowershellwith-NoProfile -Command '$variableName = "Hello World!"; Write-Output $variableName', captures stdout intomsg.powershell_output. - Trim output (
Core.Programming.Function) — strips trailing CR/LF frommsg.powershell_output. - Message Dialog (
Core.Dialog.MessageBox,optType: info) titledOutput from PowerShell script:showsmsg.powershell_output, thenCore.Flow.Stop.
Behind the scenes
Write-Outputsends the value on the success stream;Core.Process.StartProcesscaptures it as stdout. A bare$variableNameline would behave identically — the explicit form is kept for clarity.-NoProfileskips the user's PowerShell profile so the script starts faster and stays deterministic across machines.- The captured text typically has a trailing CR/LF, which the Function node trims before the dialog.