Skip to content

Instantly share code, notes, and snippets.

@jonathanelbailey
Created October 7, 2015 21:54
Show Gist options
  • Save jonathanelbailey/d3d38de4e9494eb6e7e3 to your computer and use it in GitHub Desktop.
Save jonathanelbailey/d3d38de4e9494eb6e7e3 to your computer and use it in GitHub Desktop.
A function that allows the configuration of Windows 10 32-bit OS for 16-bit application support
Function Set-SSSLegacyConsoleSettings{
BEGIN{
$checkwin10 = Gcim win32_operatingsystem
}
PROCESS{
if ($checkwin10.Name -notmatch 'Windows 10'){
Write-Host 'No update needed. Operating system must be Windows 10.' -ForegroundColor Green
}
else{
if ((Get-WindowsOptionalFeature -Online -featurename ntvdm).state -ne 'enabled'){
Enable-WindowsOptionalFeature -Online -FeatureName ntvdm
write-host 'NTVDM.exe has been installed.' -ForegroundColor Green
}
elseif((Get-WindowsOptionalFeature -Online -FeatureName ntvdm).state -eq 'enabled'){
Write-Host 'NTVDM is already enabled.' -ForegroundColor DarkGreen
}
if((Get-ItemProperty -Path HKCU:\Console).forcev2 -eq 1){
Set-ItemProperty -Path HKCU:\Console -Name forcev2 -Value 0
}
elseif((Get-ItemProperty -Path HKCU:\Console).forcev2 -eq 0){
Write-Host 'Legacy Console is already enabled.' -ForegroundColor DarkGreen
}
}
}
END{}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment