This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Invoke-ElevatedRights | |
| { | |
| [CmdletBinding()] | |
| param() | |
| <# | |
| .SYNOPSIS | |
| Relaunch the script with elevated rights if required | |
| .DESCRIPTION | |
| Checks if the current user is running the script 'As Administrator' | |
| If they are not, relaunch the script in a new process with elevated rights |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| A brief description of the function or script | |
| .DESCRIPTION | |
| A longer description | |
| .NOTES | |
| Version: yyyy.mm.dd | |
| Author: Author Name | |
| Info: Release Notes | |
| #> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [CmdletBinding()] | |
| param() | |
| # This works for PowerShell 5.1 but needs to be re-written for 7 | |
| #region FUNCTIONS | |
| function Initialize-EventLog | |
| { | |
| <# | |
| .SYNOPSIS |
NewerOlder