Re: [MSH] $args bug
- From: lee.holmes@xxxxxxxxxxxxxxxxxxxx
- Date: 13 Jan 2006 11:15:06 -0800
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
.
- References:
- Re: [MSH] $args bug
- From: Keith Hill [MVP]
- Re: [MSH] $args bug
- Prev by Date: ntfs file permissions, ownership
- Next by Date: Re: Robocopy access denied
- Previous by thread: Re: [MSH] $args bug
- Next by thread: Re: $args bug
- Index(es):
Relevant Pages
|