0

I am using below powershell code to generate rule based scom alert and when I am trying to print property bag value in Alert response –> Alert Description, getting blank value. Can you please help me or provide me proper syntax to print property bag value in Alert Description.

Please let me know if you need any further information.
$ScomAPI = New-Object -comObject “MOM.ScriptAPI”
$PropertyBag = $ScomAPI.CreatePropertyBag()

** some code **

$PropertyBag.addvalue(“Desription”,$global:messages)

if($global:messages -match “missing”)
{
$PropertyBag.AddValue(“state”,”ERROR”)

}
$PropertyBag

Anand chenepalli edited question