If you’re working with dates in PowerShell, you might need to get the first day of the next month. As a PowerShell developer, you might meet this requirement. In this tutorial, explain several methods to get the first day of the next month using PowerShell with examples.
To get the first day of the next month in PowerShell, you can use the Get-Date cmdlet combined with the .AddMonths(1) method. First, calculate the current date plus one month using $nextMonth = (Get-Date).AddMonths(1), then create a new date object for the first day of that month with $firstDayNextMonth = Get-Date -Year $nextMonth.Year -Month $nextMonth.Month -Day 1. This will give you the first day of the next month efficiently.
The basic syntax to get the first day of the next month in PowerShell involves using the Get-Date cmdlet combined with the .AddMonths() method. Here’s a simple script:
$nextMonth = (Get-Date).AddMonths(1)
$firstDayNextMonth = Get-Date -Year $nextMonth.Year -Month $nextMonth.Month -Day 1In this snippet, we first calculate the current date plus one month using .AddMonths(1). Then, we construct a new date object representing the first day of that month.
Now, let me show you three methods to achieve this.
Method 1: Using Get-Date and AddMonths
In PowerShell, you can use the AddMonths() method with Get-Date to get the first day of the next month.
Let me show you an example.
Example
$nextMonth = (Get-Date).AddMonths(1)
$firstDayNextMonth = Get-Date -Year $nextMonth.Year -Month $nextMonth.Month -Day 1
Write-Output $firstDayNextMonthIn this example, we first get the current date and add one month to it. Then, we create a new date object for the first day of the calculated month.
I executed the above PowerShell script, and you can see the exact output in the screenshot below:

Check out Get Day of Month in PowerShell
Method 2: Custom Function
You can also create a custom function and reuse it in PowerShell.
Example
function Get-FirstDayOfNextMonth {
$nextMonth = (Get-Date).AddMonths(1)
return Get-Date -Year $nextMonth.Year -Month $nextMonth.Month -Day 1
}
$firstDay = Get-FirstDayOfNextMonth
Write-Output $firstDayHere, we define a function Get-FirstDayOfNextMonth that encapsulates the logic for calculating the first day of the next month. This function can be called whenever needed.
Here is the exact output in the screenshot below:

Read Get the Last Business Day of the Month Using PowerShell
Method 3: Using DateTime Object
Another approach to get the first day of the next month involves directly working with .NET DateTime objects.
Here is an example.
Example
$today = [datetime]::Now
$nextMonth = $today.AddMonths(1)
$firstDayNextMonth = New-Object datetime ($nextMonth.Year, $nextMonth.Month, 1)
Write-Output $firstDayNextMonthIn this method, we use the [datetime]::Now to get the current date and time, add one month, and then create a new DateTime object for the first day of the next month.
After executing the PowerShell script, the output is in the screenshot below.

Conclusion
In this tutorial, I explained how to calculate the first day of the next month in PowerShell using the Get-Date cmdlet with AddMonths() method. If you still have any questions, leave a comment below.
You may also like the following tutorials:
- PowerShell Get Day of Week
- Add Months to Date in PowerShell
- Get the Last Friday of the Month Using PowerShell
- PowerShell: Get the Last Day of the Previous Month
Bijay Kumar is an esteemed author and the mind behind PowerShellFAQs.com, where he shares his extensive knowledge and expertise in PowerShell, with a particular focus on SharePoint projects. Recognized for his contributions to the tech community, Bijay has been honored with the prestigious Microsoft MVP award. With over 15 years of experience in the software industry, he has a rich professional background, having worked with industry giants such as HP and TCS. His insights and guidance have made him a respected figure in the world of software development and administration. Read more.