Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

PowerTip: Change PowerShell ISE Foreground Color

Summary: Programatically change the foreground color in the Windows PowerShell ISE.(image)  How can I change the foreground color in the Windows PowerShell ISE?(image)  Use $Host.UI.RawUI.ForegroundColor and assign a new color. For example, to change it to cyan, use:$Host.UI.RawUI.ForegroundColor = 'cyan'(image...

Change Display Output Colors in PowerShell ISE

Summary: Ed Wilson, Microsoft Scripting Guy, talks about changing the output console colors in the Windows PowerShell ISE.Microsoft Scripting Guy, Ed Wilson, is here. One of the things I like about using the Write-Host cmdlet is that I can change the color of a line that writes to the Windows PowerShell console. But, what if I want to change ...

PowerTip: Find if Variable Is Array

Summary: Use Windows PowerShell to find if a variable is an array. (image)  How can I use Windows PowerShell to find if a variable contains an array? (image)  Use the –is operator, and test to see if it is a type of [array], for example: $a = 1,2,4,5,6,7 $a -is [array] (image...

Don’t Script: Create PowerShell Snippets

Summary: Microsoft Scripting Guy, Ed Wilson, talks about creating custom Windows PowerShell snippets. (image)  Hey, Scripting Guy! Thank you for yesterday's blog post, Don’t Write Scripts: Use Snippets. I like the idea of having access to Windows PowerShell script snippets. But I used to create my own snippets. It made it easier for me to ...