Add cd-docs.ps1

This commit is contained in:
Markus Fleschutz 2021-04-21 08:14:25 +02:00
parent c556e36e69
commit 01dfa3b83c
3 changed files with 19 additions and 0 deletions

View File

@ -3,6 +3,7 @@ add-firewall-rules.ps1, adds firewall rules to the given executables (needs admi
build-repo.ps1, builds the current/given Git repository
build-repos.ps1, builds all Git repositories under the current/given directory
cd-desktop.ps1, go to the user's desktop folder
cd-docs.ps1, go to the user's documents folder
cd-downloads.ps1, go to the user's downloads folder
cd-dropbox.ps1, go to the user's dropbox folder
cd-home.ps1, go to the user's home folder

1 Script Description
3 build-repo.ps1 builds the current/given Git repository
4 build-repos.ps1 builds all Git repositories under the current/given directory
5 cd-desktop.ps1 go to the user's desktop folder
6 cd-docs.ps1 go to the user's documents folder
7 cd-downloads.ps1 go to the user's downloads folder
8 cd-dropbox.ps1 go to the user's dropbox folder
9 cd-home.ps1 go to the user's home folder

View File

@ -89,6 +89,7 @@ Mega Collection of PowerShell Scripts
📁 PowerShell Scripts for Files & Folders
------------------------------------------
* [cd-desktop.ps1](Scripts/cd-desktop.ps1) - go to the user's desktop folder
* [cd-docs.ps1](Scripts/cd-docs.ps1) - go to the user's documents folder
* [cd-downloads.ps1](Scripts/cd-downloads.ps1) - go to the user's downloads folder
* [cd-dropbox.ps1](Scripts/cd-dropbox.ps1) - go to the user's dropbox folder
* [cd-home.ps1](Scripts/cd-home.ps1) - go to the user's home folder

17
Scripts/cd-docs.ps1 Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/pwsh
<#
.SYNTAX cd-docs.ps1
.DESCRIPTION go to the user's documents folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
$TargetDir = resolve-path "$HOME/Documents"
set-location "$TargetDir"
"📂$TargetDir"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}