mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 00:54:04 +01:00
Improve warning of the cd-* scripts
This commit is contained in:
parent
042f45439d
commit
2f53d5c1d6
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "$HOME/Desktop"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "$HOME/Documents"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "$HOME/Downloads"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "$HOME/Dropbox"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "$HOME"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "$HOME/Music"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "$HOME/OneDrive"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "$HOME/Pictures"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -12,6 +12,10 @@ function Get-CurrentUserSID { [CmdletBinding()] param()
|
||||
|
||||
|
||||
$TargetDir = 'C:\$Recycle.Bin\' + "$(Get-CurrentUserSID)"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "$HOME/Repos"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -11,7 +11,7 @@ if ($IsLinux) {
|
||||
$TargetDir = resolve-path "C:/"
|
||||
}
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "$PSScriptRoot"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path ".."
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "../.."
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "../../.."
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "../../../.."
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
$TargetDir = resolve-path "$HOME/Videos"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, directory 📂$TargetDir is missing"
|
||||
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
|
Loading…
Reference in New Issue
Block a user