PowerShell has a number of looping structures – do; while; for; foreach. This is how the PowerShell while loop works
The while statement has the form:
while (<condition>){<statement list>}
The while loop is probably the simplest of the PowerShell… Read the full text.