My script uninstalls a Windows Store app before installing the newer version. I need to make sure the uninstall is finished before installing, so how can I make sure I've waited long enough?
Remove-Appxpackage MyAppName
# ~wait here~
Add-Appxpackage .\PathToNewVersion