Hello,
I setup a simple monitoring tool that looks at APIs using UD. It uses UDRow, UDLayout, & UDCard.
I wanted to go one step further, and log the ‘down’ items to a file. I tried to do Out-File after the step where I check if something is up or down (to determine the UDCard color), but it does not see to write to the file.
Else {
$color = "Red"
$status = "Stopped"
$fColor = "White"
"$(Get-Date -format MM/dd/yyyy),$(Get-Date -format HH:mm:ss),$name,API Stopped,0,0" | Out-File "D:\Scripts\Monitor\systemAlerts.csv" -Append
}
New-UDCard -Title "$name" -Text "System is $status" -BackgroundColor "$color" -FontColor $fColor
I appreciate any help, as I am really new to UD, but love using it!
I might not be putting the out-file in the right section of the script.
Thank you!