mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-12 06:02:56 +02:00
Improved some cd-*.ps1 scripts
This commit is contained in:
@ -13,13 +13,16 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
if ($IsLinux -or $IsMacOS) {
|
||||
if (-not(Test-Path "~/Desktop" -pathType container)) {
|
||||
throw "No 📂Desktop folder in your home directory yet"
|
||||
}
|
||||
$path = Resolve-Path "~/Desktop"
|
||||
} else {
|
||||
$path = [Environment]::GetFolderPath('DesktopDirectory')
|
||||
}
|
||||
if (-not(Test-Path "$path" -pathType container)) {
|
||||
throw "No desktop folder at 📂$path"
|
||||
if (-not(Test-Path "$path" -pathType container)) {
|
||||
throw "No desktop folder at 📂$path yet"
|
||||
}
|
||||
}
|
||||
Set-Location "$path"
|
||||
"📂$path"
|
||||
|
Reference in New Issue
Block a user