File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 11<#
22. SYNOPSIS
3- Sets the working directory to the documents folder
3+ Sets the working dir to the documents folder
44. DESCRIPTION
5- This PowerShell script changes the working directory to the documents folder.
5+ This PowerShell script sets the current working directory to the documents folder.
66. EXAMPLE
7- PS> ./cd-docs
8- 📂C:\Users\Markus\Documents entered (has 3 files and 0 folders)
7+ PS> ./cd-docs.ps1
8+ 📂C:\Users\Markus\Documents with 3 files and 0 folders entered.
99. LINK
1010 https://github.com/fleschutz/PowerShell
1111. NOTES
1515try {
1616 if ($IsLinux -or $IsMacOS ) {
1717 if (-not (Test-Path " ~/Documents" - pathType container)) {
18- throw " No 📂 Documents folder in your home directory yet"
18+ throw " No ' Documents' folder in your home directory yet"
1919 }
2020 $path = Resolve-Path " ~/Documents"
2121 } else {
2222 $path = [Environment ]::GetFolderPath(' MyDocuments' )
2323 if (-not (Test-Path " $path " - pathType container)) {
24- throw " No documents folder at 📂 $path yet"
24+ throw " No documents folder at: $path yet"
2525 }
2626 }
2727 Set-Location " $path "
2828 $files = Get-ChildItem $path - attributes ! Directory
2929 $folders = Get-ChildItem $path - attributes Directory
30- " 📂$path entered (has $ ( $files.Count ) files and $ ( $folders.Count ) folders) "
30+ " 📂$path with $ ( $files.Count ) files and $ ( $folders.Count ) folders entered. "
3131 exit 0 # success
3232} catch {
3333 " ⚠️ Error: $ ( $Error [0 ]) "
Original file line number Diff line number Diff line change 11<#
22. SYNOPSIS
3- Sets the working directory to the SSH folder
3+ Sets the working dir to the SSH folder
44. DESCRIPTION
5- This PowerShell script changes the working directory to the user's secure shell (SSH) folder.
5+ This PowerShell script sets the current working directory to the user's secure shell (SSH) folder.
66. EXAMPLE
77 PS> ./cd-ssh.ps1
8- 📂C:\Users\Markus\.ssh entered (has 4 files)
8+ 📂C:\Users\Markus\.ssh with 4 files entered.
99. LINK
1010 https://github.com/fleschutz/PowerShell
1111. NOTES
1515try {
1616 $path = " ~/.ssh"
1717 if (-not (Test-Path " $path " - pathType container)) {
18- throw " No secure shell (SSH) folder at $path "
18+ throw " No '.ssh' folder in your home directory yet - Is SSH installed? "
1919 }
2020 $path = Resolve-Path " $path "
2121 Set-Location " $path "
2222 $files = Get-ChildItem $path - attributes ! Directory
23- " 📂$path entered (has $ ( $files.Count ) files) "
23+ " 📂$path with $ ( $files.Count ) files entered. "
2424 exit 0 # success
2525} catch {
2626 " ⚠️ Error: $ ( $Error [0 ]) "
You can’t perform that action at this time.
0 commit comments