Skip to content

Instantly share code, notes, and snippets.

View maxux's full-sized avatar
🔑

Maxime Daniel maxux

🔑
View GitHub Profile
@albertvaka
albertvaka / ~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Last active June 20, 2026 11:14
Powershell 'cd' that behaves properly: zero args bring you home, passing '-' brings you to the previous dir
del alias:cd -Force # Remove builtin cd alias to Set-Location
function cd {
$pwd = Get-Location
if ($args.Count -eq 0) {
Set-Location ~
} elseif ($args[0] -eq "-") {
Set-Location @global:OLDPWD
} else {
Set-Location @args
}