I am trying create a process of the windows reliability monitor and kill it after I take a screenshot.
I am having trouble to get the process and automatically close it before I take the screenshot because there is no process ID that identifies that window.
there is any way to close the reliability monitor via PowerShell?
$psi = New-object System.Diagnostics.ProcessStartInfo
$psi.CreateNoWindow = $false
$psi.UseShellExecute = $true
$psi.RedirectStandardOutput = $false
$psi.RedirectStandardError = $false
$psi.FileName = "Perfmon"
$psi.Arguments ="/rel"
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $psi
[void]$process.Start()
#$output = $process.StandardOutput.ReadToEnd()
$process.id
Start-Sleep 5