Alerts can be listed like that with az cli like that
$activities = az monitor activity-log list -g $ResourceGroup
which produces in PowerShell a string but is a list of JSON's.
Any one knows why $activities is not a PSCustomObject which I could use ?
CodePudding user response:
I do agree with @Mathias R. Jessen that
az
is an executable and executables return strings, not objects
$activities = az monitor activity-log list -g "Resourcegroup"
$res=$activities | ConvertFrom-Json
$res
Output:
Now you can use Dot Operator as below: