VB.NET powershell Pipeline.Invoke: pass $NULL as value

  • Thread starter Thread starter Tim Munro
  • Start date Start date
T

Tim Munro

Hi all,
I need to be able to pass the Powershell $null value as a parameter to a
powershell pipeline invocation:

EG:
Mycomand = new command("set-mailbox")
MyCommand.Parameters.add("Identity",sCN)
MyCommand.Parameters.add("AcceptMessagesOnlyFrom", <I need the NULL value
here>)

Anything I've tried has resulted in a
Microsoft.Exchange.configuration.Tasks.....

Or I need some other way to clear this attribute from VB.NET (2008)

Pardon the minimal code, but every other aspect of the pipline invocation
works just fine. The only thing I cna't do is pass a "Null" as a parameter
value.

Thanks.
 
Hello Tim,
Hi all,
I need to be able to pass the Powershell $null value as a
parameter to a
powershell pipeline invocation:
EG:
Mycomand = new command("set-mailbox")
MyCommand.Parameters.add("Identity",sCN)
MyCommand.Parameters.add("AcceptMessagesOnlyFrom", <I need the NULL
value
here>> )
here>>
Anything I've tried has resulted in a
Microsoft.Exchange.configuration.Tasks.....

Or I need some other way to clear this attribute from VB.NET (2008)

Pardon the minimal code, but every other aspect of the pipline
invocation works just fine. The only thing I cna't do is pass a "Null"
as a parameter value.

Thanks.

Have you tried NULL?

Kar
 
I tried NULL, but VB doesn't recognize it. It wants "Nullable" or
"Nullable(of T)", or "NullReferenceException". Non of which I really
understand.
 
Back
Top