The Surly Admin

Father, husband, IT Pro, cancer survivor

Additional Thoughts on Hashtables

I recently starting looking at the subreddit for PowerShell, and I’ve seen a lot of people using hashtables for just about everything.  I’ve even seen a few people using them over at PowerShell.com and in both cases the usage was dubious at best.  Here are my thoughts on it, and why hashtables are usually not the right choice.

Continue reading

April 8, 2014 Posted by | Powershell - Getting Started | , | 6 Comments

Simple Multiplication Table

My daughter has really been working on her multiplication tables this year and normally she comes home with a study sheet for each number, all the way up to 12.  This week we’re working on 8′s, so 8×0, 8×1, all the way up to 8×12.  Unfortunately she didn’t get a worksheet so she decided to make her own.  If I can take a moment of fatherly pride, she does this kind of thing all the time without us making her.  What a gal!  Well, one of the ways I motivate her is to race her.  So it was on.  Can I write a PowerShell script and get the multiplication table out before she could write it out?!

Continue reading

April 4, 2014 Posted by | Powershell - Getting Started | , , , , | Leave a comment

New Scripts – Bandwidth Report and Google Charts

Got a couple of new scripts I recently wrote, here’s some quick thoughts on them.

Continue reading

April 2, 2014 Posted by | PowerShell - HTML Reporting | , , , , , | Leave a comment

WhoIS Report

Really fascinating project came through Spiceworks the other day and I wanted to talk about it.   In the DNS forum someone posted that they needed a tool to lookup certain WhoIs information.  The interesting part was they had over 1000 domains so they needed something that could create a report on that kind of scale, so a simple WhoIs website or application wasn’t going to cut it.  But as I looked at it, I began to wonder if this was something I could pull off with PowerShell?  I knew there would be no problem once I had the data, but the trick would be getting the data.  But surely there was a RESTful API out there for WhoIs data, right?  If I could find that then a simple Invoke-RestMethod should retrieve the data necessary and we’re good to go.  Right?

Continue reading

March 7, 2014 Posted by | PowerShell | , , , | Leave a comment

HTML Reporting – A Simple Cell Color Changer

As a follow-up to the ConvertTo-AdvHTML function, I have also written a much simpler version that simply changes the color of a cell.  The advantage to this script over the bigger ConvertTo-AdvHTML function is it works with current ConvertTo-HTML, or even HTML pages from other sources.  It also allows you the ability to set the criteria for the the color change.  Best of all it’s simple to use.

Continue reading

March 3, 2014 Posted by | PowerShell - HTML Reporting | , | 2 Comments

ConvertTo-AdvHTML – New Advanced Function for HTML Reporting

I love using ConvertTo-HTML.  There, I’ve said it.  The vast number of scripts I write are doing some kind of reporting function and the ability to create simple, fast, yet good looking reports with HTML has been a huge plus for PowerShell.  That said though, there’s definitely room for improvement.  ConvertTo-AdvHTML is an advanced function that addresses some of the current limitations with current cmdlet.  But this blog post isn’t going to a long explanation of how to use the new cmdlet, instead I wanted to write a script that actually used it.

Continue reading

February 27, 2014 Posted by | PowerShell - HTML Reporting | , , , , | 3 Comments

Parameter Sets

This has come up a couple of times and I’ve always managed to work around it, but there will come a time when you want to create an advanced function or script.  One with many parameters, and some of those parameters will be mutually exclusive.  You can do this using the ParameterSetName argument, inside the Parameter decorator.  Here’s how!

Continue reading

February 10, 2014 Posted by | PowerShell | , | 1 Comment

Ping Monitor

The other day I mentioned I was having a really bad day–that after being recognized turned into a really good day.  The reason it was though was because my shiny new firewall from Meraki was having all kinds of problems keeping a reliable site-to-site VPN with my co-host site.  The remote firewall was a Cisco ASA 5510 so you would have thought this wouldn’t be a problem!  But it was, and from it arose a need to create something that could monitor if my multiple subnets were routing properly.  The funny thing was I had recently helped another Spicehead with a similar script!  Now I needed it!

Continue reading

January 13, 2014 Posted by | PowerShell | , , | Leave a comment

PowerShell Hero

An unexpected honor came across my Twitter feed today!

Continue reading

January 8, 2014 Posted by | General | | 5 Comments

More With Google Maps

Had a great time creating the Out-LastEarthquake.ps1 script, but let’s face it, other than it’s cool factor it doesn’t have much use.  But what we do have is the framework for the ability to place markers on a Google Map, and there are definitely some uses for that.  I created a proof of concept script that shows just what you could do.

Continue reading

January 7, 2014 Posted by | PowerShell | , , | 5 Comments

Follow

Get every new post delivered to your Inbox.

Join 179 other followers