Wait for remote action, then continue?


  • Fairly new to PowerShell...

    I am trying to automate as much of the upgrade process as I can for a fairly complex application that spans across many servers. I'm not sure what I want to do is possible, and I wasn't sure how to articulate it into a Google Search, so I decided to try asking some fellow human beings. 

    The application installs/upgrades have an order of operations, and the first couple of installs must complete before the rest can begin.

    1. Install to SQL Server, which can take a long time. It has to complete successfully before the next step can run.

    2. Install to Service Bus for Windows server or farm. This can't begin until the SQL install completes, and must be completed before the rest of the installs begin.

    3. Web and misc. Windows servers that run the application's Windows services. These can run all at once, but not until steps 1 and 2 complete successfully.

    I want to run this whole process remotely from a server in the same network. I have worked out remotely deploying installers and their response files to the various servers from this central location, but I am trying to figure out how (if possible) I could get the second server to wait until the first server is done, and then begin its install process, and so on.

    Is there a way to make the process wait for some kind of acknowledgement of success (or failure I supposed) from the first step, and then begin the next step?

    Monday, May 20, 2019 4:28 PM

All replies

  • PowerShell jobs might be a good approach

    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful. (99,108,97,121,109,97,110,50,64,110,121,99,97,112,46,114,114,46,99,111,109|%{[char]$_})-join''

    Monday, May 20, 2019 4:40 PM
  • I will take a look at this. Thank you!
    Monday, May 20, 2019 5:00 PM
  • What you are asking to do is addressed in DSC.  DSC allows you to state dependencies so installs will only apply when a dependency becomes available.  All checking and I stalling is handled automatically. 

    There are DSC modules for most MS software and custom modules can be easily built for non-MS installs.




    Monday, May 20, 2019 5:29 PM
  • You might want to look at Chocolaty.

    The computing world is headed to the cloud using automated build tools like that. We started using Puppet and Chocolaty just as I "got retired", so I don't have a lot of experience with these tools. I would expect you to have a bit of a learning curve to get it set up, but in the long run it would position you to use it for any software package needed on your servers. 

    What is Chocolatey?

    Chocolatey is a package manager for Windows (like apt-get or yum but for Windows). It was designed to be a decentralized framework for quickly installing applications and tools that you need. It is built on the NuGet infrastructure currently using PowerShell as its focus for delivering packages from the distros to your door, err computer.

    Chocolatey is a single, unified interface designed to easily work with all aspects of managing Windows software (installers, zip archives, runtime binaries, internal and 3rd party software) using a packaging framework that understands both versioning and dependency requirements. Chocolatey packages encapsulate everything required to manage a particular piece of software into one deployment artifact by wrapping installers, executables, zips, and scripts into a compiled package file. Chocolatey packages can be used independently, but also integrate with configuration managers like SCCM, Puppet, and Chef. Chocolatey is trusted by businesses all over the world to manage their software deployments on Windows. You’ve never had so much fun managing software!

    Monday, May 20, 2019 5:38 PM
  • Thank you. I've been trying to get IT to look into that for other reasons too (e.g. Roles and Features prerequisites)
    Wednesday, May 22, 2019 3:37 PM
  • I know that the vendor of the application that I am working with uses Jenkins and Chef to do what I am attempting to do, but that's probably not an option for me because I'd have to get Corp IT involved and sell them on all of that. 
    Wednesday, May 22, 2019 3:38 PM
  • because I'd have to get Corp IT involved 
    Absolutely, your IT staff has to drive this direction. You can't (shouldn't) do it by yourself.  
    Thursday, May 23, 2019 2:05 AM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,


    Just do it.

    Monday, June 3, 2019 7:48 AM
  • It hasn't been resolved yet, however I think my best (only) option for now is to try to use PowerShell Jobs to accomplish this.

    When I've got this worked, I will reply with the details here. Likewise, I may have more questions along the way as I try to get this working. 

    Tuesday, June 4, 2019 7:46 PM