PowerTip: Use PowerShell to Display Number of Minutes in a Day

Summary: Use Windows PowerShell to display the number of minutes in a day.  How can I use Windows PowerShell to easily display how many minutes are in a day?  Create a timespan equal to one day, and then select the total minutes from it: (New-TimeSpan -Days 1).totalminutes


Optimize PowerShell Code?

Summary: Microsoft Scripting Guy, Ed Wilson, talks about optimizing Windows PowerShell code. Microsoft Scripting Guy, Ed Wilson, is here. I was looking at my Windows Phone this morning and I noticed that today is Friday the 13th. What seemed a bit strange to me is that I thought there was also a Friday the 13th…


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 like, I can change it. Most of…


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 like the way…


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: (Get-Culture).DateTimeFormat.ShortDatePattern


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 find users who haven’t logged in to…


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


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 that means, “Dude, you are swamped.”…


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


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 Atari did not…