############################################################################### # Copyright (c) 2005 Microsoft Corporation. All rights reserved. # # CustomPatchInstallerActions.ps1.template # ############################################################################### # Location of folder of log actions performed by the script, to help with troubleshooting # $script:logDir = "$env:SYSTEMDRIVE\ExchangeSetupLogs" ############################################################################### # Log( $entry ) # Add an entry to the log file # Append a string to a well-known text file with a time stamp # Params: # Args[0] - Entry to write to log # Returns: # void function Log { $entry = $Args[0] $line = "[{0}] {1}" -F $(get-date).ToString("HH:mm:ss"), $entry add-content -Path "$script:logDir\CustomPatchInstallerActions.log" -Value $line } ############################################################################### # # PatchRollbackActions # Include items to run for rollback here # function PatchRollbackActions { Log "Running PatchRollbackActions" } ############################################################################### # # PrePatchInstallActions # Include items to run before the patch here # function PrePatchInstallActions { Log "Running PrePatchInstallActions" } ############################################################################### # # PostPatchInstallActions # Include items to run after the patch here # function PostPatchInstallActions { Log "Running PostPatchInstallActions" } ############################################################################### # # Main function # Installer will call the cript with the following options # switch ($Args[0]) { {$_ -ieq "PrePatchInstallActions" } { PrePatchInstallActions break } {$_ -ieq "PostPatchInstallActions" } { PostPatchInstallActions break } {$_ -ieq "PatchRollbackActions"} { PatchRollbackActions break } } Exit 0