View Single Post
Old 07-17-2006   #4 (permalink)
Keith Hill [MVP]


 
 

Re: Problem Calling String(char[] value) constructor

"Bruce Payette [MSFT]" <brucepay@microsoft.com> wrote in message
news:%23ErYVKdqGHA.2068@TK2MSFTNGP03.phx.gbl...
> The new-object cmdlet is a placeholder until we get around to adding a
> proper "new" keyword. It's certainly harder to use than it should be.
> Unfortunately using it like:
>
> new-object String($x,1,3)
>
> obscures the fact that it's a cmdlet making things even more confusing.
> The syntax for new-object is
>
> New-Object [-TypeName] <String> [[-ArgumentList] <Object[]>]
>


Thanks for that explanation. I've got to quit thinking in terms of C#
method calls with parens around the parameter list! BTW a "new" keyword
would be very nice if it allowed PoSH to be smarter about interpreting
constructor arguments.

--
Keith


My System SpecsSystem Spec