Skip to content

cd-sync

Sets the working directory to the user's Sync folder

#requires -version 5.1

try {
	if (-not(Test-Path "~/Sync" -pathType container)) {
		throw "No 'Sync' folder in your home directory yet - Please install Syncthing."
	}
	$path = Resolve-Path "~/Sync"
	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
} catch {
throw
}

This script has no configurable parameters.

An interactive directory of PowerShell scripts.