Showing archive results for June 2016

Jun 23, 2016
Post comments count0
Post likes count0

PowerTip: Set the color of the progress bar with PowerShell

Doctor Scripto

Summary: Use the $Host object to alter the color of the progress bar in PowerShell. I was curious if there’s a way to change the color of the progress bar in PowerShell. Do you know how this could be done? Glad you asked! You can do this by altering the values for ProgressBackGroundColor and ProgressForegroundColor under $Host.PrivateData. To ch...

Windows PowerShellPowerTipguest blogger
Jun 23, 2016
Post comments count0
Post likes count0

Build a hexadecimal clock in PowerShell – Part 4

Doctor Scripto

Summary: Use PowerShell to navigate the neutral zone. Honorary Scripting Guy, Sean Kearney, is here today to continue forth (not COBOL nor even Visual BASIC) into our silly yet fun quest to build a hexadecimal clock by using the PowerShell console. It does seem silly, doesn’t it? Yet, consider some of the things that we’ve learned in PowerShell d...

Windows PowerShellguest bloggerSean Kearney
Jun 22, 2016
Post comments count0
Post likes count0

PowerTip: Set a default value in a switch statement

Doctor Scripto

Summary: Use the default field in switch statement to have an assumed value. I was playing with Select-String and would like to have it default to a value if none was trapped for. How can I do that? Just use the Default keyword, and you can have an assumed value in the script block. In the following example, the switch is listening for the $DogS...

Windows PowerShellPowerTipguest blogger
Jun 22, 2016
Post comments count0
Post likes count0

Build a hexadecimal clock in PowerShell – Part 3

Doctor Scripto

Summary: Use Select-String in PowerShell to identify data and match it to an array. Honorary Scripting Guy, Sean Kearney, is here today to play more with our funky, nerdy, cool hexadecimal clock. Yesterday we built out a small function named Get-HexTime to give us the current time that displays hex digits instead of decimal for hours, minutes, an...

Windows PowerShellguest bloggerSean Kearney
Jun 21, 2016
Post comments count1
Post likes count0

PowerTip: Use PowerShell to identify a leap year

Doctor Scripto

Summary: Use PowerShell and Math to identify a leap year. Is there a way to use PowerShell to identify whether this year is a leap year? Actually there is! You can use a combination of Get-date to find out the year and the Modulus function in PowerShell. If the value is zero, the current year is a leap year!

Windows PowerShellPowerTipguest blogger