Created
          February 26, 2014 16:33 
        
      - 
      
- 
        Save jstrassburg/9233122 to your computer and use it in GitHub Desktop. 
    Using required or optional with default parameters to PowerShell scripts
  
        
  
    
      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
    
  
  
    
  | 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