Scripting Blog [archived]

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

PowerTip: Specify that a script requires admin privileges to run

Summary: Learn how to require admin privileges to run a Windows PowerShell script. (image) ย How can I make sure that my Windows PowerShell script has administrator privileges to run? (image) ย Use the #Requires directive and specify RunAsAdministrator. Here is an example: (image...

How to answer a technical question: A guide for presenters

Summary: Learn how to properly answer a technical question in a presentation in this step-by-step post by PowerShell MVP June Blender. Today we have another blog post by PowerShell MVP June Blender. June is an Honorary Scripting Guy and a technical evangelist for the SAPIENย Technologies, Inc. She has been working with PowerShell for a long ...

Use a script block to create custom groupings in PowerShell

Summary: Learn how to use a script block with the Group-Object cmdlet in Windows PowerShell to create custom groupings in this article by Microsoft Scripting Guy Ed Wilson. Good morning. Ed Wilson the Microsoft Scripting Guy is here. This week, I have been hanging out with a group of writers. It has been both fun and educational. It is always...

PowerTip: Use PowerShell to display a percentage that has two decimal places

Summary:ย Use Windows PowerShell to display a percentage as a two place number. (image) ย How can I use Windows PowerShell to display a number as a percentage that has two decimal places? (image) ย Use the -f format specifier, and specify a pattern as โ€œ{0:p2}โ€. On the other side of the -f format specifier, perform your percentage ...