2021-09-27 10:38:12 +02:00
|
|
|
|
<#
|
2021-09-12 21:52:29 +02:00
|
|
|
|
.SYNOPSIS
|
2021-10-12 21:51:51 +02:00
|
|
|
|
Sets the working directory to the user's SSH folder
|
2021-10-04 21:29:23 +02:00
|
|
|
|
.DESCRIPTION
|
2021-10-12 21:51:51 +02:00
|
|
|
|
This script changes the working directory to the user's SSH folder.
|
2021-09-12 21:52:29 +02:00
|
|
|
|
.EXAMPLE
|
2021-09-24 17:19:49 +02:00
|
|
|
|
PS> ./cd-ssh
|
2021-10-04 17:42:06 +02:00
|
|
|
|
📂/home/markus/.ssh
|
2021-09-12 21:52:29 +02:00
|
|
|
|
.LINK
|
|
|
|
|
https://github.com/fleschutz/PowerShell
|
|
|
|
|
.NOTES
|
|
|
|
|
Author: Markus Fleschutz · License: CC0
|
|
|
|
|
#>
|
|
|
|
|
|
|
|
|
|
$TargetDir = resolve-path "$HOME/.ssh"
|
|
|
|
|
if (-not(test-path "$TargetDir" -pathType container)) {
|
2021-09-12 22:04:38 +02:00
|
|
|
|
write-warning "Sorry, the user's SSH folder at 📂$TargetDir does not exist (yet)"
|
2021-09-12 21:52:29 +02:00
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
set-location "$TargetDir"
|
|
|
|
|
"📂$TargetDir"
|
2021-09-27 10:09:45 +02:00
|
|
|
|
exit 0 # success
|