Browse by Tags

Tagged Content List
  • 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: 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: 2014 Honorary Scripting Guys Announced

    Summary : The Honorary Scripting Guys for 2014 are announced. Microsoft Scripting Guy, Ed Wilson, is here. I have been pretty busy, with missing work because of my ear surgery and the holidays and all, so I enlisted the help of the Scripting Wife, Teresa, to write the latest Honorary Scripting Guys...
  • Blog Post: PowerTip: Windows PowerShell Survival Guide

    Summary : Find the Windows PowerShell Survival Guide. Where can I find a community-based resource that links to all the essentials? Check out the Windows PowerShell Survival Guide on the TechNet Wiki. It contains links to dozens of Windows PowerShell resources.
  • 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: PowerTip: View PowerShell Help Online

    Summary : View Windows PowerShell cmdlet Help online. How can I view Windows PowerShell Help in my web browser? The –Online parameter with the Get-Help cmdlet opens the latest online Windows PowerShell Help in your web browser, for example: Get-Help Get-Command -Online
  • Blog Post: Create Custom Date Formats with PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about creating custom date formats with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. One of the cool things about working with Windows PowerShell is that it is highly configurable. In short, if there is something that I do not...
  • Blog Post: PowerTip: Pipe String to Get-Date

    Summary : Pipe a string to the Windows PowerShell Get-Date cmdlet to convert it to a DateTime object. How can I use Windows PowerShell to convert a date that is in a string format to a DateTime object? Create a pipeline, for example: "11/14/2015" | get-date
  • Blog Post: PowerTip: Use PowerShell to Work with Active Directory Date Fields

    Summary : Use Windows PowerShell to work with Active Directory date fields. How can I Use Windows PowerShell to work with date fields in Active Directory? Try the following techniques: # Password last set within the last 30 days? $pwdLastSet = Get-ADUser Administrator -Properties pwdLastSet...
  • Blog Post: PowerTip: Use PowerShell to Find if User Is Nested Group Member

    Summary : U se Windows PowerShell to find if a user is a nested member of a particular group. How can I use Windows PowerShell to quickly find if a user is a nested member of a particular group, for example, Domain Admins? Use the -RecursiveMatch LDAP filter operator: Get-ADUser -Filter 'memberOf...
  • Blog Post: Active Directory Week: Stale Object Cleanup Guidance—Part 2

    Summary : Scripting tips for cleaning up stale Active Directory accounts. Microsoft Scripting Guy, Ed Wilson, is here. Today we continue our series about Active Directory PowerShell by Ashley McGlone. Before you begin, you might enjoy reading these posts from the series: Get Started with Active...
  • Blog Post: PowerTip: Use PowerShell to Get List of FSMO Role Holders

    Summary : Use Windows PowerShell to get a list of FSMO role holders in Active Directory. I use NETDOM QUERY FSMO to list my domain controllers that hold the FSMO roles, but can I do it with Windows PowerShell? As usual, there is more than one way to do most things in Windows PowerShell, but here...
  • Blog Post: PowerTip: Use PowerShell to Get Inactive Active Directory Accounts

    Summary : U se Windows PowerShell to get a report of inactive Active Directory accounts. How can I use Windows PowerShell to get a report of inactive Active Directory accounts? The Search-ADAccount cmdlet has a number of parameters and switches to help identify stale accounts: ...
  • 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: PowerTip: Use PowerShell to Display date Format for Specific Culture

    Summary : Learn how to use Windows PowerShell to display date formatting for a specific culture. How can I use Windows PowerShell to see the short date pattern for a specific culture without changing my UI culture settings? Use the CultureInfo class from System.Globalization, call the GetCultureInfo...
  • Blog Post: Adding and Subtracting Dates with PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about adding and subtracting dates with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. One of the things I really like about Windows PowerShell is the way it simplifies adding and subtracting from dates. For example, if I want to...
  • Blog Post: PowerTip: Use PowerShell to Display Format for Short Date

    Summary : Use Windows PowerShell to display the culture-specific format for a short date. How can I use Windows PowerShell to display the format of a short date that is specific to the culture settings of my system? Use the Get-Culture cmdlet and select the DateTimeFormat and ShortDatePattern properties...
  • Blog Post: Use PowerShell to Work with Individual Dates

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to work with dates. Microsoft Scripting Guy, Ed Wilson, is here. I don’t know about you, but one thing about my life as the Scripting Guy is that it keeps me busy. "Keeping busy" is a slang expression...
  • Blog Post: PowerTip: Use PowerShell to Find Day of Week

    Summary : Learn how to use Windows PowerShell to find the day of the week. How can I use Windows PowerShell to find which day of the week a specific date will occur? Use the Get-Date cmdlet, and specify day, month, and year parameters, for example: Get-Date -Month 2 -Day 14 -Year 2015
  • Blog Post: Working with Dates in PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about the fundamentals of working with dates in Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. For as long as I can remember, I have pretty much always hated working with dates and times. Back on my Osborne One, it was no fun. The...
  • Blog Post: PowerTip: Use PowerShell to Show Time

    Summary : Use Windows PowerShell to show the current time. How can I use Windows PowerShell to easily display only the current time? Use the Get-Date cmdlet and choose the Time display hint: Get-Date -DisplayHint Time
  • Blog Post: Weekend Scripter: Use PowerShell to Remotely Create Scheduled Task and Folder

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to remotely create a scheduled task and folder. Microsoft Scripting Guy, Ed Wilson, is here. On Friday in Use PowerShell to Create Scheduled Task in New Folder , I created a pretty long Windows PowerShell script that...