Skip to content

Instantly share code, notes, and snippets.

@mallibone
Created February 5, 2017 13:20
Show Gist options
  • Save mallibone/d05ed9a851113e8a3874b4ec64eead3d to your computer and use it in GitHub Desktop.
Save mallibone/d05ed9a851113e8a3874b4ec64eead3d to your computer and use it in GitHub Desktop.
function MultipleParameters
{
Param(
[Parameter(Position = 0)][string]$Message,
[Parameter(Position = 1)][string]$SecondMessage,
[Parameter(Position = 2)][bool]$PrintItYellow
)
if($PrintItYellow)
{
Write-Host "$Message $SecondMessage" -ForegroundColor "Yellow"
}
else
{
Write-Host "$Message $SecondMessage"
}
}
MultipleParameters "Sometimes one parameter" "just will not cut it" $true
MultipleParameters -SecondMessage "just will not cut it" -Message "Sometimes one parameter" -PrintITYellow $true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment