What is the proper way of exiting PSADT if a condition fails? Is this correct?
if ( Test-Path "\\some\remote\share" ) {
Execute-Process "the_installer.exe"
} else {
Write-Host "Can't reach the shared folder!"
exit 60012
}
I realize I could just let Execute-Process fail but I would like to know WHY it failed.
The scenario that’s driving this is an installation package of 20GB which is far beyond what Intune allows (8GB). So I am forced to put the installation folder on an internal shared drive but the people running this would be on laptops and may forget to run their VPN client prior to attempting the install despite a big red warning in the Company Portal.