Installation

Windows

WinGet

winget install Microsoft.Powershell
winget upgrade Microsoft.Powershell
# Add wrapper
# Create directory if not exist
New-Item -ItemType Directory -Path $PROFILE/../ -Force
 
# Create file, abort if exists
New-Item -ItemType File -Path $PROFILE

Usage

# Start another powershell as admin
Start-Process powershell -Verb runAs
# Get command inforamtion
Get-Command powershell
# Check current elevation
net session
# Set Environment Variable
# Scopes : User, Machine, Process
[System.Environment]::GetEnvironmentVariables([System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable('key','value', 'Machine')

Appendix