Update the cd-*.ps1 scripts

This commit is contained in:
Markus Fleschutz
2022-05-04 11:50:18 +02:00
parent 1803b09fad
commit 45cd3e0876
22 changed files with 83 additions and 78 deletions

View File

@ -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 {