Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CheckRunningProcessesFunc
- {
- $Processes = (Get-Variable InclusionList).Value.CheckedItems #List of proceese to check if they are on or off
- $RunningProcesses = Get-WMIObject Win32_Process -filter "Name='adc.exe' OR Name='optask.exe'" | select -expand path #current running processes
- foreach ($Process in $Processes)
- {
- $TimeNow = get-date -Format ‘HH:mm:ss’
- $Text = $TimeNow + " " + $Process
- if ($RunningProcesses -contains $Process)
- {
- $Result = $Text + ' is On'
- (Get-Variable ListBox).Value.Items.Add($Result)
- }
- else
- {
- $Result = $Text + ' is Off'
- (Get-Variable ListBox).Value.Items.Add($Result)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement