Strange PowerShell Bug?

I'm fighting with a strange behavior of the MS PowerShell RC1, that might be a bug. It's about moving and renaming items with "[" or "]" in the name. Strangely they're simply ignored, sometimes I also get a message that the file does not exist (although I just gathered it using Get-ChildItem!?)

How to reproduce:

Open PowerShell and create an empty directory:

> mkdir pstest
> cd pstest

Create a file without [ and ] and rename/move it around.

> New-Item abc.txt -type file
> gci *.txt | mi -Destination test.txt // works
> ri test.txt

Now try it with a file containing [ and ] in its name.

> New-Item abc.[def].txt -type file
> gci *.txt | mi -Destination test.txt // does NOT work

In the second case the file is not renamed. Did I misunderstand something? Can you reproduce it? It is an old well known bug?

Comments

# Christoph Rüegg said:

UPDATE: This bug is fixed in the newer RC2 version. Go get the update at: http://support.microsoft.com/kb/925228 More Details: http://blogs.msdn.com/powershell/archive/2006/09/26/Windows_PowerShell_RC2_Now_Available.aspx

Donnerstag, 28. September 2006 00:47