Take CMD of Powershell

Here’s another fast and furious Powershell tip.  Even though Powershell has an alias for DIR, it is not the DIR command you’re used to.  It is an alias to Get-ChildItem.  This means if you are use to using commands like:

C:\> DIR *.exe /w

This will fail in Powershell.  I think there are some Powershell Community extensions to work around this and I think the Powershell team is also looking at this. Fortunately, there is a simple remedy.  In Powershell simply invoke CMD and run the DIR command like you always have in the past:

PS C:\Scripts> cmd /c dir *.ps1 /w /od

You’ll never know the difference.

Technorati tags: ,

del.icio.us tags: ,