Currently the correct windows version has to be identified manually after deploy. Given that it is not safe to downgrade, a reinstall needs to be performed if wrong version is chosen on initial installation:
#region Check for Licensing
$SoftwareLic = Get-WmiObject 'SoftwareLicensingService'
if ( $SoftwareLic.OA3xOriginalProductKey -match '[0-9a-z]{5}-[0-9a-z]{5}-[0-9a-z]{5}-[0-9a-z]{5}-[0-9a-z]{5}' ) {
if ( $SoftwareLic.OA3xOriginalProductKeyDescription -match 'Pro') {
write-host "Has a Professional OEM license"
}
else {
write-host "Has a NON Professional OEM License"
}
}
else { write-host "No OEM license" }
#endregion
Currently the correct windows version has to be identified manually after deploy. Given that it is not safe to downgrade, a reinstall needs to be performed if wrong version is chosen on initial installation: