How to Get Day of Month in PowerShell?

PowerShell Get Last Day of Month

One of my team members required me to get the first day of the month using PowerShell. It is easy to do this. In this tutorial, I will explain how to get the day of the month in PowerShell, like getting the last day of the month, using PowerShell with complete scripts and examples. PowerShell … Read more

PowerShell Get Day of Week

powershell get day of week

Recently, I got a requirement to get the day of the week in PowerShell. In this tutorial, I will explain how to get the day of the week using PowerShell with examples. To get the current day of the week in PowerShell, you can use the Get-Date cmdlet followed by accessing the DayOfWeek property. Simply … Read more

How to Add Months to Date in PowerShell?

powershell date add months

Someone recently tried to add months to the current date in PowerShell. In this tutorial, I will explain how to add months to date in PowerShell with examples. To add months to a date in PowerShell, you can use the AddMonths method of the DateTime object. For example, to schedule a follow-up meeting three months … Read more

PowerShell Date Comparison [With Examples]

powershell date comparison

Recently, I worked on a PowerShell script that required date comparisons. In this tutorial, I will explain how to compare dates in PowerShell with examples. To compare dates in PowerShell, you can use the DateTime object along with comparison operators such as -eq (equal), -ne (not equal), -lt (less than), -le (less than or equal), … Read more

How to Sort Files by Date in PowerShell?

powershell sort files by date

Recently, someone asked me about sorting files by date in PowerShell. In this tutorial, I will show you how to sort files by date in PowerShell using different methods with examples. To sort files by date in PowerShell, you can use the Get-ChildItem cmdlet combined with Sort-Object. For example, to sort files in the C:\Logs … Read more

How to Get Yesterday’s Date in PowerShell

powershell get yesterday date

One of my team members was recently required to get yesterday’s date in PowerShell. There are different methods to achieve this. In this tutorial, I will explain how to get Yesterday’s date in PowerShell with examples. To get yesterday’s date in PowerShell, you can use the Get-Date cmdlet combined with the AddDays() method. Simply run … Read more

PowerShell Get-Date Format ISO 8601

powershell get-date format iso 8601

If you’re working with dates and times in PowerShell, you might need to format them according to the ISO 8601 standard. This format is widely used and recognized, making it essential for data exchange and logging. In this tutorial, I will explain the syntax and examples of using the Get-Date cmdlet to format dates in … Read more

PowerShell Get-Date UTC

powershell get-date utc

Recently, one of my team members was trying to get today’s time in UTC format. I suggested the right approaches. In this tutorial, I will explain how to use Get-Date with UTC in PowerShell. To get the current date and time in UTC using PowerShell, you can utilize the Get-Date cmdlet with the -AsUTC parameter. … Read more

How to Compare Dates Without Time in PowerShell?

powershell compare dates without time

Recently, one of my team members was working with dates in PowerShell and needed to compare them without considering the time component. In this tutorial, I will explain different methods for comparing dates in PowerShell without the time component. To compare dates without considering the time in PowerShell, you can use the Get-Date cmdlet combined … Read more

100 PowerShell cmdlets download free

100 POWERSHELL CMDLETS E-BOOK

FREE Download an eBook that contains 100 PowerShell cmdlets with complete script and examples.