Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

NEW Stop Feature upgrade if precheck fails

lalajee2018

Well-Known Member
Messages
143
Reaction score
6
Points
18
Hi,
I'm using an action custom script to run a Powershell script to check for a few things before running the feature upgrade on a machine but even the machine is not compliant it still running the upgrade.


for example, I have this code in preinstall.cmd


if(-not (Test-path $path))
{
write-error "Stop"
exit 1


}


this should stop the upgrade but its not happening.


Does anyone know how I can stop the upgrade if it doesnt meet my preinstall checks
 
Back
Top