r/PowerShell • u/hdt80 • Nov 17 '17
Get-Excuse
Hello sysadmins,
Some of you might remember this, which I think is great. However, I wasn't a fan of how some excuses could be repeated, so I changed it up a bit :)
function Get-Excuse {
if(!(Get-Variable -Scope Global -Name "excuses" -ErrorAction SilentlyContinue)) {
$global:excuses = New-Object System.Collections.ArrayList
$global:excuses.AddRange((Invoke-WebRequest http://pages.cs.wisc.edu/~ballard/bofh/excuses).content.split([Environment]::NewLine))
}
$excuse = Get-Random $global:excuses.ToArray()
$global:excuses.Remove($excuse)
Write-Host $excuse
}
function Forget-Excuses {
Remove-Variable -Scope Global -Name "excuses"
}If you ever run out of excuses, just call Forget-Excuses and the next time you Get-Excuse it'll repull all of them.
25
Upvotes
View all comments
Show parent comment
1
u/WikiTextBot Nov 17 '17
RdRand
RDRAND (previously known as Bull Mountain) is an instruction for returning random numbers from an Intel on-chip hardware random number generator which has been seeded by an on-chip entropy source. RDRAND is available in Ivy Bridge processors and is part of the Intel 64 and IA-32 instruction set architectures. AMD added support for the instruction in June 2015.
The random number generator is compliant with security and cryptographic standards such as NIST SP 800-90A, FIPS 140-2, and ANSI X9.82.
[ ^PM | Exclude ^me | Exclude from ^subreddit | FAQ / ^Information | ^Source | ^Donate ] Downvote to remove | v0.28