0
프로그램을 열 때 (Internet Explorer) 알아야하는 스크립트 작업 중입니다. 실행중인 프로그램을 모니터링 할 수있는 powershell 스크립트를 실행할 수 있습니까? 아니면 내 프로그램을 서비스로 실행해야합니까?Powershell을 사용하여 실행중인 응용 프로그램 모니터링
프로그램을 열 때 (Internet Explorer) 알아야하는 스크립트 작업 중입니다. 실행중인 프로그램을 모니터링 할 수있는 powershell 스크립트를 실행할 수 있습니까? 아니면 내 프로그램을 서비스로 실행해야합니까?Powershell을 사용하여 실행중인 응용 프로그램 모니터링
그래, 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
으로 알려져 있습니다.