From e4aef680b8972c8b35428c29b5ec0e45c0ecf202 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 3 Nov 2021 16:46:35 +0100 Subject: [PATCH] Add several scripts --- Scripts/open-c-drive.ps1 | 11 +++-------- Scripts/open-d-drive.ps1 | 14 ++++++++++++++ Scripts/open-f-drive.ps1 | 15 +++++++++++++++ Scripts/open-m-drive.ps1 | 15 +++++++++++++++ 4 files changed, 47 insertions(+), 8 deletions(-) create mode 100755 Scripts/open-d-drive.ps1 create mode 100755 Scripts/open-f-drive.ps1 create mode 100755 Scripts/open-m-drive.ps1 diff --git a/Scripts/open-c-drive.ps1 b/Scripts/open-c-drive.ps1 index 05692172..029bbf85 100755 --- a/Scripts/open-c-drive.ps1 +++ b/Scripts/open-c-drive.ps1 @@ -2,7 +2,7 @@ .SYNOPSIS Opens the C: drive folder .DESCRIPTION - This script launches the File Explorer showing the C: drive folder. + This script launches the File Explorer with the C: drive folder. .EXAMPLE PS> ./open-c-drive .NOTES @@ -11,10 +11,5 @@ https://github.com/fleschutz/PowerShell #> -try { - & "$PSScriptRoot/open-file-explorer.ps1" C: - exit 0 # success -} catch { - "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" - exit 1 -} +& "$PSScriptRoot/open-file-explorer.ps1" "C:" +exit 0 # success diff --git a/Scripts/open-d-drive.ps1 b/Scripts/open-d-drive.ps1 new file mode 100755 index 00000000..3ca2b4a4 --- /dev/null +++ b/Scripts/open-d-drive.ps1 @@ -0,0 +1,14 @@ +<# +.SYNOPSIS + Opens the D: drive folder +.DESCRIPTION + This script launches the File Explorer with the D: drive folder. +.EXAMPLE + PS> ./open-d-drive +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +& "$PSScriptRoot/open-file-explorer.ps1" "D:" diff --git a/Scripts/open-f-drive.ps1 b/Scripts/open-f-drive.ps1 new file mode 100755 index 00000000..c412f633 --- /dev/null +++ b/Scripts/open-f-drive.ps1 @@ -0,0 +1,15 @@ +<# +.SYNOPSIS + Opens the F: drive folder +.DESCRIPTION + This script launches the File Explorer with the F: drive folder. +.EXAMPLE + PS> ./open-f-drive +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +& "$PSScriptRoot/open-file-explorer.ps1" "F:" +exit 0 # success diff --git a/Scripts/open-m-drive.ps1 b/Scripts/open-m-drive.ps1 new file mode 100755 index 00000000..a11e68af --- /dev/null +++ b/Scripts/open-m-drive.ps1 @@ -0,0 +1,15 @@ +<# +.SYNOPSIS + Opens the M: drive folder +.DESCRIPTION + This script launches the File Explorer with the M: drive folder. +.EXAMPLE + PS> ./open-m-drive +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +& "$PSScriptRoot/open-file-explorer.ps1" "M:" +exit 0 # success