From 6fa5a3557bc353955c9d76e93ae121b00aec9759 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 9 Jul 2025 15:09:20 +0200 Subject: [PATCH] Updated the open-*.ps1 scripts --- scripts/open-URL.ps1 | 2 ++ scripts/open-apps-folder.ps1 | 2 ++ scripts/open-auto-start-folder.ps1 | 2 ++ scripts/open-bing-maps.ps1 | 2 ++ scripts/open-booking-com.ps1 | 2 ++ scripts/open-c-drive.ps1 | 2 ++ scripts/open-calculator.ps1 | 2 ++ scripts/open-chrome.ps1 | 2 ++ scripts/open-clock.ps1 | 2 ++ scripts/open-cortana.ps1 | 2 ++ scripts/open-d-drive.ps1 | 2 ++ scripts/open-dashboards.ps1 | 2 ++ scripts/open-deep-l-translator.ps1 | 4 +++- scripts/open-default-browser.ps1 | 2 ++ scripts/open-desktop-folder.ps1 | 4 +++- scripts/open-documents-folder.ps1 | 4 +++- scripts/open-downloads-folder.ps1 | 2 ++ scripts/open-dropbox-folder.ps1 | 2 ++ scripts/open-duck-duck-go.ps1 | 2 ++ scripts/open-e-drive.ps1 | 2 ++ scripts/open-edge.ps1 | 4 +++- scripts/open-egg-timer.ps1 | 2 ++ scripts/open-email-client.ps1 | 2 ++ scripts/open-f-drive.ps1 | 4 +++- scripts/open-file-explorer.ps1 | 2 ++ scripts/open-fire-place.ps1 | 2 ++ scripts/open-firefox.ps1 | 4 +++- scripts/open-flight-radar.ps1 | 4 +++- scripts/open-g-drive.ps1 | 2 ++ scripts/open-git-extensions.ps1 | 2 ++ scripts/open-google-books.ps1 | 4 +++- scripts/open-google-calendar.ps1 | 4 +++- scripts/open-google-contacts.ps1 | 2 ++ scripts/open-google-docs.ps1 | 4 +++- scripts/open-google-earth.ps1 | 4 +++- scripts/open-google-mail.ps1 | 4 +++- scripts/open-google-maps.ps1 | 4 +++- scripts/open-google-news.ps1 | 4 +++- scripts/open-google-photos.ps1 | 4 +++- scripts/open-google-play.ps1 | 4 +++- scripts/open-google-search.ps1 | 4 +++- scripts/open-google-stadia.ps1 | 4 +++- scripts/open-google-translate.ps1 | 4 +++- scripts/open-home-folder.ps1 | 4 +++- scripts/open-internet-archive.ps1 | 4 +++- scripts/open-jitsi-meet.ps1 | 4 +++- scripts/open-m-drive.ps1 | 4 +++- scripts/open-magnifier.ps1 | 6 ++++-- scripts/open-microsoft-paint.ps1 | 4 +++- scripts/open-microsoft-solitaire.ps1 | 4 +++- scripts/open-microsoft-store.ps1 | 4 +++- scripts/open-microsoft-teams.ps1 | 4 +++- scripts/open-music-folder.ps1 | 6 ++++-- scripts/open-netflix.ps1 | 4 +++- scripts/open-notepad.ps1 | 2 ++ scripts/open-obs-studio.ps1 | 4 +++- scripts/open-office-365.ps1 | 4 +++- scripts/open-one-drive-folder.ps1 | 4 +++- scripts/open-outlook.ps1 | 4 +++- scripts/open-paint-three-d.ps1 | 6 ++++-- scripts/open-pictures-folder.ps1 | 6 ++++-- scripts/open-rdp.ps1 | 8 +++++--- scripts/open-recycle-bin-folder.ps1 | 4 +++- scripts/open-remote-desktop.ps1 | 6 ++++-- scripts/open-repos-folder.ps1 | 4 +++- scripts/open-screen-clip.ps1 | 4 +++- scripts/open-screen-sketch.ps1 | 4 +++- scripts/open-skype.ps1 | 4 +++- scripts/open-snipping-tool.ps1 | 4 +++- scripts/open-speed-test.ps1 | 4 +++- scripts/open-spotify.ps1 | 4 +++- scripts/open-stack-overflow.ps1 | 4 +++- scripts/open-start-page.ps1 | 4 +++- scripts/open-street-map.ps1 | 4 +++- scripts/open-task-manager.ps1 | 4 +++- scripts/open-temporary-folder.ps1 | 4 +++- scripts/open-three-d-viewer.ps1 | 4 +++- scripts/open-thunderbird.ps1 | 4 +++- scripts/open-videos-folders.ps1 | 4 +++- scripts/open-visual-studio.ps1 | 2 ++ scripts/open-voice-recorder.ps1 | 4 +++- scripts/open-vpn-settings.ps1 | 4 +++- scripts/open-windows-defender.ps1 | 4 +++- scripts/open-windows-terminal.ps1 | 4 +++- scripts/open-xing.ps1 | 2 +- 85 files changed, 234 insertions(+), 66 deletions(-) diff --git a/scripts/open-URL.ps1 b/scripts/open-URL.ps1 index 34c14f44..7d73735b 100755 --- a/scripts/open-URL.ps1 +++ b/scripts/open-URL.ps1 @@ -15,6 +15,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + param([string]$URL = "", [string]$text = "") try { diff --git a/scripts/open-apps-folder.ps1 b/scripts/open-apps-folder.ps1 index aba5398c..3173e435 100755 --- a/scripts/open-apps-folder.ps1 +++ b/scripts/open-apps-folder.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-file-explorer.ps1" "shell:AppsFolder" exit 0 # success diff --git a/scripts/open-auto-start-folder.ps1 b/scripts/open-auto-start-folder.ps1 index 6596e54a..e1686160 100755 --- a/scripts/open-auto-start-folder.ps1 +++ b/scripts/open-auto-start-folder.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { $TargetDir = resolve-path "$HOME/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup" if (-not(test-path "$TargetDir" -pathType container)) { diff --git a/scripts/open-bing-maps.ps1 b/scripts/open-bing-maps.ps1 index 857cd109..67044e21 100755 --- a/scripts/open-bing-maps.ps1 +++ b/scripts/open-bing-maps.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { start-process bingmaps: exit 0 # success diff --git a/scripts/open-booking-com.ps1 b/scripts/open-booking-com.ps1 index 5794b975..daac1767 100755 --- a/scripts/open-booking-com.ps1 +++ b/scripts/open-booking-com.ps1 @@ -11,5 +11,7 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://www.booking.com" exit 0 # success diff --git a/scripts/open-c-drive.ps1 b/scripts/open-c-drive.ps1 index 00400f49..fb40311e 100755 --- a/scripts/open-c-drive.ps1 +++ b/scripts/open-c-drive.ps1 @@ -11,5 +11,7 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-file-explorer.ps1" "C:" exit 0 # success diff --git a/scripts/open-calculator.ps1 b/scripts/open-calculator.ps1 index b367cf9d..79670b25 100755 --- a/scripts/open-calculator.ps1 +++ b/scripts/open-calculator.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { Start-Process ms-calculator: exit 0 # success diff --git a/scripts/open-chrome.ps1 b/scripts/open-chrome.ps1 index 51ec9e8c..6fb3dc71 100755 --- a/scripts/open-chrome.ps1 +++ b/scripts/open-chrome.ps1 @@ -13,6 +13,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + param([string]$URL = "http://www.fleschutz.de") try { diff --git a/scripts/open-clock.ps1 b/scripts/open-clock.ps1 index b482ebb1..f74af2f1 100755 --- a/scripts/open-clock.ps1 +++ b/scripts/open-clock.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { Start-Process ms-clock: exit 0 # success diff --git a/scripts/open-cortana.ps1 b/scripts/open-cortana.ps1 index 6dd89c91..c1557bca 100755 --- a/scripts/open-cortana.ps1 +++ b/scripts/open-cortana.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { Start-Process ms-cortana2: exit 0 # success diff --git a/scripts/open-d-drive.ps1 b/scripts/open-d-drive.ps1 index 94ed50f7..a6c06c99 100755 --- a/scripts/open-d-drive.ps1 +++ b/scripts/open-d-drive.ps1 @@ -11,4 +11,6 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-file-explorer.ps1" "D:" diff --git a/scripts/open-dashboards.ps1 b/scripts/open-dashboards.ps1 index 504536e0..1b6a145a 100755 --- a/scripts/open-dashboards.ps1 +++ b/scripts/open-dashboards.ps1 @@ -15,6 +15,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + param([int]$timeInterval = 120) # milliseconds try { diff --git a/scripts/open-deep-l-translator.ps1 b/scripts/open-deep-l-translator.ps1 index c4350207..7abfd88f 100755 --- a/scripts/open-deep-l-translator.ps1 +++ b/scripts/open-deep-l-translator.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the DeepL Translator website. .EXAMPLE - PS> ./open-deep-l-translator + PS> ./open-deep-l-translator.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://www.deepl.com/translator" exit 0 # success diff --git a/scripts/open-default-browser.ps1 b/scripts/open-default-browser.ps1 index 7c8fb391..aab1df3f 100755 --- a/scripts/open-default-browser.ps1 +++ b/scripts/open-default-browser.ps1 @@ -13,6 +13,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + param([string]$URL = "https://www.fleschutz.de") try { diff --git a/scripts/open-desktop-folder.ps1 b/scripts/open-desktop-folder.ps1 index 72def0c0..11021c5c 100755 --- a/scripts/open-desktop-folder.ps1 +++ b/scripts/open-desktop-folder.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This PowerShell script launches the File Explorer with the user's desktop folder. .EXAMPLE - PS> ./open-desktop-folder + PS> ./open-desktop-folder.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { $TargetDir = resolve-path "$HOME/Desktop" if (-not(test-path "$TargetDir" -pathType container)) { diff --git a/scripts/open-documents-folder.ps1 b/scripts/open-documents-folder.ps1 index c7766271..e607542a 100755 --- a/scripts/open-documents-folder.ps1 +++ b/scripts/open-documents-folder.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This PowerShell script launches the File Explorer with the user's documents folder. .EXAMPLE - PS> ./open-documents-folder + PS> ./open-documents-folder.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { $TargetDir = resolve-path "$HOME/Documents" if (-not(test-path "$TargetDir" -pathType container)) { diff --git a/scripts/open-downloads-folder.ps1 b/scripts/open-downloads-folder.ps1 index 0147c0bc..1b4f134e 100755 --- a/scripts/open-downloads-folder.ps1 +++ b/scripts/open-downloads-folder.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { if ($IsLinux) { $Path = Resolve-Path "$HOME/Downloads" diff --git a/scripts/open-dropbox-folder.ps1 b/scripts/open-dropbox-folder.ps1 index 9575a761..98451477 100755 --- a/scripts/open-dropbox-folder.ps1 +++ b/scripts/open-dropbox-folder.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { $TargetDirs = resolve-path "$HOME/Dropbox*" foreach($TargetDir in $TargetDirs) { diff --git a/scripts/open-duck-duck-go.ps1 b/scripts/open-duck-duck-go.ps1 index aeebe7a7..f9cf4ef6 100755 --- a/scripts/open-duck-duck-go.ps1 +++ b/scripts/open-duck-duck-go.ps1 @@ -11,5 +11,7 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://duckduckgo.com" exit 0 # success diff --git a/scripts/open-e-drive.ps1 b/scripts/open-e-drive.ps1 index f06d7fb4..a4f54830 100755 --- a/scripts/open-e-drive.ps1 +++ b/scripts/open-e-drive.ps1 @@ -11,4 +11,6 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-file-explorer.ps1" "E:" diff --git a/scripts/open-edge.ps1 b/scripts/open-edge.ps1 index d1184834..e68b8426 100755 --- a/scripts/open-edge.ps1 +++ b/scripts/open-edge.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Microsoft Edge Web browser. .EXAMPLE - PS> ./open-edge + PS> ./open-edge.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + Start-Process microsoft-edge:// exit 0 # success diff --git a/scripts/open-egg-timer.ps1 b/scripts/open-egg-timer.ps1 index f0cb0f58..9d40dc12 100755 --- a/scripts/open-egg-timer.ps1 +++ b/scripts/open-egg-timer.ps1 @@ -11,5 +11,7 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://e.ggtimer.com" exit 0 # success diff --git a/scripts/open-email-client.ps1 b/scripts/open-email-client.ps1 index 68fe221e..0c6d8d8a 100755 --- a/scripts/open-email-client.ps1 +++ b/scripts/open-email-client.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { start-process "mailto:markus@fleschutz.de" exit 0 # success diff --git a/scripts/open-f-drive.ps1 b/scripts/open-f-drive.ps1 index a14404ca..92dc420b 100755 --- a/scripts/open-f-drive.ps1 +++ b/scripts/open-f-drive.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the File Explorer with the F: drive folder. .EXAMPLE - PS> ./open-f-drive + PS> ./open-f-drive.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-file-explorer.ps1" "F:" exit 0 # success diff --git a/scripts/open-file-explorer.ps1 b/scripts/open-file-explorer.ps1 index e5925028..fbadf477 100755 --- a/scripts/open-file-explorer.ps1 +++ b/scripts/open-file-explorer.ps1 @@ -13,6 +13,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + param([string]$Path = "") try { diff --git a/scripts/open-fire-place.ps1 b/scripts/open-fire-place.ps1 index e944079b..0f0396f2 100755 --- a/scripts/open-fire-place.ps1 +++ b/scripts/open-fire-place.ps1 @@ -11,5 +11,7 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://freefireplaces.com" exit 0 # success diff --git a/scripts/open-firefox.ps1 b/scripts/open-firefox.ps1 index 6c9708dc..3e95eb1c 100755 --- a/scripts/open-firefox.ps1 +++ b/scripts/open-firefox.ps1 @@ -13,7 +13,9 @@ Author: Markus Fleschutz | License: CC0 #> -param([string]$URL = "http://www.fleschutz.de") +#requires -version 5.1 + +param([string]$URL = "https://www.fleschutz.de") try { $App = Get-AppxPackage -Name Mozilla.FireFox diff --git a/scripts/open-flight-radar.ps1 b/scripts/open-flight-radar.ps1 index 31557d5b..5b97687f 100755 --- a/scripts/open-flight-radar.ps1 +++ b/scripts/open-flight-radar.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the FlightRadar24 website. .EXAMPLE - PS> ./open-flight-radar + PS> ./open-flight-radar.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://www.flightradar24.com" exit 0 # success diff --git a/scripts/open-g-drive.ps1 b/scripts/open-g-drive.ps1 index 279dff50..3887d516 100755 --- a/scripts/open-g-drive.ps1 +++ b/scripts/open-g-drive.ps1 @@ -11,5 +11,7 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-file-explorer.ps1" "G:" exit 0 # success diff --git a/scripts/open-git-extensions.ps1 b/scripts/open-git-extensions.ps1 index 25804151..d3abccc8 100755 --- a/scripts/open-git-extensions.ps1 +++ b/scripts/open-git-extensions.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + function TryToExec { param($Folder, $Binary) if (test-path "$Folder/$Binary" -pathType leaf) { start-process "$Folder/$Binary" -WorkingDirectory "$Folder" diff --git a/scripts/open-google-books.ps1 b/scripts/open-google-books.ps1 index 20ebf0f7..9868eca1 100755 --- a/scripts/open-google-books.ps1 +++ b/scripts/open-google-books.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google Books website. .EXAMPLE - PS> ./open-google-books + PS> ./open-google-books.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://books.google.com" exit 0 # success diff --git a/scripts/open-google-calendar.ps1 b/scripts/open-google-calendar.ps1 index bfc09fca..b3b7d34e 100755 --- a/scripts/open-google-calendar.ps1 +++ b/scripts/open-google-calendar.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google Calendar website. .EXAMPLE - PS> ./open-google-calendar + PS> ./open-google-calendar.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://calendar.google.com" exit 0 # success diff --git a/scripts/open-google-contacts.ps1 b/scripts/open-google-contacts.ps1 index e301b508..4c0c90f7 100755 --- a/scripts/open-google-contacts.ps1 +++ b/scripts/open-google-contacts.ps1 @@ -11,5 +11,7 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://contacts.google.com" exit 0 # success diff --git a/scripts/open-google-docs.ps1 b/scripts/open-google-docs.ps1 index c1217117..b9a6cf9c 100755 --- a/scripts/open-google-docs.ps1 +++ b/scripts/open-google-docs.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google Docs website. .EXAMPLE - PS> ./open-google-docs + PS> ./open-google-docs.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://docs.google.com" exit 0 # success diff --git a/scripts/open-google-earth.ps1 b/scripts/open-google-earth.ps1 index 17564cd9..07000e14 100755 --- a/scripts/open-google-earth.ps1 +++ b/scripts/open-google-earth.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google Earth website. .EXAMPLE - PS> ./open-google-earth + PS> ./open-google-earth.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://earth.google.com/web/" exit 0 # success diff --git a/scripts/open-google-mail.ps1 b/scripts/open-google-mail.ps1 index 299282eb..2038b66a 100755 --- a/scripts/open-google-mail.ps1 +++ b/scripts/open-google-mail.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google Mail website. .EXAMPLE - PS> ./open-google-mail + PS> ./open-google-mail.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://mail.google.com" exit 0 # success diff --git a/scripts/open-google-maps.ps1 b/scripts/open-google-maps.ps1 index defaa063..22cce653 100755 --- a/scripts/open-google-maps.ps1 +++ b/scripts/open-google-maps.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google Maps website. .EXAMPLE - PS> ./open-google-maps + PS> ./open-google-maps.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://www.google.com/maps" exit 0 # success diff --git a/scripts/open-google-news.ps1 b/scripts/open-google-news.ps1 index 799e771e..9a6e0960 100755 --- a/scripts/open-google-news.ps1 +++ b/scripts/open-google-news.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google News website. .EXAMPLE - PS> ./open-google-news + PS> ./open-google-news.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://news.google.com" exit 0 # success diff --git a/scripts/open-google-photos.ps1 b/scripts/open-google-photos.ps1 index 32b05303..6fff34a4 100755 --- a/scripts/open-google-photos.ps1 +++ b/scripts/open-google-photos.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google Photos website. .EXAMPLE - PS> ./open-google-photos + PS> ./open-google-photos.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://photos.google.com" exit 0 # success diff --git a/scripts/open-google-play.ps1 b/scripts/open-google-play.ps1 index 3fe761b8..6f8b9eac 100755 --- a/scripts/open-google-play.ps1 +++ b/scripts/open-google-play.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google Play website. .EXAMPLE - PS> ./open-google-play + PS> ./open-google-play.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://play.google.com/store" exit 0 # success diff --git a/scripts/open-google-search.ps1 b/scripts/open-google-search.ps1 index 1bac58cd..f2c3dc5a 100755 --- a/scripts/open-google-search.ps1 +++ b/scripts/open-google-search.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google Search website. .EXAMPLE - PS> ./open-google-search + PS> ./open-google-search.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://google.com" exit 0 # success diff --git a/scripts/open-google-stadia.ps1 b/scripts/open-google-stadia.ps1 index ca694e64..a85de040 100755 --- a/scripts/open-google-stadia.ps1 +++ b/scripts/open-google-stadia.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google Stadia website. .EXAMPLE - PS> ./open-google-stadia + PS> ./open-google-stadia.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://stadia.google.com" exit 0 # success diff --git a/scripts/open-google-translate.ps1 b/scripts/open-google-translate.ps1 index 2a5a528f..8e3cf686 100755 --- a/scripts/open-google-translate.ps1 +++ b/scripts/open-google-translate.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the Web browser with the Google Translate website. .EXAMPLE - PS> ./open-google-translate + PS> ./open-google-translate.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://translate.google.com" exit 0 # success diff --git a/scripts/open-home-folder.ps1 b/scripts/open-home-folder.ps1 index 15f55101..4a8e608a 100755 --- a/scripts/open-home-folder.ps1 +++ b/scripts/open-home-folder.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the File Explorer with the user's home folder. .EXAMPLE - PS> ./open-home-folder + PS> ./open-home-folder.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { $TargetDir = resolve-path "$HOME" if (-not(test-path "$TargetDir" -pathType container)) { diff --git a/scripts/open-internet-archive.ps1 b/scripts/open-internet-archive.ps1 index 42120c3a..1fe504b7 100755 --- a/scripts/open-internet-archive.ps1 +++ b/scripts/open-internet-archive.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Web browser with the Internet Archive website. .EXAMPLE - PS> ./open-internet-archive + PS> ./open-internet-archive.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://archive.org" exit 0 # success diff --git a/scripts/open-jitsi-meet.ps1 b/scripts/open-jitsi-meet.ps1 index 83d6c472..aa01ac75 100755 --- a/scripts/open-jitsi-meet.ps1 +++ b/scripts/open-jitsi-meet.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Web browser with the Jitsi Meet website. .EXAMPLE - PS> ./open-jitsi-meet + PS> ./open-jitsi-meet.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://meet.jit.si/" exit 0 # success diff --git a/scripts/open-m-drive.ps1 b/scripts/open-m-drive.ps1 index b5ade0f7..3fdeb268 100755 --- a/scripts/open-m-drive.ps1 +++ b/scripts/open-m-drive.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the File Explorer with the M: drive folder. .EXAMPLE - PS> ./open-m-drive + PS> ./open-m-drive.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-file-explorer.ps1" "M:" exit 0 # success diff --git a/scripts/open-magnifier.ps1 b/scripts/open-magnifier.ps1 index 2bd819bf..a3fb24ed 100755 --- a/scripts/open-magnifier.ps1 +++ b/scripts/open-magnifier.ps1 @@ -4,15 +4,17 @@ .DESCRIPTION This script launches the Windows Screen Magnifier application. .EXAMPLE - PS> ./open-magnifier + PS> ./open-magnifier.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { - start-process magnify.exe + Start-Process magnify.exe exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/scripts/open-microsoft-paint.ps1 b/scripts/open-microsoft-paint.ps1 index 908a33ce..0be74da2 100755 --- a/scripts/open-microsoft-paint.ps1 +++ b/scripts/open-microsoft-paint.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the Microsoft Paint application. .EXAMPLE - PS> ./open-microsoft-paint + PS> ./open-microsoft-paint.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { start-process mspaint.exe exit 0 # success diff --git a/scripts/open-microsoft-solitaire.ps1 b/scripts/open-microsoft-solitaire.ps1 index dc494dde..e02c9840 100755 --- a/scripts/open-microsoft-solitaire.ps1 +++ b/scripts/open-microsoft-solitaire.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Microsoft Solitaire application. .EXAMPLE - PS> ./open-microsoft-solitaire + PS> ./open-microsoft-solitaire.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + Start-Process xboxliveapp-1297287741: exit 0 # success diff --git a/scripts/open-microsoft-store.ps1 b/scripts/open-microsoft-store.ps1 index 785d6f83..111a6188 100755 --- a/scripts/open-microsoft-store.ps1 +++ b/scripts/open-microsoft-store.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Microsoft Store application. .EXAMPLE - PS> ./open-microsoft-store + PS> ./open-microsoft-store.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + Start-Process ms-windows-store: exit 0 # success diff --git a/scripts/open-microsoft-teams.ps1 b/scripts/open-microsoft-teams.ps1 index d0efda33..24d14fc2 100755 --- a/scripts/open-microsoft-teams.ps1 +++ b/scripts/open-microsoft-teams.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the Microsoft Teams application. .EXAMPLE - PS> ./open-microsoft-teams + PS> ./open-microsoft-teams.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { Start-Process msteams: exit 0 # success diff --git a/scripts/open-music-folder.ps1 b/scripts/open-music-folder.ps1 index 42f50a3b..f6333aad 100755 --- a/scripts/open-music-folder.ps1 +++ b/scripts/open-music-folder.ps1 @@ -4,15 +4,17 @@ .DESCRIPTION This script launches the File Explorer with the user's music folder. .EXAMPLE - PS> ./open-music-folder + PS> ./open-music-folder.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { - $TargetDir = resolve-path "$HOME/Music" + $TargetDir = Resolve-Path "$HOME/Music" if (-not(test-path "$TargetDir" -pathType container)) { throw "Music folder at 📂$TargetDir doesn't exist (yet)" } diff --git a/scripts/open-netflix.ps1 b/scripts/open-netflix.ps1 index ea4ee3c2..3f1bb054 100755 --- a/scripts/open-netflix.ps1 +++ b/scripts/open-netflix.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Netflix application. .EXAMPLE - PS> ./open-netflix + PS> ./open-netflix.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + Start-Process netflix: exit 0 # success diff --git a/scripts/open-notepad.ps1 b/scripts/open-notepad.ps1 index 64fdece8..f661a943 100755 --- a/scripts/open-notepad.ps1 +++ b/scripts/open-notepad.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { Start-Process notepad.exe exit 0 # success diff --git a/scripts/open-obs-studio.ps1 b/scripts/open-obs-studio.ps1 index 02377deb..9016eb57 100755 --- a/scripts/open-obs-studio.ps1 +++ b/scripts/open-obs-studio.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the OBS Studio application. .EXAMPLE - PS> ./open-obs-studio + PS> ./open-obs-studio.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + function TryLaunching { param([string]$Path, [string]$Dir) if (test-path "$Path" -pathType leaf) { start-process -FilePath "$Path" -WorkingDirectory "$Dir" diff --git a/scripts/open-office-365.ps1 b/scripts/open-office-365.ps1 index 1ea05492..151a2be1 100755 --- a/scripts/open-office-365.ps1 +++ b/scripts/open-office-365.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Web browser with the Microsoft Office 365 website. .EXAMPLE - PS> ./open-office-365 + PS> ./open-office-365.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://portal.office.com" exit 0 # success diff --git a/scripts/open-one-drive-folder.ps1 b/scripts/open-one-drive-folder.ps1 index ed45d012..4dd73856 100755 --- a/scripts/open-one-drive-folder.ps1 +++ b/scripts/open-one-drive-folder.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the File Explorer with the user's OneDrive folder. .EXAMPLE - PS> ./open-one-drive-folder + PS> ./open-one-drive-folder.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { $TargetDirs = resolve-path "$HOME/OneDrive*" foreach($TargetDir in $TargetDirs) { diff --git a/scripts/open-outlook.ps1 b/scripts/open-outlook.ps1 index 9bfdc199..db0587ad 100755 --- a/scripts/open-outlook.ps1 +++ b/scripts/open-outlook.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the Microsoft Outlook email application. .EXAMPLE - PS> ./open-outlook + PS> ./open-outlook.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + function TryToExec { param($Folder, $Binary) if (test-path "$Folder/$Binary" -pathType leaf) { start-process "$Folder/$Binary" -WorkingDirectory "$Folder" diff --git a/scripts/open-paint-three-d.ps1 b/scripts/open-paint-three-d.ps1 index a54f1916..43164011 100755 --- a/scripts/open-paint-three-d.ps1 +++ b/scripts/open-paint-three-d.ps1 @@ -4,15 +4,17 @@ .DESCRIPTION This script launches the Paint 3D application. .EXAMPLE - PS> ./open-paint-3d + PS> ./open-paint-3d.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { - start-process ms-paint: + Start-Process ms-paint: exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/scripts/open-pictures-folder.ps1 b/scripts/open-pictures-folder.ps1 index 77ed8673..2e3cdcca 100755 --- a/scripts/open-pictures-folder.ps1 +++ b/scripts/open-pictures-folder.ps1 @@ -4,15 +4,17 @@ .DESCRIPTION This script launches the File Explorer with the user's pictures folder. .EXAMPLE - PS> ./open-pictures-folder + PS> ./open-pictures-folder.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { - $TargetDir = resolve-path "$HOME/Pictures" + $TargetDir = Resolve-Path "$HOME/Pictures" if (-not(test-path "$TargetDir" -pathType container)) { throw "Pictures folder at 📂$TargetDir doesn't exist (yet)" } diff --git a/scripts/open-rdp.ps1 b/scripts/open-rdp.ps1 index 4abb0e0b..9b28f7bc 100755 --- a/scripts/open-rdp.ps1 +++ b/scripts/open-rdp.ps1 @@ -12,11 +12,13 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + param([string]$hostname = "") if ($hostname -eq "") { - & Start-Process "$env:windir\system32\mstsc.exe" + & Start-Process "$env:WINDIR\system32\mstsc.exe" } else { - & Start-Process "$env:windir\system32\mstsc.exe" -ArgumentList "/v:$hostname" + & Start-Process "$env:WINDIR\system32\mstsc.exe" -ArgumentList "/v:$hostname" } -exit 0 # success \ No newline at end of file +exit 0 # success diff --git a/scripts/open-recycle-bin-folder.ps1 b/scripts/open-recycle-bin-folder.ps1 index e37e6901..9affd657 100755 --- a/scripts/open-recycle-bin-folder.ps1 +++ b/scripts/open-recycle-bin-folder.ps1 @@ -11,8 +11,10 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { - start shell:recyclebinfolder + Start shell:recyclebinfolder exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/scripts/open-remote-desktop.ps1 b/scripts/open-remote-desktop.ps1 index ae49d6c7..9eb44387 100755 --- a/scripts/open-remote-desktop.ps1 +++ b/scripts/open-remote-desktop.ps1 @@ -4,15 +4,17 @@ .DESCRIPTION This script launches the Remote Desktop application. .EXAMPLE - PS> ./open-remote-desktop + PS> ./open-remote-desktop.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { - start-process ms-rd: + Start-Process ms-rd: exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/scripts/open-repos-folder.ps1 b/scripts/open-repos-folder.ps1 index 073c84f0..7856cd3e 100755 --- a/scripts/open-repos-folder.ps1 +++ b/scripts/open-repos-folder.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the File Explorer with the user's Git repositories folder. .EXAMPLE - PS> ./open-repos-folder + PS> ./open-repos-folder.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { $TargetDir = Resolve-Path "$HOME/Repos" if (-not(Test-Path "$TargetDir" -pathType container)) { diff --git a/scripts/open-screen-clip.ps1 b/scripts/open-screen-clip.ps1 index 843cc422..f65b7b90 100755 --- a/scripts/open-screen-clip.ps1 +++ b/scripts/open-screen-clip.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the Screen Clip application. .EXAMPLE - PS> ./open-screen-clip + PS> ./open-screen-clip.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { Start-Process ms-screenclip: exit 0 # success diff --git a/scripts/open-screen-sketch.ps1 b/scripts/open-screen-sketch.ps1 index b206402f..3a4d04a9 100755 --- a/scripts/open-screen-sketch.ps1 +++ b/scripts/open-screen-sketch.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the Screen Sketch application. .EXAMPLE - PS> ./open-screen-sketch + PS> ./open-screen-sketch.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { Start-Process ms-screensketch: exit 0 # success diff --git a/scripts/open-skype.ps1 b/scripts/open-skype.ps1 index 11613222..715fb9b1 100755 --- a/scripts/open-skype.ps1 +++ b/scripts/open-skype.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the Skype application. .EXAMPLE - PS> ./open-skype + PS> ./open-skype.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { Start-Process skype: exit 0 # success diff --git a/scripts/open-snipping-tool.ps1 b/scripts/open-snipping-tool.ps1 index 3d45b7a0..bc814712 100755 --- a/scripts/open-snipping-tool.ps1 +++ b/scripts/open-snipping-tool.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Snipping Tool application. .EXAMPLE - PS> ./open-snipping-tool + PS> ./open-snipping-tool.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + Start-Process SnippingTool.exe exit 0 # success diff --git a/scripts/open-speed-test.ps1 b/scripts/open-speed-test.ps1 index 20ec6b6c..96bd0162 100755 --- a/scripts/open-speed-test.ps1 +++ b/scripts/open-speed-test.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Web browser with Cloudflare's speed test website. .EXAMPLE - PS> ./open-speed-test + PS> ./open-speed-test.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://speed.cloudflare.com" exit 0 # success diff --git a/scripts/open-spotify.ps1 b/scripts/open-spotify.ps1 index ec3c11de..76085014 100755 --- a/scripts/open-spotify.ps1 +++ b/scripts/open-spotify.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Spotify application. .EXAMPLE - PS> ./open-spotify + PS> ./open-spotify.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + Start-Process spotify: exit 0 # success diff --git a/scripts/open-stack-overflow.ps1 b/scripts/open-stack-overflow.ps1 index 3c819c7e..a10e8b1c 100755 --- a/scripts/open-stack-overflow.ps1 +++ b/scripts/open-stack-overflow.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Web browser with the Stack Overflow website. .EXAMPLE - PS> ./open-stack-overflow + PS> ./open-stack-overflow.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://stackoverflow.com" exit 0 # success diff --git a/scripts/open-start-page.ps1 b/scripts/open-start-page.ps1 index 8e5124de..84870ddd 100755 --- a/scripts/open-start-page.ps1 +++ b/scripts/open-start-page.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Web browser with the Startpage website. .EXAMPLE - PS> ./open-start-page + PS> ./open-start-page.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://www.startpage.com" exit 0 # success diff --git a/scripts/open-street-map.ps1 b/scripts/open-street-map.ps1 index 2f559921..1620f81b 100755 --- a/scripts/open-street-map.ps1 +++ b/scripts/open-street-map.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Web browser with the OpenStreetMap website. .EXAMPLE - PS> ./open-street-map + PS> ./open-street-map.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + & "$PSScriptRoot/open-default-browser.ps1" "https://www.openstreetmap.org" exit 0 # success diff --git a/scripts/open-task-manager.ps1 b/scripts/open-task-manager.ps1 index 0b2121fe..94259568 100755 --- a/scripts/open-task-manager.ps1 +++ b/scripts/open-task-manager.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the Windows Task Manager application. .EXAMPLE - PS> ./open-task-manager + PS> ./open-task-manager.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { Start-Process taskmgr.exe exit 0 # success diff --git a/scripts/open-temporary-folder.ps1 b/scripts/open-temporary-folder.ps1 index daec9732..dda90d5d 100755 --- a/scripts/open-temporary-folder.ps1 +++ b/scripts/open-temporary-folder.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the File Explorer showing the temporary folder. .EXAMPLE - PS> ./open-temporary-folder + PS> ./open-temporary-folder.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + function GetTempDir { if ("$env:TEMP" -ne "") { return "$env:TEMP" } if ("$env:TMP" -ne "") { return "$env:TMP" } diff --git a/scripts/open-three-d-viewer.ps1 b/scripts/open-three-d-viewer.ps1 index fc535d6d..51aab00d 100755 --- a/scripts/open-three-d-viewer.ps1 +++ b/scripts/open-three-d-viewer.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the 3D-Viewer application. .EXAMPLE - PS> ./open-three-d-viewer + PS> ./open-three-d-viewer.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + Start-Process com.microsoft.3dviewer: exit 0 # success diff --git a/scripts/open-thunderbird.ps1 b/scripts/open-thunderbird.ps1 index 6dd8c5eb..6a1a9c8d 100755 --- a/scripts/open-thunderbird.ps1 +++ b/scripts/open-thunderbird.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the Mozilla Thunderbird email application. .EXAMPLE - PS> ./open-thunderbird + PS> ./open-thunderbird.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + function TryToExec { param($Folder, $Binary) if (test-path "$Folder/$Binary" -pathType leaf) { start-process "$Folder/$Binary" -WorkingDirectory "$Folder" diff --git a/scripts/open-videos-folders.ps1 b/scripts/open-videos-folders.ps1 index 9abc25e8..862ddb4d 100755 --- a/scripts/open-videos-folders.ps1 +++ b/scripts/open-videos-folders.ps1 @@ -4,13 +4,15 @@ .DESCRIPTION This script launches the File Explorer with the user's videos folder. .EXAMPLE - PS> ./open-videos-folder + PS> ./open-videos-folder.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { $TargetDir = Resolve-Path "$HOME/Videos" if (-not(Test-Path "$TargetDir" -pathType container)) { diff --git a/scripts/open-visual-studio.ps1 b/scripts/open-visual-studio.ps1 index 8171303d..3b151ea5 100755 --- a/scripts/open-visual-studio.ps1 +++ b/scripts/open-visual-studio.ps1 @@ -11,6 +11,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + function tryToLaunch { param($filePath) if (Test-Path "$filePath" -pathType leaf) { Start-Process "$filePath" diff --git a/scripts/open-voice-recorder.ps1 b/scripts/open-voice-recorder.ps1 index 2b31c36c..6dd98c29 100755 --- a/scripts/open-voice-recorder.ps1 +++ b/scripts/open-voice-recorder.ps1 @@ -11,10 +11,12 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { Start-Process explorer.exe shell:appsFolder\Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe!App exit 0 # success } catch { "⚠️ Error: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))" exit 1 -} \ No newline at end of file +} diff --git a/scripts/open-vpn-settings.ps1 b/scripts/open-vpn-settings.ps1 index 5ea67da4..d4cb38d4 100755 --- a/scripts/open-vpn-settings.ps1 +++ b/scripts/open-vpn-settings.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This PowerShell script launches the VPN settings of Windows. .EXAMPLE - PS> ./open-vpn-settings + PS> ./open-vpn-settings.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + Start-Process ms-settings:network-vpn exit 0 # success diff --git a/scripts/open-windows-defender.ps1 b/scripts/open-windows-defender.ps1 index bda79e8b..433b7827 100755 --- a/scripts/open-windows-defender.ps1 +++ b/scripts/open-windows-defender.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Windows Defender application. .EXAMPLE - PS> ./open-windows-defender + PS> ./open-windows-defender.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + Start-Process windowsdefender: exit 0 # success diff --git a/scripts/open-windows-terminal.ps1 b/scripts/open-windows-terminal.ps1 index 905b357a..c4b451a4 100755 --- a/scripts/open-windows-terminal.ps1 +++ b/scripts/open-windows-terminal.ps1 @@ -4,12 +4,14 @@ .DESCRIPTION This script launches the Windows Terminal application. .EXAMPLE - PS> ./open-windows-terminal + PS> ./open-windows-terminal.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + Start-Process wt.exe exit 0 # success diff --git a/scripts/open-xing.ps1 b/scripts/open-xing.ps1 index 236ccca5..a1cab8bf 100755 --- a/scripts/open-xing.ps1 +++ b/scripts/open-xing.ps1 @@ -4,7 +4,7 @@ .DESCRIPTION This script launches the XING application. .EXAMPLE - PS> ./open-xing + PS> ./open-xing.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES