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
| $scriptDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | |
| #Create default config if one does not exist | |
| function Write-DefaultConfig | |
| { | |
| if ( -not (Test-Path $scriptDir\Config.xml -PathType Leaf)) | |
| { | |
| "<root> | |
| <Variable1>Value1</Variable1> | |
| <Variable2>Value2</Variable2> |
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 Use-RunAs | |
| { | |
| # Check if script is running as Adminstrator and if not use RunAs | |
| # Use Check Switch to check if admin | |
| param([Switch]$Check) | |
| $IsAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()` | |
| ).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") | |
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
| $scriptDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | |
| try | |
| { | |
| git.exe | Out-Null | |
| } | |
| catch [System.Management.Automation.CommandNotFoundException] | |
| { | |
| Write-Host "Please install Git" | |
| $HasReq = "False" | |
| Start-Sleep -Seconds 2 |
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
| Set-ExecutionPolicy Bypass -Scope Process -Force | |
| function Use-RunAs | |
| { | |
| # Check if script is running as Adminstrator and if not use RunAs | |
| # Use Check Switch to check if admin | |
| param([Switch]$Check) | |
| $IsAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()` |