From 98ac588a2311b16bdc0ae29c6851d13982a9d6d9 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 4 Nov 2021 08:43:36 +0100 Subject: [PATCH] Add open-screen-magnifier.ps1 and close-screen-magnifier.ps1 --- Scripts/close-screen-magnifier.ps1 | 15 +++++++++++++++ Scripts/open-screen-magnifier.ps1 | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 Scripts/close-screen-magnifier.ps1 create mode 100755 Scripts/open-screen-magnifier.ps1 diff --git a/Scripts/close-screen-magnifier.ps1 b/Scripts/close-screen-magnifier.ps1 new file mode 100755 index 00000000..a87d1e0d --- /dev/null +++ b/Scripts/close-screen-magnifier.ps1 @@ -0,0 +1,15 @@ +<# +.SYNOPSIS + Closes the Screen Magnifier +.DESCRIPTION + This script closes the Windows Screen Magnifier application gracefully. +.EXAMPLE + PS> ./close-screen-magnifier +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +& "$PSScriptRoot/close-program.ps1" "Screen Magnifier" "magnify.exe" "" +exit 0 # success diff --git a/Scripts/open-screen-magnifier.ps1 b/Scripts/open-screen-magnifier.ps1 new file mode 100755 index 00000000..a46fc4d6 --- /dev/null +++ b/Scripts/open-screen-magnifier.ps1 @@ -0,0 +1,20 @@ +<# +.SYNOPSIS + Launch the Screen Magnifier +.DESCRIPTION + This script launches the Windows Screen Magnifier application. +.EXAMPLE + PS> ./open-screen-magnifier +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +try { + start-process magnify.exe + exit 0 # success +} catch { + "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" + exit 1 +}