cd-onedrive
Sets the working dir to the OneDrive folder
#requires -version 5.1
try {
if (-not(Test-Path "~/OneDrive" -pathType container)) {
throw "No 'OneDrive' folder in your home directory - Please install OneDrive."
}
$path = Resolve-Path "~/OneDrive"
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.