Popular Post Geoff Posted February 27, 2015 Popular Post Posted February 27, 2015 (edited) Here's a little power shell function to add into your error handling. function Get-Excuse { (Invoke-WebRequest http://pages.cs.wisc.edu/~ballard/bofh/excuses -Proxy 'http://proxy:port' -ProxyUseDefaultCredentials -OutVariable excuses).content.split([Environment]::NewLine)[(get-random $excuses.content.split([Environment]::NewLine).count)] } Output looks like this: PS H:\> Get-Excuse CPU needs recalibration PS H:\> Get-Excuse Electrons on a bender PS H:\> Get-Excuse system consumed all the paper for paging PS H:\> Get-Excuse user to computer ratio too high. PS H:\> Get-Excuse the xy axis in the trackball is coordinated with the summer solstice PS H:\> Get-Excuse Due to the CDA, we no longer have a root account. PS H:\> Get-Excuse runaway cat on system. Enjoy (you might need to muck about with the proxy parameters for Invoke-Webrequest or remove them entirely in some environments). Add it to your $Profile for extra fun times. Edited February 27, 2015 by Geoff 5
halbaradkenafin Posted February 27, 2015 Posted February 27, 2015 Saw this on Reddit yesterday and added it to my $Profile straight away, going to have some fun with it.
Geoff Posted February 27, 2015 Author Posted February 27, 2015 (edited) Yeah, that's where I found it. I had to fix it for using a proxy though. I'm also tinkering with a variation called 'Get-Pooh-Bother'. It doesn't work reliably yet due to the nature of the source web page. function Get-Pooh-Bother { (Invoke-WebRequest http://www.goofy.narod.ru/pooh/trash/18.html -OutVariable excuses).content.split([Environment]::NewLine)[(get-random $excuses.content.split([Environment]::NewLine).count)] } Here's the output (I've trimmed the blank lines). PS H:\> Get-Pooh-Bother "Bother!" said Pooh, as he felt Vader's presence. PS H:\> Get-Pooh-Bother Bother, said Pooh, as he reached for the reset button. PS H:\> Get-Pooh-Bother Bother, said Pooh, as his starship disintegrated. PS H:\> Get-Pooh-Bother "Bother", Said Pooh, I need a sauce for piglet. PS H:\> Get-Pooh-Bother Bother, said Pooh, and called in an air strike. Edited February 27, 2015 by Geoff
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now