Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Command to Wait until process(appref-ms ps1) is fully loaded?

$
0
0

Hi, I am trying to automate one of my daily task, facing lots of issues. need your help or better approach.

Issues: appref-ms ps1 takes 2 to 3 minutes to load dlls , latest updates. I don't know how to stop my commands until it loads every thing. I have tried sleep command, process.waitforexit(), waitforidle etc., but no luck. 

e.g :

  • clickonceps1 command(it download latest updates/loads dlls)
  • changeenvironment
  • mycommand1
  • mycommand2


Daily Task: run few powershell commands to stop/start services remotely( i can not rewrite this as i have to use company given tool only). for that i need to run powershell command and start/stop services remotely. repeated work, thought to automate it and pass service names and servernames as parameters in one shot.

steps to do my work: i need to launch appref-ms(Click once), which gets latest version/scripts/dlls from server and launches powershell , which may take 2 to 3 minutes. after that only my daily work starts. 

Challenge: finally i have found appref-ms download location and ps1 scripts which launches the powershell.  I have created my own ps1(powerhsell script) and add series of my commands one by one and saved it and executed it from powershell command prompt. my commands always fails as environment is not fully ready. 


Thanks in advance.


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>