ShiftNick

User Onboarding

Oct 27th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function Do-Stuff{
  2.   <#
  3.   .SYNOPSIS
  4.   Describe the function here
  5.   .DESCRIPTION
  6.   Describe the function in more detail
  7.   .EXAMPLE
  8.   Give an example of how to use it
  9.   .EXAMPLE
  10.   Give another example of how to use it
  11.   .PARAMETER NewHireFirstName
  12.   First name of new hire
  13.   .PARAMETER NewHireLastName
  14.   Last name of new hire
  15.   .PARAMETER ManagerName
  16.   Name of Manager
  17.   .PARAMETER CopyUserFirstName
  18.   First name of user to copy security groups and OU from
  19.   .PARAMETER CopyUserLastName
  20.   Last name of user to copy security groups and OU from
  21.   .PARAMETER EmailRequired
  22.   Switch that denotes whether an email address is required or not.
  23.   .PARAMETER UsageLocation
  24.   Country in which the user will be accessing email from primarily
  25.   .PARAMETER LicenseType
  26.   The type of license to assign in Office 365
  27.   #>
  28.  
  29.  
  30.   [CmdletBinding(SupportsShouldProcess=$True,ConfirmImpact='Medium')]
  31.   param
  32.   (
  33.     [Parameter(ParameterSetName = "Default",Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please Enter the first name of the new hire')]
  34.     [Parameter(ParameterSetName = "EmailRequired",Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please Enter the first name of the new hire')]
  35.     [Alias('FirstName')]
  36.     [string[]]$NewHireFirstName,
  37.  
  38.     [Parameter(ParameterSetName = "Default",Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please Enter the last name of the new hire')]
  39.     [Parameter(ParameterSetName = "EmailRequired",Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please Enter the last name of the new hire')]
  40.     [Alias('LastnameName')]
  41.     [string[]]$NewHireLastName,
  42.  
  43.     [Parameter(ParameterSetName = "Default",Mandatory=$False,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please Enter the managers name.')]
  44.     [Parameter(ParameterSetName = "EmailRequired",Mandatory=$False,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please Enter the managers name.')]
  45.     [Alias('Manager')]
  46.     [string[]]$ManagerName,
  47.  
  48.     [Parameter(ParameterSetName = "Default",Mandatory=$False,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please Enter the first name of the user to copy security groups from.')]
  49.     [Parameter(ParameterSetName = "EmailRequired",Mandatory=$False,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please Enter the first name of the user to copy security groups from.')]
  50.     [Alias('CUFirstName')]
  51.     [string[]]$CopyUserFirstName,
  52.  
  53.     [Parameter(ParameterSetName = "Default",Mandatory=$False,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please Enter the last name of the user to copy security groups from.')]
  54.     [Parameter(ParameterSetName = "EmailRequired",Mandatory=$False,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please Enter the last name of the user to copy security groups from.')]
  55.     [Alias('CULastName')]
  56.     [string[]]$CopyUserLastName,
  57.  
  58.     [Parameter(ParameterSetName = "EmailRequired",Mandatory=$True,)]
  59.     [Switch]$EmailRequired,
  60.  
  61.     [Parameter(ParameterSetName = "EmailRequired",Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please enter CA for Canada, US for United States or CN for China')]
  62.     [Alias('Location')]
  63.     [ValidateSet("CA","US","CN")]
  64.     [string]$UsageLocation,
  65.  
  66.     [Parameter(ParameterSetName = "EmailRequired",Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,HelpMessage='Please enter Standard for Enterprise')]
  67.     [Alias('License')]
  68.     [ValidateSet("Standard","Enterprise")]
  69.     [string]$LicenseType
  70.  
  71.   )
  72.  
  73.   begin {
  74.   write-verbose ""
  75.    
  76.   }
  77.  
  78.   process {
  79.  
  80.     write-verbose "Beginning process loop"
  81.  
  82.     foreach ($thing in $things) {
  83.       Write-Verbose "Processing $thing"
  84.       if ($pscmdlet.ShouldProcess($thing)) {
  85.        
  86.       }
  87.     }
  88.   }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment