Powershell uses the @{ key = value }
syntax to create a hashtable. Instead of passing a string, pass the hashtable with a single remove
element with the value of email@address.com
.
See the related question Passing a hashtable from C# to powershell for more.
command.AddCommand("Set-Mailbox");
command.AddParameter("Identity", "GenMgr");
var addresses = new Hashtable();
addresses.Add("remove", "GenMgr@domain.com");
command.AddParameter("EmailAddresses", adresses);
powershell.Commands = command;
powershell.Invoke();