Register : : Login
menuleft menuright
submenu
 
May 7

Written by: Tobias
5/7/2008 5:37 PM  RssIcon

PowerShell is "supposed" to be 100% backwards compatible but in reality it isn't. It can't. It uses some special characters such as parenthesis that modify the way a line is parsed. So the following simple command will fail in PowerShell:

echo This won't work (because of the parenthesis)

or

wmic service where (startmode='Auto' and started=true) get /value

To make working in PowerShell a one-stop thing, I added the capability to execute native commands in the old cmd.exe environment simply by pressing SHIFT+ENTER. So when you enter the above line in PS+ console and press SHIFT+ENTER, you get the correct result.

You can even assign the results of a native command to a PS variable like this:

$a = dir (press SHIFT+ENTER)

Don't know PS+ yet? Go grab it: http://www.powershell.com/download/psp1.zip. Unzip, run. It's as easy as that. And it's free for non-commercial use. Enjoy!

Hungry for more? The latest (non-public) build is always available here: http://www.powershell.com/download/psp1new.zip. And the change log with the latest additions is available here: http://www.powershell.com/mantis/changelog_page.php.

 

 

Tags:
Categories:

1 comment(s) so far...


Gravatar

Re: Executing native commands in PS+ console


Do you Know Gucci ? It is the symbol of high society and luxury life. All product printed GUCCI will be sold with a very high price. I am love the gucci so much , and i used to buy it from [url=http://guccibags-onsale.net]Gucci bags On Sale[/url] store.

By linzhi on   10/20/2011 10:11 AM
 
Blogs
  
Search Blogs
  
Archives
  
   
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
footer