Skip to content

Instantly share code, notes, and snippets.

@everydayintech
everydayintech / PSAppwiz.ps1
Created January 28, 2023 17:57
get combined x86 and x64 uninstall key entries
# 2>NUL & @CLS & PUSHD "%~dp0" & "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -nol -nop -ep bypass "[IO.File]::ReadAllText('%~f0')|iex" & POPD & EXIT /B
$x86 = Get-ItemProperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*
$x64 = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*
$res = $x86 + $x64
$res | ? {$_.DisplayName -notlike ""} | Sort DisplayName | `
Select-Object DisplayName, Publisher, DisplayVersion, InstallDate, InstallLocation, InstallSource, ModifyPath, UninstallString | `
Out-GridView -Wait
@everydayintech
everydayintech / logoff.ps1
Created January 25, 2023 17:00
logout as if you have never been there
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI' -Name 'LastLoggedOnUser' -Value '' -PropertyType String -Force -ea SilentlyContinue;
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI' -Name 'LastLoggedOnUserSID' -Value '' -PropertyType String -Force -ea SilentlyContinue;
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI' -Name 'LastLoggedOnSAMUser' -Value '' -PropertyType String -Force -ea SilentlyContinue;
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI' -Name 'SelectedUserSID' -Value '' -PropertyType String -Force -ea SilentlyContinue;
logoff.exe
@everydayintech
everydayintech / Pause-WindowsUpdates.ps1
Created January 5, 2023 12:36
Pause Windows 10 Updates for N Days
[string]$nowDate = [DateTime]::Now.ToString("yyyy-MM-dd'T'HH:mm:ss'Z'")
[string]$UpdatePauseEndDate = [DateTime]::Now.AddDays(7).ToString("yyyy-MM-dd'T'HH:mm:ss'Z'")
[string]$RegNode = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings'
Set-ItemProperty -Path $RegNode -Name 'PauseFeatureUpdatesStartTime' -Value $nowDate
Set-ItemProperty -Path $RegNode -Name 'PauseQualityUpdatesStartTime' -Value $nowDate
Set-ItemProperty -Path $RegNode -Name 'PauseUpdatesExpiryTime' -Value $UpdatePauseEndDate
Set-ItemProperty -Path $RegNode -Name 'PauseFeatureUpdatesEndTime' -Value $UpdatePauseEndDate
Set-ItemProperty -Path $RegNode -Name 'PauseQualityUpdatesEndTime' -Value $UpdatePauseEndDate