diff --git a/Scripts/cd-autostart.ps1 b/Scripts/cd-autostart.ps1 index c8e89de7..80fb2cac 100755 --- a/Scripts/cd-autostart.ps1 +++ b/Scripts/cd-autostart.ps1 @@ -5,19 +5,19 @@ This PowerShell script changes the working directory to the user's autostart folder. .EXAMPLE PS> ./cd-autostart - 📂C:\Users\Joe\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup + 📂C:\Users\Markus\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { - $Path = resolve-path "$HOME/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup" - if (-not(test-path "$Path" -pathType container)) { + $Path = Resolve-Path "$HOME/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup" + if (-not(Test-Path "$Path" -pathType container)) { throw "Autostart folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-desktop.ps1 b/Scripts/cd-desktop.ps1 index 6ed72ad3..1d691357 100755 --- a/Scripts/cd-desktop.ps1 +++ b/Scripts/cd-desktop.ps1 @@ -5,23 +5,23 @@ This PowerShell script changes the working directory to the user's desktop folder. .EXAMPLE PS> ./cd-desktop - 📂/home/Joe/Desktop + 📂/home/Markus/Desktop .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { if ($IsLinux) { - $Path = resolve-path "$HOME/Desktop" + $Path = Resolve-Path "$HOME/Desktop" } else { $Path = [Environment]::GetFolderPath('DesktopDirectory') } if (-not(Test-Path "$Path" -pathType container)) { throw "Desktop folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-docs.ps1 b/Scripts/cd-docs.ps1 index 7d64929f..d4182982 100755 --- a/Scripts/cd-docs.ps1 +++ b/Scripts/cd-docs.ps1 @@ -5,11 +5,11 @@ This PowerShell script changes the working directory to the documents folder. .EXAMPLE PS> ./cd-docs - 📂C:\Users\Joe\Documents + 📂C:\Users\Markus\Documents .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { @@ -21,7 +21,7 @@ try { if (-not(Test-Path "$Path" -pathType container)) { throw "Documents folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-downloads.ps1 b/Scripts/cd-downloads.ps1 index b84a48ae..ff97e702 100755 --- a/Scripts/cd-downloads.ps1 +++ b/Scripts/cd-downloads.ps1 @@ -5,11 +5,11 @@ This PowerShell script changes the working directory to the user's downloads folder. .EXAMPLE PS> ./cd-downloads - 📂C:\Users\Joe\Downloads + 📂C:\Users\Markus\Downloads .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { diff --git a/Scripts/cd-dropbox.ps1 b/Scripts/cd-dropbox.ps1 index 827d1ff7..0aa2c425 100755 --- a/Scripts/cd-dropbox.ps1 +++ b/Scripts/cd-dropbox.ps1 @@ -5,11 +5,11 @@ This PowerShell script changes the working directory to the user's Dropbox folder. .EXAMPLE PS> ./cd-dropbox - 📂/home/Joe/Dropbox + 📂/home/Markus/Dropbox .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { diff --git a/Scripts/cd-fonts.ps1 b/Scripts/cd-fonts.ps1 index b5fa432f..aed5c677 100755 --- a/Scripts/cd-fonts.ps1 +++ b/Scripts/cd-fonts.ps1 @@ -9,7 +9,7 @@ .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { @@ -17,7 +17,7 @@ try { if (-not(Test-Path "$Path" -pathType container)) { throw "Fonts folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-home.ps1 b/Scripts/cd-home.ps1 index f623d828..f41c1bd6 100755 --- a/Scripts/cd-home.ps1 +++ b/Scripts/cd-home.ps1 @@ -5,19 +5,19 @@ This PowerShell script changes the working directory to the user's home directory. .EXAMPLE PS> ./cd-home - 📂/home/Joe + 📂/home/Markus .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { - $Path = resolve-path "$HOME" - if (-not(test-path "$Path" -pathType container)) { + $Path = Resolve-Path "$HOME" + if (-not(Test-Path "$Path" -pathType container)) { throw "Home directory at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-music.ps1 b/Scripts/cd-music.ps1 index ab0e2b60..64e44a27 100755 --- a/Scripts/cd-music.ps1 +++ b/Scripts/cd-music.ps1 @@ -5,11 +5,11 @@ This PowerShell script changes the working directory to the user's music folder. .EXAMPLE PS> ./cd-music - 📂/home/Joe/Music + 📂/home/Markus/Music .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { @@ -21,7 +21,7 @@ try { if (-not(Test-Path "$Path" -pathType container)) { throw "Music folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-onedrive.ps1 b/Scripts/cd-onedrive.ps1 index d8615ec8..c89beba3 100644 --- a/Scripts/cd-onedrive.ps1 +++ b/Scripts/cd-onedrive.ps1 @@ -5,19 +5,19 @@ This PowerShell script changes the working directory to the user's OneDrive folder. .EXAMPLE PS> ./cd-onedrive - 📂/home/Joe/OneDrive + 📂/home/Markus/OneDrive .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { - $Path = resolve-path "$HOME/OneDrive" - if (-not(test-path "$Path" -pathType container)) { + $Path = Resolve-Path "$HOME/OneDrive" + if (-not(Test-Path "$Path" -pathType container)) { throw "OneDrive folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-pics.ps1 b/Scripts/cd-pics.ps1 index a5ff7286..32ecb9f9 100755 --- a/Scripts/cd-pics.ps1 +++ b/Scripts/cd-pics.ps1 @@ -5,11 +5,11 @@ This PowerShell script changes the working directory to the user's pictures folder. .EXAMPLE PS> ./cd-pics - 📂/home/Joe/Pictures + 📂/home/Markus/Pictures .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { diff --git a/Scripts/cd-recycle-bin.ps1 b/Scripts/cd-recycle-bin.ps1 index ca81edf4..52df86a0 100644 --- a/Scripts/cd-recycle-bin.ps1 +++ b/Scripts/cd-recycle-bin.ps1 @@ -9,7 +9,7 @@ .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> function GetCurrentUserSID { [CmdletBinding()] param() @@ -20,10 +20,10 @@ function GetCurrentUserSID { [CmdletBinding()] param() try { $Path = 'C:\$Recycle.Bin\' + "$(GetCurrentUserSID)" - if (-not(test-path "$Path" -pathType container)) { + if (-not(Test-Path "$Path" -pathType container)) { throw "Recycle bin folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-repos.ps1 b/Scripts/cd-repos.ps1 index d1175541..db03b149 100644 --- a/Scripts/cd-repos.ps1 +++ b/Scripts/cd-repos.ps1 @@ -5,19 +5,19 @@ This PowerShell script changes the working directory to the user's Git repositories folder. .EXAMPLE PS> ./cd-repos - 📂/home/Joe/Repos + 📂/home/Markus/Repos .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { - $Path = resolve-path "$HOME/Repos" - if (-not(test-path "$Path" -pathType container)) { + $Path = Resolve-Path "$HOME/Repos" + if (-not(Test-Path "$Path" -pathType container)) { throw "Git repositories folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-root.ps1 b/Scripts/cd-root.ps1 index 3fd74204..e473b7ec 100755 --- a/Scripts/cd-root.ps1 +++ b/Scripts/cd-root.ps1 @@ -5,15 +5,16 @@ This PowerShell script changes the current working directory to the root directory (C:\ on Windows). .EXAMPLE PS> ./cd-root + 📂C:\ .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { if ($IsLinux) { $Path = "/" } else { $Path = "C:\" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-scripts.ps1 b/Scripts/cd-scripts.ps1 index 8cf45abf..686ba0b6 100755 --- a/Scripts/cd-scripts.ps1 +++ b/Scripts/cd-scripts.ps1 @@ -5,19 +5,19 @@ This PowerShell script changes the working directory to the PowerShell scripts folder. .EXAMPLE PS> ./cd-scripts - 📂/home/Joe/PowerShell/Scripts + 📂/home/Markus/PowerShell/Scripts .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { - $Path = resolve-path "$PSScriptRoot" - if (-not(test-path "$Path" -pathType container)) { + $Path = Resolve-Path "$PSScriptRoot" + if (-not(Test-Path "$Path" -pathType container)) { throw "PowerShell scripts folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-ssh.ps1 b/Scripts/cd-ssh.ps1 index 3f2e80df..10a5049d 100755 --- a/Scripts/cd-ssh.ps1 +++ b/Scripts/cd-ssh.ps1 @@ -5,19 +5,19 @@ This PowerShell script changes the working directory to the user's SSH folder. .EXAMPLE PS> ./cd-ssh - 📂/home/Joe/.ssh + 📂/home/Markus/.ssh .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { - $Path = resolve-path "$HOME/.ssh" - if (-not(test-path "$Path" -pathType container)) { + $Path = Resolve-Path "$HOME/.ssh" + if (-not(Test-Path "$Path" -pathType container)) { throw "SSH folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-temp.ps1 b/Scripts/cd-temp.ps1 index 4add863e..f1a5018f 100644 --- a/Scripts/cd-temp.ps1 +++ b/Scripts/cd-temp.ps1 @@ -5,11 +5,11 @@ This PowerShell script changes the working directory to the temporary folder. .EXAMPLE PS> ./cd-temp - 📂C:\Users\Joe\AppData\Local\Temp + 📂C:\Users\Markus\AppData\Local\Temp .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> function GetTempDir { diff --git a/Scripts/cd-up.ps1 b/Scripts/cd-up.ps1 index 7080069d..d54f2738 100755 --- a/Scripts/cd-up.ps1 +++ b/Scripts/cd-up.ps1 @@ -5,18 +5,19 @@ This PowerShell script changes the working directory to one directory level up. .EXAMPLE PS> .\cd-up + 📂C:\Users .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { - $Path = resolve-path ".." - if (-not(test-path "$Path" -pathType container)) { + $Path = Resolve-Path ".." + if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-up2.ps1 b/Scripts/cd-up2.ps1 index 649e18d6..764ba03d 100644 --- a/Scripts/cd-up2.ps1 +++ b/Scripts/cd-up2.ps1 @@ -5,18 +5,19 @@ This PowerShell script changes the working directory to two directory level up. .EXAMPLE PS> ./cd-up2 + 📂C:\ .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { - $Path = resolve-path "../.." - if (-not(test-path "$Path" -pathType container)) { + $Path = Resolve-Path "../.." + if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-up3.ps1 b/Scripts/cd-up3.ps1 index 04d1468d..4d0df07a 100644 --- a/Scripts/cd-up3.ps1 +++ b/Scripts/cd-up3.ps1 @@ -5,18 +5,19 @@ This PowerShell script changes the working directory to three directory levels up. .EXAMPLE PS> ./cd-up3 + 📂C:\ .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { - $Path = resolve-path "../../.." - if (-not(test-path "$Path" -pathType container)) { + $Path = Resolve-Path "../../.." + if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-up4.ps1 b/Scripts/cd-up4.ps1 index 21fd85e1..d3c47ece 100644 --- a/Scripts/cd-up4.ps1 +++ b/Scripts/cd-up4.ps1 @@ -5,18 +5,19 @@ This PowerShell script changes the working directory to four directory levels up. .EXAMPLE PS> ./cd-up4 + 📂C:\ .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { - $Path = resolve-path "../../../.." - if (-not(test-path "$Path" -pathType container)) { + $Path = Resolve-Path "../../../.." + if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-videos.ps1 b/Scripts/cd-videos.ps1 index 87f80d71..a3ea3f64 100755 --- a/Scripts/cd-videos.ps1 +++ b/Scripts/cd-videos.ps1 @@ -5,11 +5,11 @@ This PowerShell script changes the working directory to the user's videos folder. .EXAMPLE PS> ./cd-videos - 📂/home/Joe/Videos + 📂C:\Users\Markus\Videos .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { @@ -21,7 +21,7 @@ try { if (-not(Test-Path "$Path" -pathType container)) { throw "Videos folder at 📂$Path doesn't exist (yet)" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch { diff --git a/Scripts/cd-windows.ps1 b/Scripts/cd-windows.ps1 index 6f9ebf17..d8c3b786 100644 --- a/Scripts/cd-windows.ps1 +++ b/Scripts/cd-windows.ps1 @@ -9,15 +9,15 @@ .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> try { - $Path = resolve-path "$env:WINDIR" - if (-not(test-path "$Path" -pathType container)) { + $Path = Resolve-Path "$env:WINDIR" + if (-not(Test-Path "$Path" -pathType container)) { throw "Windows directory at 📂$Path doesn't exist" } - set-location "$Path" + Set-Location "$Path" "📂$Path" exit 0 # success } catch {