/build/static/layout/Breadcrumb_cap_w.png

Post-Installation task wait issues (K2000)

I'm having issues with a post-installation task that Kace doesn't wait for to complete properly, it begins the next task that fails.
Some screenies below, first one in the begining, the other one shows the powershell window still being active and running a scripts, while Kace tries to install BGInfo which is the next task...

O1UrvD.jpeg

82WE1T.jpeg

The details of the task that is causing the issue below:

Type: Application (the 2 files below zipped together)
Parameter: Remove-AllProvisionedAppxPackage.cmd
Content of cmd: Start /wait Powershell.exe -NoProfile -ExecutionPolicy ByPass -file Remove-AllProvisionedAppxPackage.ps1
Content of Remove-AllProvisionedAppxPackage.ps1: Get-appxprovisionedpackage –online | remove-appxprovisionedpackage –online

I've tried without "start /wait". I've tried running this with the command as a parameter instead, no difference. Please help me out.


Rgrds,
Simon




1 Comment   [ + ] Show comment
  • You can start to play with PowerShell JOBS...
    You create a Job in the first script and you fire it.
    In the second script you check and wait for that job...
    It's better than wait a certain amount of time.
    It's perhaps a bit more complex but in my opinion possibly more robust.
    http://www.howtogeek.com/138856/geek-school-learn-how-to-use-jobs-in-powershell/
    Kind regards,
    Marco - StockTrader - StockTrader 8 years ago
    • Thanks, I will save that url for the future :-) - szo850 8 years ago

Answers (2)

Answer Summary:
Posted by: SMal.tmcc 8 years ago
Red Belt
1
You want to do a restart on the nuke the app command, the delete of the apps does not apply till a reboot on a lot of the  apps because they are in memory.  If you do not want to reboot use the ksleep command to cause a delay.









Comments:
  • I'm only deleting provisioned apps from the image, not current user, no need for reboot. I can't get it to work properly with start /wait as you have above. Anyways, I've added "ksleep 60" so now it works (even though the script is executed twice for some strange reason. The second time it executes I get a UAC error, but because of the ksleep, the first script is allowed to finish. Wow... - szo850 8 years ago
  • When I run this powershell command as a BAT, it seems like some kind of character issue. It didnt say ...-Online. It said something like ...ÖoÖnline. That why powershell commands always fails for me when running them as BAT I guess. - szo850 8 years ago
Posted by: szo850 8 years ago
Purple Belt
1

Top Answer

I found the real cause for this problem and it's discussed here:

https://support.software.dell.com/k2000-systems-deployment-appliance/kb/185562

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ