Re: [MSH] $args bug



I've filed a bug on this for you.

--
Lee Holmes [MSFT]
Microsoft Command Shell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

-----Original Message-----
From: Keith Hill [MVP]
Posted At: Friday, January 13, 2006 10:31 AM
Posted To: microsoft.public.windows.server.scripting
Conversation: [MSH] $args bug
Subject: Re: [MSH] $args bug

"Neville Bagnall" <neville_bagnall@xxxxxxxxxxx> wrote in message
news:op.s3bmi2w9odxzrt@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>> mkdir 8.0
>>
>> Directory: Microsoft.Management.Automation.Core\FileSystem::C:\Temp
>>
>>
>> Mode LastWriteTime Length Name
>> ---- ------------- ------ ----
>> d---- 1/12/2006 10:42 PM 8
>>
>> Doh! That created a directory called 8 instead of 8.0. Better hope the
>> user
>> notices that MSH didn't do quite what they intended. :-(
>
> I don't know about mkdir (I zap all the legacy aliases) but new-item -type
> directory 8.0 works.
> This is because the expected parameter type is string.
> Functions and scripts can get the same behaviour using param([type]name)

This problem is in both the "md" and "mkdir" functions because they use
$args instead of strongly typed parameters.

--
Keith
.



Relevant Pages

  • Re: [RFC] IO scheduler based IO controller V9
    ... I happened to encount a bug when i test IO Controller V9. ... other tasks which access into "hdb" will also hang up. ... mkdir /cgroup/test1 ... rmdir /cgroup/test2/test3 ...
    (Linux-Kernel)
  • Re: [RFC] IO scheduler based IO controller V9
    ... I happened to encount a bug when i test IO Controller V9. ... The bug only happens when using AS io scheduler. ... mkdir /cgroup/test1 ... rmdir /cgroup/test2/test3 ...
    (Linux-Kernel)
  • Re: [RFC] IO scheduler based IO controller V9
    ... I happened to encount a bug when i test IO Controller V9. ... mkdir /cgroup/test1 ... echo "pid4: $pid4" ... rmdir /cgroup/test2/test3 ...
    (Linux-Kernel)
  • Questions regarding bug 2123602 (mkdir failing in mounted directory)
    ... with v4 and only with mkdir, ... The bug description for 2123602 mentions 'Integrated in Build: ... If an official patch is not to be had, ... Stefan Jankowski ...
    (comp.unix.solaris)
  • Re: [MSH] get-wmiobject -Credential
    ... This bug has been fixed in our most recent build. ... Microsoft Command Shell Development ... This posting is provided "AS IS" with no warranties, ... >> hmm, looks like there is a problem with a number in the Username, do ...
    (microsoft.public.windows.server.scripting)