mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-09 01:38:26 +02:00
Add open-repos-folder.ps1
This commit is contained in:
parent
9492c2cbda
commit
87bab35a81
@ -165,6 +165,7 @@ open-home-folder.ps1, Opens the home folder
|
||||
open-netflix.ps1, Starts the Netflix app
|
||||
open-onedrive.ps1, Opens the user's OneDrive folder
|
||||
open-recycle-bin.ps1, Starts the File Explorer with the recycle bin folder
|
||||
open-repos-folder.ps1, Opens the Git repositories folder
|
||||
open-task-manager.ps1, Starts the Task Manager
|
||||
pick-commit.ps1, Cherry-picks a Git commit into multiple branches
|
||||
play-beep.ps1, Plays a beep sound
|
||||
|
Can't render this file because it has a wrong number of fields in line 91.
|
@ -30,7 +30,7 @@ export-to-manuals.ps1 [[-FilePattern] <String>] [[-TargetDir] <String>] [<Common
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./export-to-manuals.ps1
|
||||
Exporting 264 PowerShell scripts to /home/markus/PowerShell/Docs...
|
||||
Found 264 scripts, exporting them to /home/markus/PowerShell/Docs...
|
||||
✔️ exported 264 PowerShell scripts in 28 sec
|
||||
|
||||
```
|
||||
|
26
Docs/open-repos-folder.md
Normal file
26
Docs/open-repos-folder.md
Normal file
@ -0,0 +1,26 @@
|
||||
## open-repos-folder.ps1 - Opens the Git repositories folder
|
||||
|
||||
This script starts the File Explorer to show the repositories folder.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
open-repos-folder.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./open-repos-folder
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of open-repos-folder.ps1*
|
@ -120,6 +120,7 @@ Mega Collection of PowerShell Scripts
|
||||
| [open-netflix.ps1](Scripts/open-netflix.ps1) | Starts the Netflix app | [Help](Docs/open-netflix.md) |
|
||||
| [open-onedrive.ps1](Scripts/open-onedrive.ps1) | Opens the user's OneDrive folder | [Help](Docs/open-onedrive.md) |
|
||||
| [open-recycle-bin.ps1](Scripts/open-recycle-bin.ps1) | Starts the File Explorer with the recycle bin folder | [Help](Docs/open-recycle-bin.md) |
|
||||
| [open-repos-folders.ps1](Scripts/open-repos-folder.ps1) | Opens the Git repositories folder | [Help](Docs/open-repos-folder.md) |
|
||||
| [open-task-manager.ps1](Scripts/open-task-manager.ps1)| Starts the Task Manager | [Help](Docs/open-task-manager.md) |
|
||||
| [remind-me.ps1](Scripts/remind-me.ps1) | Creates a scheduled task that will display a popup message | [Help](Docs/remind-me.md) |
|
||||
| [save-screenshot.ps1](Scripts/save-screenshot.ps1) | Saves a single screenshot | [Help](Docs/save-screenshot.md) |
|
||||
|
24
Scripts/open-repos-folder.ps1
Executable file
24
Scripts/open-repos-folder.ps1
Executable file
@ -0,0 +1,24 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Opens the Git repositories folder
|
||||
.DESCRIPTION
|
||||
This script starts the File Explorer to show the repositories folder.
|
||||
.EXAMPLE
|
||||
PS> ./open-repos-folder
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
try {
|
||||
$TargetDir = resolve-path "$HOME/Repos"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
throw "Repos folder at 📂$TargetDir doesn't exist (yet)"
|
||||
}
|
||||
& "$PSScriptRoot/open-file-explorer.ps1" "$TargetDir"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user