I am writting an Azure Runbook with Powershell and want to know if theres anyway I can see when the script last ran. I have tried the following:
$History = Get-History
if ($History.EndExecutionTime = 5){
$Message = "Ran whithin last five Minutes"
}
else{
$Message = "Starting Runbook"
}
I am trying to see if the runbook powershell script ran within the last 5 Minutes but it is not working