[英]Update-AzADApplication: A positional parameter cannot be found that accepts argument $True - Azure Az Powershell Module
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.我正在尝试更新 Azure 中我的 AD 应用程序注册的属性。根据文档,我可以使用 Update-AzADApplication 或 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更新-AzADApplication 尝试
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>
The -Oauth2RequirePostResponse
is a switch parameter so does not need a boolean value. -Oauth2RequirePostResponse
是一个开关参数,因此不需要 boolean 值。
Because of this, PowerShell assumes the $true
value you are attempting to pass is the next parameter.因此,PowerShell 假定您尝试传递的$true
值是下一个参数。
Remove $true
and it should work.删除$true
,它应该可以工作。
Update-AzADApplication -ApplicationId [my-app-guid] -Oauth2RequirePostResponse
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.