View Single Post
Old 08-07-2008   #3 (permalink)
Oliver


 
 

Re: Script parameter problem

Hi Neil,
Quote:

> I'm not quite sure what you mean but each space denotes a new argument
> (multiple spaces mean more arguments which get bundled into an array) so
> using the approach you used to assign to $i is correct for specifying a
> single argument
That's right. But I want 'expand' $i in that way, that $i becomes the
commandline

../test1 '1234 5678' 22 33 zzz

and not

../test1 "'1234 5678' 22 33 zzz"

Cheers,
Oliver
Quote:

> "Test" <olli.marx@xxxxxx> wrote in message
> news:%23xEdbDN%23IHA.4784@xxxxxx
Quote:

>> Hi,
>>
>> there are two scripts
>>
>> test1.ps1:
Quote:

>> > $Args
>>
>> test2.ps1:
Quote:

>> > $i = "'1234 5678' 22 33 zzz"
>> > ./test1 $i
>>
>> Running test2 -> Output
Quote:

>> > '1234 5678' 22 33 zzz
>>
>> but it should be like
>> test3.ps1:
Quote:

>> > ./test1 '1234 5678' 22 33 zzz
>>
>> Running test3 -> Output:
Quote:

>> > 1234 5678
>> > 22
>> > 33
>> > zzz
>>
>> How can I use a normal string - without converting it to an array - as
>> a variable. Or I'm totally blind?
>
My System SpecsSystem Spec