title: Powershell Wait for service to be stopped or started
body: <p>I have searched both this forum and through google and can't find what I need.
  I have a quite large script and I'm looking for some code that will check if the service is started or stopped before proceeding to the next step.</p>
  
  <p>The function it self need to loop untill it's either stopped or started (Going to have a function for Stopped and one for Started).</p>
  
  <p>In total 4 services which almost have the same name, so Service Bus * can be used as a wildcard.</p>