powershell - Polluted pipeline troubleshooting -


i have script, in code fails, exit code of -2145124322

$new.exitcode > $null $filepath = "wusa.exe" $argumentlist = "`"\\px_server\rollouts\microsoft\virtualpc\windows6.1-kb958559-x64-refreshpkg.msu`" /quiet /norestart" $exitcode = (start-process -filepath:$filepath -argumentlist:$argumentlist -wait -erroraction:stop -passthru).exitcode write-host $exitcode 

now, main script has 15,000 lines of "other stuff going on", , these lines not this. variables pulled xml, there data validation , try/catch blocks, sorts of stuff. so, started pulling pertinent lines out, , put them in tiny separate script, , hard coded variables. , there, works, nice 3010 exit code , off races. so, took working code, hard coded variables , all, , pasted original script, , breaks again. so, moved code out of function belongs, , put after initialize , before start working through main loop. , there works! now, gotta believe it's usual "polluted pipeline", dang if can figure out cause this. next step guess start stepping through code, dropping nugget in somewhere, run test, if works move farther down, try again. gack! so, hopping has insights. either might be, or perhaps improved test protocol. or trick see whole pipeline , somehow recognize pollution.

fwiw, work posh v2, have tried v4 exact same results. perhaps there pipeline monitoring feature in later version troubleshooting?

also, understanding posh v2 has issues negative return codes, can't trusted. think newer versions fixed this, correct? fact same code in v4 means meaningful google? not have found hint of exit code anywhere far.

crossed fingers.

edit: ok, little more data. searched on exit code without -, , duckduckgo instead of google, , found this. 0x8024001e -2145124322 wu_e_service_stop operation did not complete because service or system being shut down. ok, that's direction. , have code allow me kill service temporarily. seems little draconian. isn't whole point of this, 10th way install updates microsoft, supposed to make automation easier? in case, can't find indication there command line flags wusa avoid problem, have believe doing wrong.

solved! after tracking number of different errors trying different things, including turning off firewall , such, turns out error isn't service won't stop, service won't start. see, of 15k lines of code suppresses windows update duration of script, because windows update causes lots of autodesk deployments fail, whole point of code. well, of course wusa needs service. so, looks like, rather suppressing windows update duration of script execution, need less heavy handed , suppress duration of deployment task. take few hours implement , test, totally doable. , more elegant anyway. woot!

and yeah, once wasn't me pooping in pipeline unintentionally. ;)


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -