PowerShell Workflow with Input Parameters


Just like PowerShell functions, workflows can accept input parameter. Input parameters can optionally be bound to a specific data type, such as a string, integer, etc. Use the standard param keyword to define a block of input parameters, directly after the workflow declaration.

workflow DoSomeWork {
  param (
    [string[]] $ComputerName
  Get-Process -ComputerName $ComputerName

DoSomeWork -ComputerName server01, server02, server03