Passing script parameters

From PowerGUI Wiki

Jump to: navigation, search

Passing script parameters

The toolbar in the Script Editor contains a Script Parameters text box that you can use to specify the parameters that will be passed to the script when you run it.

To pass a parameter containing a space, put that parameter in single- or double-quotes or escape the space using the PowerShell escape character (the backtick: `). For example, if you wanted to pass in the string PowerShell Rocks, you could enter “PowerShell Rocks”, ‘PowerShell Rocks’, or PowerShell `Rocks.

You can also pass in subexpressions and any other PowerShell construct that you can use in PowerShell when executing a function, script block, or external script.

Personal tools