powershell

Working with the HPQ WMI Provider to find NIC Information on HP Proliant Servers

I recently had a task to query NIC information on a number of HP Proliant servers, this included the connected NIC speed, duplex settings and status of the configured HP Team. I initally looked at the WMI class Win32_NetworkAdapterConfiguration which contains a lot of info around NIC configuration. Unfortunately, it does not include NIC speed or duplex settings. Looking for alternatives, I discovered a script from Hugo Peeters which instead queried the registry key HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318} which looked like it would do the job.

What's New in PowerCLI 5.0 - UK PowerShell User Group 22nd November

A quick post to let you know that I shall be presenting for an online meeting of the UK PowerShell User Group on the topic of ‘What’s New in PowerCLI 5.0’ at 21.00 GMT on Tuesday November 22nd. Details on how to join in are available from Richard Siddaway’s website. Hope you can join us.

PowerCLI Drop In Area at the UK National VMUG November 3rd

There are a lot of great reasons to sign up for the UK National VMUG on November 3rd 2011, full details are below. One reason to highlight is that during the day, Alan Renouf and I will be staffing the PowerCLI Drop In Area. We’re currently finalising the details, but this will likely consist of pre-prepared PowerCLI lab content for you to work through and also an opportunity to ask PowerCLI or PowerShell questions.

PowerShell v3 - ISE Commands Add-on

*****Warning. This is from a preview release****** PowerShell ISE in v2 allowed you to create your own custom menu items via PowerShell script (a good example can be found on the Hey Scripting Guy blog) PowerShell ISE in v3 ships with an Add-on built in called Commands. This Add-on places (by default) a Commands entry in the Add-on Tools Pane as below: This Add-on is a very useful learning and reference tool since it provides access to help info for cmdlets and will help you add the necessary parameters you are looking for.

PowerShell v3 - Bringing [ordered] to your hashtables

*****Warning. This is from a preview release****** When using a hashtable in PowerShell v2 the insertion order is not preserved. So I might be slightly OCD, but this bugs me: $HashTableOld = @{a=1; b=2; c=3; d=4} $HashTableOld If you consider the type of the object you will see that it is of .NET type System.Collections.Hashtable $HashTableOld | Get-Member In PowerShell v3 it is now possible to create an ordered hashtable using the [ordered] syntax

PowerShell v3 - Creating Objects With [pscustomobject] - it's fast!

*****Warning. This is from a preview release****** PowerShell v2 brought the ability to create a custom object via the following method: $CustomObject1 = New-Object psobject -Property @{a=1; b=2; c=3; d=4} $CustomObject1 | Format-List PowerShell v3 brings the possibility to create a custom object via [pscustomobject] $CustomObject2 = \[pscustomobject\]@{a=1; b=2; c=3; d=4} $CustomObject2 | Format-List Note: both methods create a PSCustomObject with NoteProperties, not a hashtable object $CustomObject1 | Get-Member $CustomObject2 | Get-Member So, why would you want to do it this way?

Windows Server 8 - Now with PowerShell Cmdlets for DHCP

*****Warning. This is from a preview release****** In Windows Server 2008 R2 there were a number of modules included for managing typical server roles such as Active Directory, Failover Clustering etc. However, there were some noteable absentees, such as DHCP server. You may ask why am I highlighting PowerShell cmdlets for DHCP, well: Fellow London VMUG regular Julian Wood commented on my PowerShell v3 First Look Post asking if there were DHCP cmdlets this time.

PowerShell ISE v3 - Now With IntelliSense

*****Warning. This is from a preview release****** Not everybody uses the PowerShell ISE as their primary script editor. However, if you do, or if you are using it to quickly edit a script not on your primary workstation then you will be pleased to see that in v3 it now has IntelliSense. In both the Input pane and the Script Editor. From the Input pane: This also works for commands in modules not loaded yet, such as Get-NetIPaddress.

PowerShell v3 - A Quick First Look

A preview (emphasis on the preview) of PowerShell v3 was made available in the early hours of this morning following the announcement at the Build conference. Apparently they are also planning to ship something with it called Windows 8. You can download the Windows Developer preview from MSDN to get an early look at it. Well we know for sure that it is new: and it is version 3:

PowerShell Magazine Launched

Some good friends of mine and fellow PowerShell MVPs have been working very hard over the last few months to put together an exciting new venture, http://www.powershellmagazine.com . They launched the site today and there is already some excellent content up there. I encourage you to go check it out and add to your RSS reader since I know there is plenty of great content upcoming for the site. I’m hoping to be able to contribute some articles of my own as soon as possible.