Error creating Outlook Rules in Powershell
问题 I've been messing around with Outlook objects for Powershell. I wanted to create Outlook Rules and I got it to work. Layed the project aside for a while. When I picked it back up I was unable to create Outlook rules. Note that I did NOT change anything in the code. Code generating Outlook Rule $rules = $ol.Session.DefaultStore.GetRules() $rule = $rules.Create("spamfilter",[Microsoft.Office.Interop.Outlook.OlRule Type]::olRuleReceive) $condition = $rule.Conditions.SenderAddress $condition