PowerShell examples

Automation Workshop includes Execute script Action which, besides supporting other scripting formats, can execute PowerShell scripts automatically. The basic PowerShell examples provided below are aimed at giving the user a rather general idea how to streamline scripts into automated processes.

The data communication with other scripts is based on screen output. The screen output of the script can be retrieved by using Variable Wizard from subsequent Execute script Action. It is possible to retrieve either full screen output or any of the first six output lines separately.

PowerShell example #1
  • $text = "Hello world!"
    Write-Host $text

For PowerShell scripts using Unicode, it is recommended to use version 1.0 or 2.0 option instead of Default (see Script tab to change PowerShell version).

PowerShell example #2
  • [Console]::OutputEncoding = [Text.Encoding]::Utf8
    $text = "Hello wörld!"
    $text = $text.ToUpper()

    $insertthis = "Unicode "
    $text = $text.Insert( 6 , $insertthis )

    # HELLO Unicode WÖRLD!
    Write-Host $text

If you have any questions, please do not hesitate to contact our support team.

© 2001–2019 Febooti Ltd.