Showing category results for Windows PowerShell

Jun 24, 2016
Post comments count0
Post likes count0

PowerTip: Remove trailing space from a string by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the trim() method to remove leading and trailing spaces from a string. Could you do me a huge favor and show me how to get rid of spaces before and after a string in PowerShell? No problem at all. All you need to do is apply the trim() method to remove all the output. You can also use trimstart() to remove the start or trimend() to ...

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

Build a hexadecimal clock in PowerShell – Part 5

Doctor Scripto
Doctor Scripto

Summary: Learn to split data in a Here-String and get a console beep. Honorary Scripting Guy, Sean Kearney, is here with our final day this week to wrap up building a hexadecimal clock in PowerShell. When we finished yesterday, we ran across a snag in our output. Most of our rows kept dropping to the immediate left of the screen as in the followi...

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

PowerTip: Set the color of the progress bar with PowerShell

Doctor Scripto
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
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
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