diff --git a/scripts/cd-dropbox.ps1 b/scripts/cd-dropbox.ps1 index 0d515c10..9ca3274c 100755 --- a/scripts/cd-dropbox.ps1 +++ b/scripts/cd-dropbox.ps1 @@ -5,7 +5,7 @@ This PowerShell script changes the working directory to the user's Dropbox folder. .EXAMPLE PS> ./cd-dropbox - πŸ“‚C:\Users\Markus\Dropbox (has 2 files and 4 subfolders) + πŸ“‚C:\Users\Markus\Dropbox (has 2 files and 0 folders) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -14,13 +14,13 @@ try { if (-not(Test-Path "~/Dropbox" -pathType container)) { - throw "No πŸ“‚Dropbox folder in your home directory - is Dropbox installed?" + throw "No 'Dropbox' folder in your home directory - is Dropbox installed?" } $path = Resolve-Path "~/Dropbox" Set-Location "$path" $files = Get-ChildItem $path -attributes !Directory $folders = Get-ChildItem $path -attributes Directory - "πŸ“‚$path entered (has $($files.Count) files and $($folders.Count) subfolders)" + "πŸ“‚$path entered (has $($files.Count) files and $($folders.Count) folders)" exit 0 # success } catch { "⚠️ Error: $($Error[0])" diff --git a/scripts/cd-etc.ps1 b/scripts/cd-etc.ps1 index 49fd48bf..1b5a7912 100755 --- a/scripts/cd-etc.ps1 +++ b/scripts/cd-etc.ps1 @@ -5,7 +5,7 @@ This PowerShell script changes the working directory to the /etc directory. .EXAMPLE PS> ./cd-etc - πŸ“‚C:\Windows\System32\drivers\etc (has 2 files and 3 subfolders) + πŸ“‚C:\Windows\System32\drivers\etc (has 5 files and 0 folders) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -19,12 +19,12 @@ try { $path = Resolve-Path "$env:WINDIR\System32\drivers\etc" } if (-not(Test-Path "$path" -pathType container)) { - throw "No /etc directory at πŸ“‚$path" + throw "No 'etc' folder found at: $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) subfolders)" + "πŸ“‚$path entered (has $($files.Count) files and $($folders.Count) folders)" exit 0 # success } catch { "⚠️ Error: $($Error[0])" diff --git a/scripts/cd-nextcloud.ps1 b/scripts/cd-nextcloud.ps1 index d405cf72..1a78e2f2 100755 --- a/scripts/cd-nextcloud.ps1 +++ b/scripts/cd-nextcloud.ps1 @@ -5,7 +5,7 @@ This PowerShell script changes the working directory to the user's NextCloud folder. .EXAMPLE PS> ./cd-nextcloud - πŸ“‚C:\Users\Markus\NextCloud entered (has 2 files and 3 subfolders) + πŸ“‚C:\Users\Markus\NextCloud entered (has 2 files and 0 folders) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -13,14 +13,14 @@ #> try { - $path = Resolve-Path "~/NextCloud" - if (-not(Test-Path "$path" -pathType container)) { - throw "No NextCloud folder at $path - is NextCloud installed?" + if (-not(Test-Path "~/NextCloud" -pathType container)) { + throw "No 'NextCloud' folder in your home directory - is NextCloud installed?" } + $path = Resolve-Path "~/NextCloud" Set-Location "$path" $files = Get-ChildItem $path -attributes !Directory $folders = Get-ChildItem $path -attributes Directory - "πŸ“‚$path entered (has $($files.Count) files and $($folders.Count) subfolders)" + "πŸ“‚$path entered (has $($files.Count) files and $($folders.Count) folders)" exit 0 # success } catch { "⚠️ Error: $($Error[0])" diff --git a/scripts/cd-onedrive.ps1 b/scripts/cd-onedrive.ps1 index af66cb4f..bf30aa3d 100755 --- a/scripts/cd-onedrive.ps1 +++ b/scripts/cd-onedrive.ps1 @@ -5,7 +5,7 @@ This PowerShell script changes the working directory to the user's OneDrive folder. .EXAMPLE PS> ./cd-onedrive - πŸ“‚C:\Users\Markus\OneDrive entered (has 2 files and 3 subfolders) + πŸ“‚C:\Users\Markus\OneDrive entered (has 2 files and 0 folders) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -13,14 +13,14 @@ #> try { - $path = Resolve-Path "~/OneDrive" - if (-not(Test-Path "$path" -pathType container)) { - throw "No OneDrive folder at $path - is OneDrive installed?" + if (-not(Test-Path "~/OneDrive" -pathType container)) { + throw "No 'OneDrive' folder in your home directory - is OneDrive installed?" } + $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) subfolders)" + "πŸ“‚$path entered (has $($files.Count) files and $($folders.Count) folders)" exit 0 # success } catch { "⚠️ Error: $($Error[0])" diff --git a/scripts/cd-sync.ps1 b/scripts/cd-sync.ps1 index 1345ee41..66ef5686 100644 --- a/scripts/cd-sync.ps1 +++ b/scripts/cd-sync.ps1 @@ -5,7 +5,7 @@ This PowerShell script changes the working directory to the user's Syncthing folder. .EXAMPLE PS> ./cd-sync.ps1 - πŸ“‚C:\Users\Markus\Sync entered (has 2 files and 3 subfolders) + πŸ“‚C:\Users\Markus\Sync entered (has 2 files and 0 folders) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -14,13 +14,13 @@ try { if (-not(Test-Path "~/Sync" -pathType container)) { - throw "Your home folder has no Sync folder - is Syncthing installed?" + throw "No 'Sync' folder in your home directory - is Syncthing installed?" } $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) subfolders)" + "πŸ“‚$path entered (has $($files.Count) files and $($folders.Count) folders)" exit 0 # success } catch { "⚠️ Error: $($Error[0])"