Skip to content

Instantly share code, notes, and snippets.

View JackScott7's full-sized avatar
🎯
Focusing

Jack Scott JackScott7

🎯
Focusing
View GitHub Profile
@JackScott7
JackScott7 / Microsoft.PowerShell_profile.ps1
Created September 14, 2025 11:58
Easily set new PATH Env Var Value on windows in PS7
function Add-User-Path {
[CmdletBinding()]
param([Parameter(Mandatory)][string]$Path)
# Normalize & validate
try { $p = (Resolve-Path -LiteralPath $Path -ErrorAction Stop).Path }
catch { throw "Path not found: $Path" }
if (-not (Test-Path -LiteralPath $p -PathType Container)) { throw "Not a directory: $p" }
# Get current PATH (User)