wmi fails to run in powershell LocalScripts
I have written a powershell script that runs with the LocalScripts plugin. It's using the #ps1sysnativ lin and most of the code runs as expected. However anything that calls wmi like (gwmi win32operatingsystem).OperatingSystemSKU fails with a generic error. Has anybody ran into this?
powershell transcript of the code failing. https://gist.github.com/trodemaster/a...
Thanks, Blake
From further investigation is seems the point in the sysprep process that cloudbase-init runs user scripts is to early. WMI is not available. I have attempted to use the exit codes to have the script re-run later but didn't help. Now I'm looking at using setupcomplete.cmd instead.