Friday, December 22, 2006

Why does "cd\" not work in powershell?

When I began using Powershell one of the first things I searched desperately for was how to change the directory back to the root of the C:\ drive. In all of my previous cmd shell's before, the first thing I would do was type in "cd\". An aesthetic thing really but it would allow you to see most commands on one line instead of wrapping.

Well, "cd\" doesn't work in powershell. Ran into someone's blog shortly after (sorry it was a while back I don't remember it now) and they explained that "cd" is now an alias for "sl". "sl" stands for set-location. Run a "help sl" for all of the options there.

So "sl" is the actual cmdlet but "sl\" still doesn't get the job done. You have to add a space. So both "sl \" and "cd \" can do the job. Seems like a space is necessary for all of the commands. I was finally at peace and ready to tackle real powershell scripting.

One more tidbit, pusdh and popd still work in powershell. Just like cd though it's an alias for the real cmdlet's.

0 Comments:

Post a Comment

<< Home