mtniehaus / UpdateOS

Sample app for installing Windows updates during an Autopilot deployment
137 stars 29 forks source link

Not all parameters are taken over, when re-running process #6

Closed HeyJudeRW closed 3 months ago

HeyJudeRW commented 4 months ago

The "ExcludeDrivers" parameters is not taken over, when re-launching 32-bit as a 64-bit process. https://github.com/mtniehaus/UpdateOS/blob/a6c6c3f0d9cf4a83cc50751329fd01d11ec70d5d/UpdateOS/UpdateOS.ps1#L59 I tested with "@PSBoundParameters". but it errors out:

Cannot process argument transformation on parameter 'ExcludeDrivers'.
Cannot convert value "System.String" to type "System.Management.Automation.SwitchParameter". Boolean parameters accept
only Boolean values and numbers, such as $True, $False, 1 or 0.
HeyJudeRW commented 4 months ago

Oh yeah, workaround for me was using this install command for the Intune Win32App:

C:\Windows\Sysnative\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy bypass -file .\UpdateOS.ps1 -ExcludeDrivers

Thank you Rudy Ooms 😉 https://call4cloud.nl/2021/05/the-sysnative-witch-project/

mtniehaus commented 3 months ago

I checked in a (brute force) fix for this, so you won't need to do any workarounds. Sorry about that.