Go-Home
Sets the working directory to the user's home folder
#requires -version 5.1
try {
if (-not(Test-Path "~" -pathType container)) { throw "The path to home directory '$path' doesn't exist (yet)" }
$path = Resolve-Path "~"
Set-Location "$path"
$files = Get-ChildItem $path -attributes !Directory
$folders = Get-ChildItem $path -attributes Directory
"??$path entered (has $($files.Count) files and $($folders.Count) folders)"
exit 0 # success
} catch {
"?? ERROR: $($Error[0])"
exit 1
}This script has no configurable parameters.