A Slow daaaaay!!!! meh!

Morning, even before I finish my morning coffee, and before I do my morning checks on my infrastructure, making sure Microsoft DPM has behaved, that we not lost any DC and all other user facing services are present. ( you would think I would be allowed to introduce a service monitoring product, but nooooo! I have to check the health status myself, manually each day this makes me grumpy of course!)… or I just don’t bother and hope for the best – all depending on my CBA level! Its Friday so I think we know if these  will actually be done!!!

Right as it’s POETS day and I been in the office for 20 mins and not been turned into a Grumpy Git yey, I thought I would be kind share a small snippet of PSH that I find useful.

Right there are times ,when you execute a command such as LS or PS and the output is so fast you can’t spot what you want! Well here is a simple easy function I use to slowdown the output of the screen!

function slowdown { process { $_;Start-Sleep -seconds .6}}

This a very very simple function, so I will walk through it quickly as I’m trying to avoid  doing any actual work at least till my second cup of coffee!
As you can see the function relies on the nature of the pipeline – So if we do a PS | slowdown
each object sent down the pipeline from the PS to my slowdown function goes through the sequence

$_

The object is just dumped right away this means the output is the same out as it came in! Very important

Then all we do is Start-Sleep -seconds .6 – this creates the effect of it being slowed down. You can modify the -seconds of course to how you want it.

Then it processes the next object on the pipeline – Simple…

This is just a start, you could do some funky stuff like – Alternate the colours of the lines to make it easier to read. add some conditional code to highlight certain keywords or values.

Right better get doing some actual work – got a paycheck to earn!

Hazzy

Leave a Reply

Your email address will not be published. Required fields are marked *