How to pass needed parameters to script in Powershell ISE?

eckes picture eckes · Jan 14, 2011 · Viewed 65.6k times · Source

See Title.

I specified needed parameters in the head of a script:

param ($G_ARCHIVE = $(throw "Need file to upload!"),
       $G_LOGFILE = $(throw "Need logfile!"))

When I want to debug the script with Powershell ISE: how can I fill these parameters?

Answer

Roman Kuzmin picture Roman Kuzmin · Jan 14, 2011

Use the command pane. Open the script file in the ISE editor, set the breakpoints (F9). Then in the command pane type a command invoking this script with required parameters. I do not think there is another (built-in) way of doing this in ISE.