Team blog of MCS @ Middle East and Africa

This blog is created by Microsoft MEA HQ near shoring team, and it aims to share knowledge with the IT community.With its infrastructure and development sides,It brings to you the proven best practices and real world experiences from Subject Matter Experts
Follow Us On Twitter! Subscribe To Our Blog! Contact Us

PowerShell 3.0 – Shell from Future

PowerShell 3.0 – Shell from Future

  • Comments 2
  • Likes

PowerShell 3.0 is shipped with Windows 8. We are still experiencing some of the great features of Windows Server 8, but PowerShell 3.0 also brings many new features. Thanks to PowerShell Product Team for such a great innovation.

In this blog post, I will discuss about some of simplified syntaxes.

PowerShell Integrated Script Environment has an improved UI design and features.

clip_image002

This is new designed PowerShell ISE console.

Right pane you’ll notice Commands section.

clip_image004

As you know, in PowerShell V2 you have to query available commands or syntax with get-help or Tab button.

In PowerShell 3.0 you can search any kind of command within Commands pane. I searched for commands that includes “printer” and it outputs all available commands.

And also it provides me all required or optional parameters for selected command.

Now i can select Get-Printer cmdlet and fill up mandatory or optional params.

clip_image006

Now just click copy and paste into script pane.

clip_image008

This is a great feature especially for those who don’t like much writing or remembering script syntax.

Another great feature is improved Tab button Smile Now it completes automatically for all kind of parameter, argument etc. within a window.

In below example, I just write Get-Pro and press tab. It brings all available commands that start with Get-Pro

clip_image010

It also brings parameters and arguments.

clip_image012

And finally it gets to you all available processes on your system lively !

clip_image013

Another example of argument auto completion:

clip_image014

Auto completion also works for .Net. If you call [System.Net.DNS] it will bring you all available methods.

clip_image016

Error notification is also available lively.

clip_image017

I think one of the greatest features of PowerShell 3.0 is statement help.

If you press CTRL + J, it will bring you all statements with their usage and examples.

clip_image019

But this is not enough.

Just click one of the statements and then it will paste a template usage example into your Script Pane.

clip_image020

This is a great feature cause I believe many system administrators don’t want to remember usage of each statement. They don’t need any more.

With PowerShell 3.0, you don’t need special $_. Character to filter script outputs.

Below is a simple example in PowerShell 2.0 to get a process that has a name “IDLE”. For complex scripts it is open for mistakes.

clip_image021

In PowerShell 3.0 just put a pipe and write only column name with no special character. It works and looks great.

clip_image022

It’s same for foreach too.

clip_image023

This is a brief post about PowerShell 3.0 features. There are bunch of great features and we will figure out them in our next blogs.

Comments
  • simple and clear. thank you.

  • Nice  ... Thx Anil

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment