Skip to content

Instantly share code, notes, and snippets.

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