简体   繁体   English

Update-AzADApplication:找不到接受参数 $True 的位置参数 - Azure Az Powershell 模块

[英]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.

相关问题 Powershell Az 在接受数组参数的计划中创建 Azure 策略 - Powershell Az to create Azure Policy in an Initiative That Accepts An Array Parameters Azure Powershell (Az模块) 公开IP地址 - Azure Powershell (Az module) get public IP address Az Powershell 模块 - 显示“找不到名为 xxx 的存储帐户”但它存在 - Az Powershell Module - says "Cannot find storage account with name xxx" but it exists 预期 2 个位置参数,但找到 0 个。 Flutter - 2 positional argument(s) expected, but 0 found. Flutter 无法在 PowerShell 7.3.x 中安装“Az”模块 - Can't Install `Az` module in PowerShell 7.3.x 使用托管标识从 Azure Runbook 运行 Get-AzADApplication - Run Get-AzADApplication from an Azure Runbook using a Managed Identity 找不到模块 python Azure function - module not found python Azure function 从 ADF Webhook 活动调用 Azure Automation Runbook - 失败并显示“无法将参数绑定到参数‘InputObject’,因为它是 null。” - Calling Azure Automation runbook from ADF Webhook activity - Fails with "Cannot bind argument to parameter 'InputObject' because it is null." AZ 命令获取 Azure 监控日志 - AZ command to fetch Azure Monitor logs Azure DevOps REST API PowerShell 脚本中的顶部参数不起作用 - Azure DevOps REST API top parameter in PowerShell script is not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM