Powershell how to display a message when starting Notepad (or another application).

Closed due to the fact that the essence of the issue is not clear to the participants of Kromster , aleksandr barakin , user194374, Grundy , Streletz Jun 17 '16 at 6:56 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    register-wmiEvent -query "select * from __instancecreationevent within 5 where targetinstance isa 'Win32_Process' and targetinstance.name='notepad.exe'" -sourceIdentifier "ProcessStarted" -Action { Write-Host "RUNNING" }