function Enable-MSIInstallation { pushd cd hklm:\Software\Policies\Microsoft\Windows\ if ((test-path -path Installer) -eq $false) { md Installer | out-null } cd Installer if ((Get-ItemProperty .).DisableMSI -ne $null) { Set-ItemProperty . -name "DisableMSI" -value 0 | out-null } else { New-ItemProperty . -name "DisableMSI" -value 0 -PropertyType DWORD | out-null } popd } function Disable-MSIInstallation { pushd cd hklm:\Software\Policies\Microsoft\Windows\ if ((test-path -path Installer) -eq $false) { return } cd Installer if ((Get-ItemProperty .).DisableMSI -ne $null) { Remove-ItemProperty . -name "DisableMSI" } popd }