*How to use while and do while loops in powershell
*powershell
*do{} while()
*while() do{}
In this video I teach you the differences In while and do while loops in powershell
Code:
do {
echo "do something"
Start-Sleep 1
}
while(Get-Process notepad -ErrorAction SilentlyContinue)
echo "notepad was not running"
while (Get-Process notepad -ErrorAction SilentlyContinue){
echo "do something"
Start-Sleep 1
}