Skip to content

Instantly share code, notes, and snippets.

@Quiquex
Created December 1, 2023 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Quiquex/ffe798319d93f388b1ea239467d29bb4 to your computer and use it in GitHub Desktop.
Save Quiquex/ffe798319d93f388b1ea239467d29bb4 to your computer and use it in GitHub Desktop.
$path = 'HKCU:\SOFTWARE\Wizards Of The Coast\MTGA';
$key = Get-Item $path
$namevalues = $key | Select-Object -ExpandProperty Property |
ForEach-Object {
[PSCustomObject] @{
Name = $_;
Value = $key.GetValue($_)
}
}
$anomalies = $namevalues |
Where-Object {
$_.Name -like '*PhaseLad*' -and $_.Value -gt 1
}
if ($anomalies) {
$anomalies | ForEach-Object {
Set-ItemProperty -Path $path -Name $_.Name -Value 1
}
Write-Host Found and fixed the following values:
$anomalies | Format-Table
}
else {
Write-Host No invalid registry values found
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment