PowerShell script to start, stop and cleanup all the three major browsers Internet Explorer (IE), Firefox (FF) & Chrome (GC)

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 (     [ValidateSet(‘IE’, ‘FF’, ‘GC’)][string]$BROWSER,     [ValidateSet(‘Start’, ‘Stop’, ‘Cleanup’)][string]$OPERATION,     [string]$LOG = $LogFile,     [bool]$DEBUG ) #=============================================================================== # Include Modules #=============================================================================== #=============================================================================== # Global Variables TEMP #=============================================================================== $Global:LogFile = "" $Global:BrowserExes = ""     #=============================================================================== # function  Initialize-Globals #=============================================================================== function  Initialize-Globals {     $LogPath        = $env:TEMP     $ScriptName        = "Template-Script.log"     $Global:LogFile = $LogPath + ” + $ScriptName     $Global:BrowserExes = […]

Read more

PowerShell Script to monitor a Process and restart it as soon as it dies

Script: # # PowerShell Script #=============================================================================== # Objective: # ———- #  This is will monitor for a System processes and starts if it is stops. #  Note: The exectubale of Process must be existing in the Path location # # $Header: $ #=============================================================================== # Process-Arguments #=============================================================================== param (     [string]$PROCESS,     [bool]$DEBUG ) #=============================================================================== # Include Modules #=============================================================================== #=============================================================================== # Global Variables #=============================================================================== $Global:ProcessName = ""     #=============================================================================== # function  Initialize-Globals #=============================================================================== function  Initialize-Globals {     #$Global:ProcessName    = "C:windowssystem32notepad.exe"     $Global:ProcessName     = "notepad"     Debug "Default Monitored Process [$Global:ProcessName]" } #=============================================================================== # function Process-Arguments #=============================================================================== function Process-Arguments {     $pProcessName […]

Read more