After much searching online I couldn't find a way to do this without WMI and a bunch of extra work... So I figured this out. Tested and working in Windows 10 at least.
$user = "$env:USERDOMAIN\$env:USERNAME"
$proc = Get-Process -Name notepad -IncludeUserName | where {$_.UserName -eq $user}
Wait-Process -InputObject $proc
That will look for all instances of notepad running under the current user, and wait for all of them to terminate before continuing.
Super useful when waiting for something like msiexec
Subscribe to:
Post Comments (Atom)
Fixing NTP failing with Chrony on Kubuntu 26.04
Kubuntu 26.04 — Chrony NTP Sync Failure (Home Network) Root cause: Ubuntu 26.04 switched from systemd-timesyncd to chrony by default, with...
-
If you are recieving the following error: The session setup from the computer COMPUTERNAME failed to authenticate. The name(s) of the acco...
-
Relevant Errors: Failed to prepare guest for hot backup. Error: VSSControl: -2147212529 Backup job failed. Discovery phase failed. Can...
-
To make my life easier I have been working at automating the conversion process from VMWare virtual machines to Proxmox VE 9. The hardest pa...
C5A33994
ReplyDeleteyenişehir esçort
esçort kırıkkale
adıyaman esçort
artvin esçort
cide esçort
fatsa esçort
ereğli esçort
pendik olgun esçort
gölcük esçort
E525781D
ReplyDeleteElvankent
Selçuk
Milas
Siverek
Çeşme
Çarşamba
Elmadağ
İzmit
Tatvan
Gölcük
ReplyDeleteKandıra
Dilovası
Konak
Seferihisar
Marmaris
Darıca
Torbalı
Altındağ