Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

89 views
Skip to first unread message

Tim Munro

unread,
Nov 24, 2009, 1:52:53 PM11/24/09
to
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.

--
Tim.


Karl Mitschke

unread,
Nov 24, 2009, 2:59:15 PM11/24/09
to
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.
>
> --
> Tim.

Have you tried NULL?

Karl


Mike Pfeiffer

unread,
Nov 25, 2009, 3:32:02 AM11/25/09
to
try:

MyCommand.Parameters.add("AcceptMessagesOnlyFrom", Nothing)

"Tim Munro" wrote:

> .
>

Tim Munro

unread,
Nov 25, 2009, 8:16:43 AM11/25/09
to
I tried NULL, but VB doesn't recognize it. It wants "Nullable" or
"Nullable(of T)", or "NullReferenceException". Non of which I really
understand.

--
Tim.

"Karl Mitschke" <karlmi...@somestate.gov> wrote in message
news:d66cd4c2182c18...@msnews.microsoft.com...

Tim Munro

unread,
Nov 25, 2009, 8:18:06 AM11/25/09
to
Mike! "Nothing" worked perfectly. Thank you very much.

--
Tim.

"Mike Pfeiffer" <MikePf...@discussions.microsoft.com> wrote in message
news:44F7D058-05B6-4B04...@microsoft.com...

Mike Pfeiffer

unread,
Nov 25, 2009, 11:56:01 AM11/25/09
to
Your welcome Tim, glad to help.

"Tim Munro" wrote:

> .
>

0 new messages