Skip to content

Instantly share code, notes, and snippets.

@jstrassburg
Created February 26, 2014 16:33
Show Gist options
  • Save jstrassburg/9233122 to your computer and use it in GitHub Desktop.
Save jstrassburg/9233122 to your computer and use it in GitHub Desktop.
Using required or optional with default parameters to PowerShell scripts
param (
[string]$requiredParam = $(throw "-requiredParam FOO|BAR is expected"),
[string]$optionalParam = "DefaultValue"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment