How do I disable UAC using a PowerShell script? I can do this manually via the registry using the adding the following registry entry
Key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA
Value: 0
Type: DWORD
The script should account for the possibility that this key is already present and set incorrectly.
New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -PropertyType DWord -Value 0 -Force
Restart-Computer