Skip to content

Instantly share code, notes, and snippets.

View AmadeussSystem's full-sized avatar

Ayush Saroj AmadeussSystem

View GitHub Profile
$ErrorActionPreference = 'Stop'
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Warning "Administrator privileges required."
exit
}
$tempPath = Join-Path $env:TEMP "ProjectDeployment"
if (-not (Test-Path $tempPath)) {
New-Item -ItemType Directory -Force -Path $tempPath | Out-Null