mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-02 19:09:13 +01:00
Add open-home-folder.ps1
This commit is contained in:
parent
86f936df08
commit
1f8804fe37
@ -161,6 +161,7 @@ open-calculator.ps1, Starts the calculator program
|
|||||||
open-downloads-folder.ps1, Opens the downloads folder
|
open-downloads-folder.ps1, Opens the downloads folder
|
||||||
open-email-client.ps1, Starts the default email client
|
open-email-client.ps1, Starts the default email client
|
||||||
open-file-explorer.ps1, Starts the Microsoft File Explorer
|
open-file-explorer.ps1, Starts the Microsoft File Explorer
|
||||||
|
open-home-folder.ps1, Opens the home folder
|
||||||
open-netflix.ps1, Starts the Netflix app
|
open-netflix.ps1, Starts the Netflix app
|
||||||
open-onedrive.ps1, Opens the user's OneDrive folder
|
open-onedrive.ps1, Opens the user's OneDrive folder
|
||||||
open-recycle-bin.ps1, Starts the File Explorer with the recycle bin folder
|
open-recycle-bin.ps1, Starts the File Explorer with the recycle bin folder
|
||||||
|
Can't render this file because it has a wrong number of fields in line 91.
|
@ -25,11 +25,11 @@ export-to-serenade.ps1 [[-WakeWord] <String>] [[-FilePattern] <String>] [[-Targe
|
|||||||
Accept wildcard characters? false
|
Accept wildcard characters? false
|
||||||
|
|
||||||
-TargetFile <String>
|
-TargetFile <String>
|
||||||
Specifies the target file ("$HOME/.serenade/scripts/custom.js" by default)
|
Specifies the target file ("$HOME/.serenade/scripts/PowerShell.js" by default)
|
||||||
|
|
||||||
Required? false
|
Required? false
|
||||||
Position? 3
|
Position? 3
|
||||||
Default value "$HOME/.serenade/scripts/custom.js"
|
Default value "$HOME/.serenade/scripts/PowerShell.js"
|
||||||
Accept pipeline input? false
|
Accept pipeline input? false
|
||||||
Accept wildcard characters? false
|
Accept wildcard characters? false
|
||||||
|
|
||||||
@ -41,8 +41,8 @@ export-to-serenade.ps1 [[-WakeWord] <String>] [[-FilePattern] <String>] [[-Targe
|
|||||||
## Example
|
## Example
|
||||||
```powershell
|
```powershell
|
||||||
PS> ./export-to-serenade.ps1 Computer
|
PS> ./export-to-serenade.ps1 Computer
|
||||||
⏳ Exporting 264 scripts to C:\Users\Markus/.serenade/scripts/custom.js...
|
⏳ Exporting 264 PowerShell scripts to C:\Users\Markus/.serenade/scripts/PowerShell.js...
|
||||||
✔️ exported 264 PowerShell scripts to Serenade in 22 sec
|
✔️ exported 264 scripts with wakework "Computer" to Serenade in 22 sec
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
26
Docs/open-downloads-folder.md
Normal file
26
Docs/open-downloads-folder.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
## open-downloads-folder.ps1 - Opens the downloads folder
|
||||||
|
|
||||||
|
This script starts the File Explorer to show the downloads folder.
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
```powershell
|
||||||
|
open-downloads-folder.ps1 [<CommonParameters>]
|
||||||
|
|
||||||
|
[<CommonParameters>]
|
||||||
|
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||||
|
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example
|
||||||
|
```powershell
|
||||||
|
PS> ./open-downloads-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-downloads-folder.ps1*
|
@ -4,7 +4,16 @@ This script starts the File Explorer.
|
|||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
```powershell
|
```powershell
|
||||||
open-file-explorer.ps1 [<CommonParameters>]
|
open-file-explorer.ps1 [[-Path] <String>] [<CommonParameters>]
|
||||||
|
|
||||||
|
-Path <String>
|
||||||
|
Specifies the path to the folder to display
|
||||||
|
|
||||||
|
Required? false
|
||||||
|
Position? 1
|
||||||
|
Default value
|
||||||
|
Accept pipeline input? false
|
||||||
|
Accept wildcard characters? false
|
||||||
|
|
||||||
[<CommonParameters>]
|
[<CommonParameters>]
|
||||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||||
|
26
Docs/open-home-folder.md
Normal file
26
Docs/open-home-folder.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
## open-home-folder.ps1 - Opens the home folder
|
||||||
|
|
||||||
|
This script starts the File Explorer to show the home folder.
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
```powershell
|
||||||
|
open-home-folder.ps1 [<CommonParameters>]
|
||||||
|
|
||||||
|
[<CommonParameters>]
|
||||||
|
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||||
|
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example
|
||||||
|
```powershell
|
||||||
|
PS> ./open-home-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-home-folder.ps1*
|
@ -116,6 +116,7 @@ Mega Collection of PowerShell Scripts
|
|||||||
| [open-downloads-folders.ps1](Scripts/open-downloads-folder.ps1) | Opens the downloads folder | [Help](Docs/open-downloads-folder.md) |
|
| [open-downloads-folders.ps1](Scripts/open-downloads-folder.ps1) | Opens the downloads folder | [Help](Docs/open-downloads-folder.md) |
|
||||||
| [open-email-client.ps1](Scripts/open-browser.ps1) | Starts the default email client | [Help](Docs/open-email-client.md) |
|
| [open-email-client.ps1](Scripts/open-browser.ps1) | Starts the default email client | [Help](Docs/open-email-client.md) |
|
||||||
| [open-file-explorer.ps1](Scripts/open-file-explorer.ps1) | Starts the File Explorer | [Help](Docs/open-file-explorer.md) |
|
| [open-file-explorer.ps1](Scripts/open-file-explorer.ps1) | Starts the File Explorer | [Help](Docs/open-file-explorer.md) |
|
||||||
|
| [open-home-folders.ps1](Scripts/open-home-folder.ps1) | Opens the home folder | [Help](Docs/open-home-folder.md) |
|
||||||
| [open-netflix.ps1](Scripts/open-netflix.ps1) | Starts the Netflix app | [Help](Docs/open-netflix.md) |
|
| [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-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-recycle-bin.ps1](Scripts/open-recycle-bin.ps1) | Starts the File Explorer with the recycle bin folder | [Help](Docs/open-recycle-bin.md) |
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
This script exports the comment based help of all PowerShell scripts as manuals.
|
This script exports the comment based help of all PowerShell scripts as manuals.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./export-to-manuals.ps1
|
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
|
✔️ exported 264 PowerShell scripts in 28 sec
|
||||||
.NOTES
|
.NOTES
|
||||||
Author: Markus Fleschutz · License: CC0
|
Author: Markus Fleschutz · License: CC0
|
||||||
@ -21,7 +21,7 @@ try {
|
|||||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
$Scripts = Get-ChildItem "$FilePattern"
|
$Scripts = Get-ChildItem "$FilePattern"
|
||||||
"⏳ Exporting $($Scripts.Count) PowerShell scripts to $TargetDir..."
|
"⏳ Found $($Scripts.Count) scripts, exporting them to $TargetDir..."
|
||||||
|
|
||||||
foreach ($Script in $Scripts) {
|
foreach ($Script in $Scripts) {
|
||||||
& "$PSScriptRoot/convert-ps2md" "$Script" > "$TargetDir/$($Script.BaseName).md"
|
& "$PSScriptRoot/convert-ps2md" "$Script" > "$TargetDir/$($Script.BaseName).md"
|
||||||
|
24
Scripts/open-home-folder.ps1
Executable file
24
Scripts/open-home-folder.ps1
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Opens the home folder
|
||||||
|
.DESCRIPTION
|
||||||
|
This script starts the File Explorer to show the home folder.
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./open-home-folder
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz · License: CC0
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
$TargetDir = resolve-path "$HOME"
|
||||||
|
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||||
|
throw "Home 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