From 96650596752e4dc448856500ab6fc9eeedd03154 Mon Sep 17 00:00:00 2001 From: dyoder Date: Sun, 25 Oct 2020 09:39:25 -0400 Subject: [PATCH] new script --- Disable-TabletMode.ps1 | 14 ++++++++++++++ Uninstall-AdobeFlash.ps1 | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Disable-TabletMode.ps1 create mode 100644 Uninstall-AdobeFlash.ps1 diff --git a/Disable-TabletMode.ps1 b/Disable-TabletMode.ps1 new file mode 100644 index 0000000..a8b34a3 --- /dev/null +++ b/Disable-TabletMode.ps1 @@ -0,0 +1,14 @@ +$RegKey = 'HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell' +. 'C:\Users\dyoder\Emberkom\Data\Projects\development\management-scripts\Tools.ps1' +## Make sure endpoint is running at least Windows 8 +If ( IsWindowsVersion -ge '6.3' ) +{ + LogMsg "Disabling tabled mode" + Try + { + Set-ItemProperty $RegKey -Name 'TabletMode' -Value 0 + Set-ItemProperty $RegKey -Name 'SignInMode' -Value 1 + } + Catch { LogErr $_.Exception.Message } +} +Else { LogMsg "Tablet mode is only supported on Windows 8 and higher" } \ No newline at end of file diff --git a/Uninstall-AdobeFlash.ps1 b/Uninstall-AdobeFlash.ps1 new file mode 100644 index 0000000..c54dcc8 --- /dev/null +++ b/Uninstall-AdobeFlash.ps1 @@ -0,0 +1,18 @@ +If ( IsAdmin ) +{ + If ( Test-Path 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player NPAPI' ) + { $RegKey = 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player NPAPI' } + ElseIf ( Test-Path 'HKLM:SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player NPAPI' ) + { $RegKey = 'HKLM:SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player NPAPI' } + If ( $RegKey ) + { + LogMsg "Found uninstall string: ${UninstallString}" + $UninstallString = (Get-ItemProperty -Path $RegKey).UninstallString + $UninstallProgram = $UninstallString -replace ' -maintain plugin', '' + LogMsg "Running: ""${UninstallProgram}"" -uninstall" + Try { Start-Process "${UninstallProgram}" -ArgumentList "-uninstall" -Wait } + Catch { LogErr $_.Exception.Message } + } + Else { LogMsg "Adobe Flash Player is not installed" } +} +Else { LogMsg "Must have administrative privileges to uninstall Adobe Flash" } \ No newline at end of file