{"id":103,"date":"2007-04-04T13:33:31","date_gmt":"2007-04-04T21:33:31","guid":{"rendered":"http:\/\/testblog.sapien.com\/index.php\/2007\/04\/04\/take-cmd-of-powershell\/"},"modified":"2007-04-04T13:33:31","modified_gmt":"2007-04-04T21:33:31","slug":"take-cmd-of-powershell","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2007\/04\/04\/take-cmd-of-powershell\/","title":{"rendered":"Take CMD of Powershell"},"content":{"rendered":"<p>Here&#8217;s another fast and furious Powershell tip.&nbsp; Even though Powershell has an alias for DIR, it is not the DIR command you&#8217;re used to.&nbsp; It is an alias to Get-ChildItem.&nbsp; This means if you are use to using commands like: <\/p>\n<p><font style=\"color: #0000ff\" color=\"#0000ff\">C:\\&gt; DIR *.exe \/w<\/font><\/p>\n<p>This will fail in Powershell.&nbsp; 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.&nbsp; In Powershell simply invoke CMD and run the DIR command like you always have in the past:<\/p>\n<p><font style=\"color: #0000ff\" color=\"#0000ff\">PS C:\\Scripts&gt; cmd \/c dir *.ps1 \/w \/od<\/font><\/p>\n<p>You&#8217;ll never know the difference.<\/p>\n<div class=\"wlWriterSmartContent\" id=\"0767317B-992E-4b12-91E0-4F059A8CECA8:f11bfa55-9e84-4cdf-bffe-eec490276805\" style=\"padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px\"><span class=\"sizeLess20\">Technorati tags: <\/span><a href=\"http:\/\/technorati.com\/tags\/PowerShell\" rel=\"tag\"><span class=\"sizeLess20\">PowerShell<\/span><\/a><span class=\"sizeLess20\">, <\/span><a href=\"http:\/\/technorati.com\/tags\/Commandline\" rel=\"tag\"><span class=\"sizeLess20\">Commandline<\/span><\/a><\/div>\n<p><\/p>\n<div class=\"wlWriterSmartContent\" id=\"0767317B-992E-4b12-91E0-4F059A8CECA8:f7ee8e7f-bd57-42c0-9336-84dbd8add191\" style=\"padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px\"><span class=\"sizeLess20\">del.icio.us tags: <\/span><a href=\"http:\/\/del.icio.us\/popular\/PowerShell\" rel=\"tag\"><span class=\"sizeLess20\">PowerShell<\/span><\/a><span class=\"sizeLess20\">, <\/span><a href=\"http:\/\/del.icio.us\/popular\/Commandline\" rel=\"tag\"><span class=\"sizeLess20\">Commandline<\/span><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s another fast and furious Powershell tip.  Even though Powershell has an alias for DIR, it is not the DIR command you&#8217;re used to.  It is an alias to Get-ChildItem.  This means if you are use to using commands like DIR *.exe \/w ,this will fail in Powershell. Fortunately, there is a simple remedy.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[25],"tags":[],"class_list":["post-103","post","type-post","status-publish","format-standard","hentry","category-windows-powershell"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=103"}],"version-history":[{"count":0,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/103\/revisions"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}