Browse by Tags

Tagged Content List
  • Blog Post: Rounding Numbers—PowerShell Style

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to round numbers. Hey, Scripting Guy! I think your series about formatting numbers has been pretty interesting. However, everything you have shown has a major problem—and that is that you convert numbers into...
  • Blog Post: PowerTip: Round a Number with PowerShell

    Summary : Use Windows PowerShell to round numbers to a specific decimal place. How can I use Windows PowerShell to round a number to a specific number of decimal places, and continue to have a number instead of converting it to a string. Use the Round static method from the System.Math class. By...
  • Blog Post: PowerTip: Express Percentage in PowerShell

    Summary : Learn an easy method to express a percentage in Windows PowerShell. How can I use Windows PowerShell to express a two-decimal place percentage? For example, I have multiple calculations in a Windows PowerShell script, and I am tired of always dividing two numbers, multiplying by a hundred...
  • Blog Post: Using PowerShell and Standard Number Formats

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using standard number formats. Hey, Scripting Guy! I love using Windows PowerShell. I use it for everything. My problem is that it does not do everything automatically. For example, I use the Get-Volume cmdlet a lot to check on disk space,...
  • Blog Post: Formatting PowerShell Decimal Places

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using strings to format the display of decimal places in Windows PowerShell. Hey, Scripting Guy! One of the things I have a problem with is when I get numbers that have a lot of decimal places. I mean, how do I really get rid of them—at...
  • Blog Post: PowerTip: Format Decimal Numbers in PowerShell

    Summary : Learn how to display a specific number of decimal points in Windows PowerShell. How can I use Windows PowerShell to display only one decimal place on a number that currently has two? Use a custom number format string with the ToString method from the number, for example: PS C:\>...
  • Blog Post: Working with Fixed Number Sizes in PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about working with fixed number sizes in Windows PowerShell. Hey, Scripting Guy! I have a script that returns a specific type of number, so I added a type constraint on the variable that holds the number. The problem is that sometimes when I run...
  • Blog Post: PowerTip: Use Parentheses to Override Operator Precedence

    Summary : Use parentheses to override operator precedence in Windows PowerShell. How can I ensure that a math expression that keeps returning incorrect information will work properly in Windows PowerShell? In Windows PowerShell (as in other languages), math operators have a precedence. Therefore...
  • Blog Post: Understanding Numbers in PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about numbers in Windows PowerShell. Hey, Scripting Guy! One of the things that is frustrating to me with Windows PowerShell is the way that it handles numbers. For example, I want to know the percent of processor utilization for something, and it...
  • Blog Post: PowerTip: Round Number Up or Down with PowerShell

    Summary : Easily use Windows PowerShell to round a number up or down. I want only a whole number returned, so I want the number rounded up or down as appropriate. How can I do this with Windows PowerShell? Cast the number as an integer, and Windows PowerShell will round the number up or down as...
  • Blog Post: Weekend Scripter: The Changing Nature of Documentation

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about the changing nature of documentation. Microsoft Scripting Guy, Ed Wilson, is here. This week, we announced Microsoft HoloLens during the Windows 10: The Next Chapter webcast. I mean, I want one—badly. This is going to be an incredible...
  • Blog Post: Formatting Date Strings with PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about formatting date strings with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. It seems that different ways to display dates and times are in great supply. In fact, there are dozens of ways to do this. If I decide that I do not...
  • Blog Post: Weekend Scripter: The Best Ways to Learn PowerShell

    Summary : PowerShell MVP, Teresa Wilson, talks about the best ways to learn Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Today we have a guest post by Windows PowerShell MVP, Teresa Wilson, aka The Scripting Wife. I asked her to talk a little bit about how one goes about learning...
  • Blog Post: Weekend Scripter: Why Should I Learn PowerShell?

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about why you should learn Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. The other day, I ran into an IT pro at the mall. He recognized me and started talking to me. It was like, dude, I was trapped. It turned out that he was cool...
  • Blog Post: What Is PowerShell?

    Summary : Microsoft Scripting Guy, Ed Wilson, explains Windows PowerShell. Hey, Scripting Guy! I keep hearing this term...all over...everywhere. But I do not know what it is. Can you tell me, "What is Windows PowerShell?" —DB Hello DB, Microsoft Scripting Guy, Ed Wilson, is...
  • Blog Post: Weekend Scripter: Playing with PowerShell Prompt

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about playing with the Windows PowerShell prompt. Microsoft Scripting Guy, Ed Wilson, is here. It is time to round up all of those end-of-the-year kinds of things. This is, in fact, the last weekend Hey, Scripting Guy! Blog post of 2014. Not sure...
  • Blog Post: Weekend Scripter: Exploring IP Address Functions

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell with TCP/IP. Microsoft Scripting Guy, Ed Wilson, is here. This morning, I decided to make a cup of orange spice tea. I did not even do it manually. I used a tea bag. I know, I know, I know. But hey, sometimes I like...
  • Blog Post: Access Objects Inside Other Objects in PowerShell Pipeline

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about accessing objects inside other objects in the Windows PowerShell pipeline. Hey, Scripting Guy! Yesterday in Create Custom PowerShell Objects , you talked about writing a script to access embedded objects. That seems like a lot of trouble. Is...
  • Blog Post: Create Custom PowerShell Objects

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about creating custom objects via Windows PowerShell. Hey, Scripting Guy! Yesterday in Understand Embedded Objects in PowerShell , you said the easy way to expand a Windows PowerShell object was to use the –ExpandProperty parameter from the...
  • Blog Post: Understand Embedded Objects in PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about understanding embedded objects in Windows PowerShell. Hey, Scripting Guy! I don’t get it. Some things in Windows PowerShell are so easy, and others are so complicated. It seems to go from ridiculously easy to ridiculously hard all at...
  • Blog Post: Use PowerShell to Find Hotfixes Installed in Time Range

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to find hotfixes that were installed during a certain time range. Hey, Scripting Guy! I have a problem at work. It seems there was a hotfix that was installed in the last couple of months that is causing problems...
  • Blog Post: Pre- and Post-Incrementing Do...While Loop in PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about pre- and post-incrementing the Do...While loop in Windows PowerShell. Hey, Scripting Guy! I think that I found a bug in Windows PowerShell. In fact, I am pretty sure that I have. It involves using the ++ increment operator. For example, I know...
  • Blog Post: More Comments about PowerShell Commenting

    Summary : Microsoft Scripting Guy, Ed Wilson, continues the discussion about Windows PowerShell comments. Microsoft Scripting Guy, Ed Wilson, is here. This morning, I was up early because I had to take the Scripting Wife to the airport. Luckily, it was really early, so Charlotte’s world class...
  • Blog Post: Top Four Suggestions for Effective PowerShell Comments

    Summary : Microsoft Scripting Guy, Ed Wilson, lists his top four ideas to include in comments in Windows PowerShell scripts. Microsoft Scripting Guy, Ed Wilson, is here. It is a new week. This one is filled with potential for unlimited new explorations, beginnings of wonderful friendships, and delving...
  • Blog Post: Six Comments about PowerShell Commenting

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about adding comments to Windows PowerShell scripts. Microsoft Scripting Guy, Ed Wilson, is here. This morning brings another cool fall day in Charlotte, North Carolina. I am sipping a cup of English Breakfast tea with a cinnamon stick and a bit...