$isdir has a bug in it that will have it return true if .'s are on the end of directories.

Example.

//say $isdir(c:\windows..)


We don't just write the scripts, we put them to the test! (ScriptBusters)