PowerShell 3.0 - Simplified Syntaxes

PowerShell 3.0 - Simplified Syntaxes

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.

Leave a Comment
  • Please add 5 and 6 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
Page 1 of 1 (1 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
Page 1 of 1 (1 items)