Created
February 5, 2017 13:31
-
-
Save mallibone/819116817213684531a17fbdcaf8a9dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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