Friday Fun PowerShell PowerBall Numbers

Like many of you, I dream about hitting the lottery and retiring to live the good life. Unfortunately I rarely play so I guess my odds are winning are pretty slim. But for the latest installment of Friday Fun, I thought I would have PowerShell help me pick some numbers for PowerBall. It is not as easy as you might think and you might pick up a thing or two about objects, arrays and loops. Continue reading

Friday Fun Randomness Abounds

I find it a little ironic that although I like efficiency, structure and order I’m fascinated with randomness. In today’s Friday Fun I want to explore a few ways you might incorporate randomness into your PowerShell scripting. Perhaps you need a random number between 100 and 500. Or a string for file name. There are many paths so let’s (randomly) take this one. Continue reading

Friday Fun PowerShell Pep Talk

Today’s Friday Fun is meant to help get you excited about the upcoming Scripting Games. I want to add a little pep to your PowerShell prompt. Perhaps it will even keep you motivated. What I have for you today are variety of prompt functions. Consider them variations on a theme. Continue reading

Friday Fun: Color My World

The end of another work week and time for a little PowerShell fun. When I first started using PowerShell, I was fascinated by Write-Host and the ability to write colorized text to the console. Visions of ANSI art danced in my head, but I’ve moved on. Using colors with Write-Host is a great thing, and something I actually encourage. Because Write-Host doesn’t write to the pipeline, it can be confusing. My recommendation is to use Write-Output, or its alias Write, to send objects to the pipeline. Use Write-Host to display messages to the person running the script or function and colorize it so you can distinguish it from pipelined output. But what colors can I use? What do they look like? What about the combination for foreground and background colors? This week’s Friday Fun will help. Continue reading