In this Azure tutorial, we will discuss how to fix the error New-AzResourceGroup: A positional parameter cannot be found that accepts argument. which I got while trying to create an Azure Resource Group in the Azure Portal using PowerShell ISE.
- The term ‘New-AzResourceGroup’ is not recognized as the name of a cmdlet
- The ‘Get-AzResourceGroup’ command was found in the module ‘Az.Resources’
- How to create and add members to Azure Active Directory Group
Table of Contents
New-AzResourceGroup: A positional parameter cannot be found that accepts argument
Well, Recently while trying to create a Resource Group using the PowerShell script, I got the error A positional parameter cannot be found that accepts argument. The PowerShell Script that I was running was as below
Connect-AzureRmAccount
$ResourceGroupName = "Demo123"
$location = "EastUS"
New-AzureRmResourceGroup - Name $ResourceGroupName - Location $location
After executing the above script, I got the error New-AzResourceGroup: A positional parameter cannot be found that accepts argument. You can see the same as below

The complete error message was as below
New-AzResourceGroup: A positional parameter cannot be found that accepts argument
‘Demo123’.
At line:4 char:1
- New-AzureRmResourceGroup – Name $ResourceGroupName – Location $locati …
~~~~~~~~~~~~~~~~~- CategoryInfo : InvalidArgument: (:) [New-AzResourceGroup], ParameterBi
ndingException - FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.Azure.Commands.Re
sourceManager.Cmdlets.Implementation.NewAzureResourceGroupCmdlet
- CategoryInfo : InvalidArgument: (:) [New-AzResourceGroup], ParameterBi
Reason For The Issue
The reason for this issue is a silly mistake. If you will see bit closely, By mistake, there is one space I put in between the Name and “-” character and the same way there is one more space between the Location and the “-” character.
This was the reason for the error. I have highlighted the mistake as below. I know this is a silly mistake and can happen sometimes in hurry.

New-AzResourceGroup: A positional parameter cannot be found that accepts argument [Solved]
Now To fix the issue and to create the Azure Resource Group successfully, Follow the below steps
Open the Windows PowerShell or PowerShell ISE as Run as Administrator mode.

Now Run the below Script to Create the Resource Group in Azure Successfully
Note: Make sure not to put any space between the hyphen(-) and the Name parameter and the same way Don’t put any space between the hyphen(-) and Location parameter.
Connect-AzureRmAccount
$ResourceGroupName = "Demo123"
$location = "EastUS"
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $location
Once you will execute the script, it will prompt you to enter your Azure Credential. Enter the Azure Credential and then click on the Sign-in button.
Now you can able to see our Azure Resource Group in Azure is created successfully with out any issue.

This is how we can able to fix the issue New-AzResourceGroup: A positional parameter cannot be found that accepts argument
A Positional Parameter Cannot Be Found [Solved]
While working with PowerShell cmdlet, there is a chance you will get the error “A positional parameter cannot be found that accepts argument”. Below are the reasons that you have to concentrate to avoid this error
- For instance, say you are using the -Path with your PowerShell cmdlet, then make sure there is no space between the “-” and the parameter “Path”. If there will be space then you will get the error “A positional parameter cannot be found that accepts argument”.
- Sometimes, If you have any parameters with space then make sure to put the parameter with double-quotes. For example, if it is Hello Test then you should keep like “Hello Test”.
- Make sure to use the operator as “-“(Hyphen) not the “_”(Underscore).
- If any of your parameters contain the underscore then put the complete parameter with “double-quotes“. For example, say your parameter is Hello_Test_Test then you can specify like “Hello_Test_Test”.
You may also like following the below articles
- The term ‘Uninstall-AzModule’ is not recognized as the name of a cmdlet
- No match was found for the specified search criteria and module names ‘AzTable’
- The ‘New-AzResourceGroup’ command was found in the module ‘Az.Resources’
- CS1061 C# ‘HttpRequest’ does not contain a definition for ‘Content’ and no accessible extension method ‘Content’ accepting a first argument of type ‘HttpRequest’ could be found
- The term ‘Select-AzureSubscription’ is not recognized as the name of a cmdlet
Wrapping Up
Well, in this article, we discussed how to fix the PowerShell error New-AzResourceGroup: A positional parameter cannot be found that accepts argument, PowerShell a positional parameter cannot be found that accepts argument, error: A positional parameter cannot be found that accepts argument. Hope it will help you to fix your issue as well !!!