Skip to content

Go-Users

Sets the working dir to the users directory

#requires -version 5.1

try {
	$path = Resolve-Path "~/.."
	if (-not(Test-Path "$path" -pathType container)) { throw "No users directory at: $path" }

	Set-Location "$path"
	$folders = Get-ChildItem $path -attributes Directory
	"??$path with $($folders.Count) folders entered."
	exit 0 # success
} catch {
	"?? ERROR: $($Error[0])"
	exit 1
}

This script has no configurable parameters.

An interactive directory of PowerShell scripts.