Advertisement
Guest User

Untitled

a guest
May 19th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. #requires -version 4
  2. <#
  3. .SYNOPSIS
  4. <Overview of script>
  5.  
  6. .DESCRIPTION
  7. <Brief description of script>
  8.  
  9. .PARAMETER <Parameter_Name>
  10. <Brief description of parameter input required. Repeat this attribute if required>
  11.  
  12. .INPUTS
  13. <Inputs if any, otherwise state None>
  14.  
  15. .OUTPUTS
  16. <Outputs if any, otherwise state None>
  17.  
  18. .NOTES
  19. Version: 1.0
  20. Author: <Name>
  21. Creation Date: <Date>
  22. Purpose/Change: Initial script development
  23.  
  24. .EXAMPLE
  25. <Example explanation goes here>
  26.  
  27. <Example goes here. Repeat this attribute for more than one example>
  28. #>
  29.  
  30. #---------------------------------------------------------[Script Parameters]------------------------------------------------------
  31.  
  32. Param (
  33. #Script parameters go here
  34. )
  35.  
  36. #---------------------------------------------------------[Initialisations]--------------------------------------------------------
  37.  
  38. #Set Error Action to Silently Continue
  39. $ErrorActionPreference = 'SilentlyContinue'
  40.  
  41. #Import Modules & Snap-ins
  42.  
  43. #----------------------------------------------------------[Declarations]----------------------------------------------------------
  44.  
  45. #Any Global Declarations go here
  46.  
  47. #-----------------------------------------------------------[Functions]------------------------------------------------------------
  48.  
  49. <#
  50.  
  51. Function <FunctionName> {
  52. Param ()
  53.  
  54. Begin {
  55. Write-Host '<description of what is going on>...'
  56. }
  57.  
  58. Process {
  59. Try {
  60. <code goes here>
  61. }
  62.  
  63. Catch {
  64. Write-Host -BackgroundColor Red "Error: $($_.Exception)"
  65. Break
  66. }
  67. }
  68.  
  69. End {
  70. If ($?) {
  71. Write-Host 'Completed Successfully.'
  72. Write-Host ' '
  73. }
  74. }
  75. }
  76.  
  77. #>
  78.  
  79. #-----------------------------------------------------------[Execution]------------------------------------------------------------
  80.  
  81. #Script Execution goes here
  82.  
  83. #-----------------------------------------------------------[Signature]------------------------------------------------------------
  84.  
  85. #Signature Block - Script code signing block goes here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement