I'm trying to update a property on my AD Application Registration in Azure. Per the documentation, I can either use Update-AzADApplication or Set-AzADApplication.
I've tried both. But all the combos below return the same error message:
A positional parameter cannot be found that accepts argument '$True'.
Update-AzADApplication Attempts
PS C:\Users\me> Update-AzADApplication -ApplicationId [my-app-guid] -Oauth2RequirePostResponse $True
Update-AzADApplication: A positional parameter cannot be found that accepts argument 'True'.
PS C:\Users\me> Update-AzADApplication -ApplicationId [my-app-guid] -Oauth2RequirePostResponse $true
Update-AzADApplication: A positional parameter cannot be found that accepts argument 'True'.
PS C:\Users\me> Update-AzADApplication -DisplayName widgets-app-AdApp -Oauth2RequirePostResponse $True
Update-AzADApplication: A positional parameter cannot be found that accepts argument 'True'.
PS C:\Users\me> Update-AzADApplication -DisplayName widgets-app-AdApp -Oauth2RequirePostResponse True
Update-AzADApplication: A positional parameter cannot be found that accepts argument 'True'.
PS C:\Users\me> Update-AzADApplication -DisplayName widgets-app-AdAppp -Oauth2RequirePostResponse true
Update-AzADApplication: A positional parameter cannot be found that accepts argument 'true'.
PS C:\Users\me> Update-AzADApplication -DisplayName widgets-app-AdApp -Oauth2RequirePostResponse $true
Update-AzADApplication: A positional parameter cannot be found that accepts argument 'True'.
I also tried this:
PS C:\Users\me> $mytest = $True;
PS C:\Users\me> $mytest
True
PS C:\Users\me> Update-AzADApplication -ApplicationId [my-app-guid] -Oauth2RequirePostResponse $mytest
Update-AzADApplication: A positional parameter cannot be found that accepts argument 'True'.
PS C:\Users\me>
CodePudding user response:
The -Oauth2RequirePostResponse
is a switch parameter so does not need a boolean value.
Because of this, PowerShell assumes the $true
value you are attempting to pass is the next parameter.
Remove $true
and it should work.
Update-AzADApplication -ApplicationId [my-app-guid] -Oauth2RequirePostResponse