PowerShell Basics

Unlocking the new Power in the Microsoft Shell
September 7th, 2008

Adding Custom Properties To PowerShell Objects Just Got Easier

Jeffrey Snover just blogged about working around the Add-Member syntax by extending the System.Object type (which all types inherit from) with a script property called PSAddMember(), which allows you to add NoteProperties (the most common addition to objects) more easily ands supports other scenarios too.

Check it out here.

September 3rd, 2008

Interested in PowerShell?

I’ll be providing an introduction to PowerShell at the September LOPSA-Madison meeting (September 11th, at 7:00 PM - room open at 6:30).  If you live in the Milwaukee/Madison, Wisconsin area, come on out.  The LOPSA-Madison chapter has a lot of smart people, interesting discussion, and good networking opportunities.

If you are not in the Southeastern Wisconsin, check out LOPSA.org to see if there is a local chapter in your area.  Get Involved!

(There are some door prizes, provided by the sponsors of PowerShellCommunity.org)

July 23rd, 2008

Marco Shaw Presenting on /n NetCmdlets

Marco Shaw (of the Get-PowerShell Blog) will be presenting to the UK Users Group about /n Software’s NetCmdlets. 

Check it out, as /n Software has a number of cool cmdlets for working with network protocols and has a product under development for tunneling PowerShell over SSH.

Details of the presentation are here.

July 16th, 2008

Using PowershellASP

There is a new toy out in the PowerShell Community - PowerShellASP.

You can find the description on the website, but there has been some question as to how to get it working.

The easiest way I’ve found is to work off the demo provided, where the web.config

file is all set up. 

What you need to do for IIS 6, is:

    CreateApplication
  • Update the configuration

UpdateConfiguration

  • Add the ps1x extension and the executable of “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll”

AddExtension

  • (If you are using the sample files this is done already) Update the web.config file with
  • <httpHandlers>
                <add verb=”*” path=”*.ps1x” type=”PowerShellToys.PowerShellASP.PSHandler, PowerShellToys.PowerShellASP”/>
            </httpHandlers>

    And you should be ready to run PowerShellASP pages.
April 29th, 2008

New-Feature “PowerShell Quick-Tip” | Out-RSS

I’m a bit behind on releasing regular shows, so I’ve added a short feature, where we can briefly review a cmdlet or particular function of the cmdlet.

 Thanks for staying tuned!

 
icon for podpress  PowerShell Basics Quick Tip [3:13m]: Play Now | Play in Popup | Download
April 15th, 2008

PowerShell vs. Code Runner .NET

I just came across a blog post on Colin’s Microsoft Developer Blog called Scripting for C#.  In the post, Colin describes using Code Runner .NET to be able to quickly create a C# application and run it without having to create a new project or solution file or worry about binaries.

 

PowerShell can serve that exact purpose, without the overhead of launching Visual Studio or needing other tools.  PowerShell can leverage the experience developers have with the .NET Framework, right at the command line. 

 

The Code Runner .NET project includes a sample program that takes nineteen lines.  Here is the PowerShell equivalent -

Write-Host $MyInvocation.MyCommand

 

Code Runner .NET seems to be a pretty cool project, but PowerShell in the development environment can be a very useful tool.

 

[NOTE:  I’m a sysadmin, not a developer, so take my comparison with whatever sized grain of salt desired.] 

April 7th, 2008

PoShMon for PolyMon!

I’m happy to announce the release of PoShMon - a PowerShell snap-in for working with PolyMon, an open source system monitoring solution.

 

This is the first release and contains some basic cmdlets for interacting with PolyMon.  Cmdlets included are:

  • Get-Monitor
  • Set-Monitor
  • New-Monitor
  • Add-Operator
  • Remove-Monitor

What I am looking to do with PoShMon was create a scriptable interface to create and modify monitor objects.  There is a (limited) help included with this (using the standard PowerShell Get-Help structure).

 

Please provide me with suggestions, feature requests, and other feedback.

 

Installation instructions:

You will need to have the PolyMon Monitor installed.  Running the install script will copy the PoShMon.dll and PoShMon.dll-Help.xml to the PolyMon\PolyMon Monitor directory and install the snap-in.  It will load the snap in for the current PowerShell session.

 

If you would like to make the cmdlets available in other PowerShell sessions, you can use Add-PsSnapin PoShMon during your console session or add it to your profile script.

 

PoShMon can be downloaded here.

PoShMon’s source code can be downloaded here.

More information about PolyMon can be found here

.

Technorati Tags: ,,,

March 19th, 2008

Happy Birthday to A Couple Of Admins/Mind Of Root!

I’d also like to wish Mind of Root (formerly A Couple of Admins) a happy birthday and I would like to say thank you to Rich and Keith for welcoming me to the podcast (August will be a full year for me.)

 

If you haven’t had listened to the podcast before, we cover a wide array of sysadmin related topics, tech topics, and news stories in a less than formal structure.  We also have had a number of interesting interviews.

 

Hope to see you there!

March 19th, 2008

Happy Birthday to the PowerScripting Podcast!

Just wanted to wish Hal and Jonathan a Happy Birthday, as the PowerScripting Podcast is now 1 year old!

 

They’ve also released the first half of an interview with Jeffrey Snover.  Find it HERE.

 

Great work guys!

March 6th, 2008

Show #2 - Discoverability

PowerShell is the most discoverable command line I’m aware of.  Discoverability in PowerShell means that there is a way to examine the data and methods of objects on the command line.

In this episode, I take a look at Get-Member, which allows you to inspect the properties and methods of the objects that are available from the PowerShell commandline.

 Feedback is always appreciated, so please post a comment, send me an email, or find me in the PowerShell IRC chatroom (#powershell on irc.freenode.net).

 
icon for podpress  Online Video [22:10m]: Play Now | Play in Popup | Download