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

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.
 
K

Karl Mitschke

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
 
T

Tim Munro

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top