Last active
June 4, 2020 14:24
-
-
Save ThePSAdmin/b5fbe87503dda843f5855b0f5de5c62b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((((99..1)+'no more')|%{}{$y,$a=" on the wall"," bottle$(,'s'[$_-eq1]) of beer" | |
"Take one down and pass it around, $_$a$y.`n" | |
"$_$a$y, $_$a."-replace'^n',"N"}{"Go to the store and buy some more, 99$a$y."})[1..200])|write-host |
That's clever! You took mine down below 250 as well!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice! You can shorten the code somewhat by using -Begin -Process -End params of foreach-object positionally and assigning vars on the same line: