Last active
October 8, 2021 09:39
-
-
Save stuartleeks/3208fd2b9e5233879f3455dedb97faed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true)] | |
[ValidateSet("Top", "Bottom")] | |
[string] | |
$Position | |
) | |
# 0 - Left (doesn't work well) | |
# 1 - Top | |
# 2 - Right (doesn't work well) | |
# 3 - Bottom | |
enum Position { | |
Top = 1 | |
Bottom = 3 | |
} | |
# Convert input to int value | |
$posValue = [Position]$Position | |
$settings = (Get-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3\).Settings | |
$settings[12] = $posValue | |
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3\ -Name Settings -type Binary -Value $settings | |
Stop-Process -Name explorer | |
# if explorer doesn't restart, run explorer.exe manually |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment