In this tutorial, I will explain how to fix an error “missing argument in parameter list“. The exact error comes as “Missing an argument for parameter ‘Year.’ Specify a parameter of type ‘System.Int32’ and try again.” which appears in the Visual Studio Code.
Missing argument in parameter list error in PowerShell
As per my requirement, I was trying to get the current Year from a specific date using the Visual Studio Code. To retrieve the current year from date, I have put the below visual studio code as:
Write-Host (Get-Date -Year)
While I was running this above Visual Studio Code to get the current year from date, then an error occurred:
“Missing an argument for parameter ‘Year’. Specify a parameter of type ‘System.Int32’ and try again.”
You can see the exact error in the below screenshot.

When I searched the solution for this error, I got something simple code as in the screenshot below. Just put this below Visual Studio Code and Run with the PowerShell ISE.
((Get-Date).year)
Once you run the PowerShell in Visual Studio Code, you can see the current year in the Terminal section below.

Hence, in this PowerShell tutorial, We resolved the issue of a PowerShell error as “Missing an argument for parameter ‘Year’. Specify a parameter of type ‘System.Int32’ and try again.” which is appearing in the Visual Studio Code.
You may also like:
- the term ‘get-spweb’ is not recognized as the name of a cmdlet
- get-msoluser not recognized
- connect-msolservice not recognized
- Exception calling ExecuteQuery with 0 argument(s): Unable to connect to the remote server error in PowerShell SharePoint Online

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.