Scripting Blog

A place to learn about PowerShell and share stories of automation

PowerTip: Specify that a script requires admin privileges to run

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

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...

Discover relationships by using Group-Object in PowerShell

Summary: Learn how to use one of the most basic Windows PowerShell cmdlets, the Group-Object cmdlet, to see relationships among different objects. There are some things in life that just seem to always go together: jasmine flowers and green tea, scones and English breakfast tea, or even peanut butter and apples. In the world of Windows ...

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.  How can I use Windows PowerShell to display a number as a percentage that has two decimal places?  Use the -f format specifier, and specify a pattern as “{0:p2}”. On the other side of the -f format specifier, perform your percentage calculation. Here is an ...