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)
Proxmox Backup Server - Recover a ZFS Datastore that is 100% full
This has happened to me a couple times now where my ZFS pool has filled to 100% causing not only backups to fail, but also the ability to ru...
-
If you are recieving the following error: The session setup from the computer COMPUTERNAME failed to authenticate. The name(s) of the acco...
-
Assuming you had made a backup of your wallet by going to File> Backup Wallet restoring is rather simple. When you reinstall Dogecoin W...
-
Below is the Docker Compose script to setup Graylog. Copy and paste this then make a new Project with this script. The default password I us...
No comments:
Post a Comment