title: How can I ensure only one instance of a script is running at a time?
body: <p>Suppose I launch a powershell script and it's running in a loop.
  I open a second ps console and launch a second script. In this script I want to detect if the first script is running or not. 
  What are the ways to achieve this?</p>