PowerShell 1.0 has about 125 cmdlets, whereas v 2.0 has a minimum of 230. The precise number depends on whether you are running Windows 8, 7, or XP.
- PowerShell ISE (Integrated Scripting GUI) makes scripting easier.
- Remoting is the killer new feature of version 2.0
- Background Jobs
- Remote Eventlog a big area of improvement.
- Get-WinEvent also other new ‘event’ cmdlets
- Test-Connection is PowerShell’s improvement upon Ping.
- Test-Path Is a cmdlet which I don’t recall seeing in PowerShell 1.0.
- Get-Help’s -online parameter. Checks for any updates.
- PowerShell 5.0 New Features
On Vista and later on operating systems PowerShell supports database style ‘ACID’ transactions, whereby you can commit or roll-back a sequence of operations.
Import-Module loads a bunch of dll and scripts, it replaces the Add-PSSnapin. See more about the PowerShell modules directory.
#REQUIRES -Version 2.0
This is not merely a remark, but an instruction to PowerShell v 1.0 that it cannot run the code which follows.
# PowerShell 2.0 Requires Example
# Requires -Version 2.0
Enter-PSSession IpAddress or FQDM
Research Techniques for Finding New PowerShell 2.0 Cmdlets
One way of checking for new PowerShell 2.0 cmdlets is to use Get-Command with the -Noun or -verb parameter. For example, I heard a rumour there was a new cmdlet to measure.
# Research measure cmdlets
Get-Command -verb measure
Research New Event cmdlets
# Research new event Windows PowerShell 2.0 cmdlets
Get-Command -commandType cmdlet *Event*
Note 1: Get-WinEvent looks interesting.
List All Cmdlets
# Research new Windows PowerShell 2.0 cmdlets
Get-Command -CommandType Cmdlet
SolarWinds’ Network Performance Monitor will help you discover what’s happening on your network. This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.
What I like best is the way NPM suggests solutions to network problems. Its also has the ability to monitor the health of individual VMware virtual machines. If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.
General Advice For PowerShell 2.0 and 1.0.
- Think of learning PowerShell as a more convenient method of configuring the server than using the corresponding GUI. I can foresee running PowerShell scripts that will diagnose server problems. With PowerShell you can run queries that are not possible from the GUI. On a good day such a script would even cure the problem – magic!
To come back down to earth, let us start with a trivial example to illustrate the capability of PowerShell. As you may know, the Task Manager will display all the processes, yet with PowerShell you can not only list all processes, but also group them by company (Microsoft, HP and Roxio). All you need is this one-liner:
Get-Process | group-Object company
- PowerShell will achieve the same results as VBScript, but with fewer commands. For instance, PowerShell makes scripting WMI much easier, for example, try: Get-WmiObject win32_BIOS. More good news, you can even use PowerShell to replace VBScript for Active Directory scripts.
- I have a sense that there is a changing of the guard; out with old CMD commands, and in with new PowerShell language. More importantly, the new PowerShell language will give you command line control of the Windows operating system; this is similar to the power that Bash commands exert over the UNIX operating system.
In a nutshell: PowerShell really is the way of the future.
- The main reason for learning PowerShell is so that you can administer Exchange Server 2007, and also the Longhorn server that will succeed Windows Server 2003. Microsoft’s thinking is that the point has arrived where complex products like Exchange and Longhorn have so many menus and sub-menus to configure via a GUI, that we need an alternative. Hence the easy-to-use scripting language called PowerShell.
Note: Existing Windows executables, such as Ipconfig and ping, perform in the PS Shell just as they do in the old CMD ‘DOS box’.
Here is an utility where you can review firewall settings such as access control lists (ACL), or troubleshoot problems with network address translation (NAT).
Other reasons to download this SolarWinds Firewall Browser include managing requests to change your firewall settings, testing firewall rules before you go live, and querying settings with the browser’s powerful search options.
Guy recommends that you download a copy of the SolarWinds free Firewall Browser.
Simple PowerShell Examples
Preamble, Start, Run PowerShell.
At the command line type (In that dark blue shell):
Here is another example, type:
I first realised the ability of PowerShell when I saw three lines of PowerShell replace about twenty lines of VBScript. The task is to interrogate Win32_classes, we can either use the traditional VBScript and WMI, or the new PowerShell with its Verb-Noun commands.
‘ End of Sample Memory WMI / VBScript
# Windows PowerShell script
"System Name = " + $CompSys.name
Summary of What’s New In Windows PowerShell v 2.0
Remoting is the big new feature of PowerShell v 2.0 followed closely by the ISE which makes writing scripts so much easier. Other than that, there lots of neat extra cmdlets.
If you like this page then please share it with your friends
See more Windows PowerShell sections
Please email me if you have a better example script. Also please report any factual mistakes, grammatical errors or broken links, I will be happy to correct the fault.