Scripting Blog

A place to learn about PowerShell and share stories of automation

PowerTip: Easily Send Output to Both the PowerShell Console and a Variable

Summary: Learn how to send output to both the Windows PowerShell console and to a variable.  How can I easily send Windows PowerShell output to both the console and to a variable?  Use the Tee-Object cmdlet and specify a variable name, as shown here. PS C:\> gps | select name -Last 1 | Tee-Object -Variable a Name...

Weekend Scripter: Creating a Sample Log File by Using PowerShell

Summary: Microsoft Scripting Guy, Ed Wilson, shows how to create sample textual log output by using Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Well, it is the weekend. It seems like it has been a rather long week, but I guess in reality it was no longer than any other week. I did get a cool book that finally showed up by ...

PowerTip: Find Dynamic Parameters for Certain PowerShell Providers

Summary: Learn how to find out about dynamic parameters for certain Windows PowerShell providers.  How can I easily find out about parameters that are added to cmdlets when they are used with a specific Windows PowerShell provider?  Use the Get-Help cmdlet and look for the Help topic related to the provider. Near the ...

Use PowerShell to Find Installed Video Codecs on Windows 8

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to find installed video codecs on Windows 8.  Hey, Scripting Guy! Dude, I am in trouble. Big time! Last week, I installed Windows 8 on the laptops used by all our department heads and front-line supervisors. I thought the responsiveness and the ...

PowerTip: Count the Number of Commands Exposed by Imported Modules

Summary: Learn how to count the number of commands exposed by imported Windows PowerShell modules.  I want to know how many commands are available through the modules I have imported into my current Windows PowerShell session. How can I do this?  Use the Get-Module cmdlet and pipe the results to the Foreach-Object...

Feedback usabilla icon