PowerShell Template script#2: With detailed logging functions, with color output messages to console and Paramaters values assignments
Script: # # PowerShell Script #=============================================================================== # Objective: # ———- # This is a basic template script that comes with default script sections along # with debug options set. # # # $Header: $ #=============================================================================== # Process-Arguments #=============================================================================== param ( [string]$LOG = $LogFile, [bool]$DEBUG ) #=============================================================================== # Include Modules #=============================================================================== #=============================================================================== # Global Variables TEMP #=============================================================================== $Global:LogFile = "" #=============================================================================== # function Initialize-Globals #=============================================================================== function Initialize-Globals { $LogPath = $env:TEMP $ScriptName = "Template-Script.log" $Global:LogFile = $LogPath + ” + $ScriptName #Debug "Init $LogFile" } #=============================================================================== # function Process-Arguments #=============================================================================== function Process-Arguments { $pLogFile […]
Read more