2014-03-01 1 views

답변

0

그래, Register-WMIEvent을 사용할 수 있습니다. 이벤트를 등록한 후 Action 매개 변수에 이벤트를 지정하면 임의의 scriptblock이 실행됩니다. iexpore.exe라는 프로세스가 생성 될 때마다 스크립트 블록은 콘솔에 기록하는 위치

다음은 간단한 예제 :이 더 읽기에 관심이 있다면

Register-WMIEvent -query "Select * From __InstanceCreationEvent within 3 Where TargetInstance ISA 'Win32_Process' and TargetInstance.Name ='iexplore.exe'" ` 
-sourceIdentifier "New IE Process" ` 
-action {Write-Host "A new Internet Explorer process has started!"} 

여기, 도움 Scripting Guy post concerning Event Monitoring입니다. Get-PSEvent은 현재 Get-Event으로 알려져 있습니다.

관련 문제