Need some help
I’m running a command in PS to query a task
schtasks /query /fo LIST /tn ‘\Receive Orders’
Get a result
TaskName: \Receive Orders
Next Run Time: 2/25/2020 2:40:00 PM
Logon Mode: Interactive/Background
What I would like to get from the query is this
Look at the status if the status is “Ready” do nothing if the Status is “Running” send me an email.
I don’t know how to achieve this.
I also tried Get-ScheduledTask but I just don’t know how to get this to email me only when the task is runnig.