If you want PowerShell to wait for an action to complete, you can display a loading spinner using these few lines of code.
The script will print a new dot every three seconds until the condition in the until-clause is fulfilled.
The result looks like this: