From 9aafbb48ce765f0d3bf8718336444f1390248afb Mon Sep 17 00:00:00 2001 From: azure-powershell-bot <65331932+azure-powershell-bot@users.noreply.github.com> Date: Wed, 23 Feb 2022 12:17:39 +0000 Subject: [PATCH 1/2] Move Resources to release-2022-03-01 --- .../custom/New-AzADAppCredential.ps1 | 12 +- .../custom/New-AzADServicePrincipal.ps1 | 32 +--- .../custom/New-AzADSpCredential.ps1 | 12 +- .../MSGraph.Autorest/docs/Az.MSGraph.md | 2 +- .../docs/New-AzADServicePrincipal.md | 156 +--------------- .../exports/New-AzADServicePrincipal.ps1 | 28 +-- .../exports/ProxyCmdletDefinitions.ps1 | 28 +-- .../MSGraph.Autorest/generate-info.json | 10 +- .../MSGraph.Autorest/generated/api/MSGraph.cs | 100 +++++----- .../MicrosoftGraphKeyCredential.json.cs | 2 +- .../test/Application.Tests.ps1 | 33 +++- .../test/New-AzADServicePrincipal.Tests.ps1 | 26 +-- .../MSGraph.Autorest/test/msgraphtest2.cer | 24 +++ src/Resources/Resources/Az.Resources.psd1 | 8 +- src/Resources/Resources/help/Az.Resources.md | 8 + .../help/New-AzADServicePrincipal.md | 171 +----------------- 16 files changed, 170 insertions(+), 482 deletions(-) create mode 100644 src/Resources/MSGraph.Autorest/test/msgraphtest2.cer diff --git a/src/Resources/MSGraph.Autorest/custom/New-AzADAppCredential.ps1 b/src/Resources/MSGraph.Autorest/custom/New-AzADAppCredential.ps1 index a944fe0d4ab5..f78bfbb867ab 100644 --- a/src/Resources/MSGraph.Autorest/custom/New-AzADAppCredential.ps1 +++ b/src/Resources/MSGraph.Autorest/custom/New-AzADAppCredential.ps1 @@ -224,6 +224,9 @@ function New-AzADAppCredential { switch ($PSCmdlet.ParameterSetName) { { $_ -in 'ApplicationObjectIdWithPasswordParameterSet', 'ApplicationObjectIdWithKeyCredentialParameterSet', 'ApplicationObjectIdWithPasswordCredentialParameterSet', 'ApplicationObjectIdWithCertValueParameterSet'} { $id = $PSBoundParameters['ObjectId'] + if ($kc) { + $app = Get-AzADApplication -ObjectId $id + } $null = $PSBoundParameters.Remove('ObjectId') break } @@ -259,6 +262,9 @@ function New-AzADAppCredential { } { $_ -in 'ApplicationObjectWithPasswordParameterSet', 'ApplicationObjectWithKeyCredentialParameterSet', 'ApplicationObjectWithPasswordCredentialParameterSet', 'ApplicationObjectWithCertValueParameterSet'} { $id = $PSBoundParameters['ApplicationObject'].Id + if ($kc) { + $app = Get-AzADApplication -ObjectId $id + } $null = $PSBoundParameters.Remove('ApplicationObject') break } @@ -278,8 +284,12 @@ function New-AzADAppCredential { } } if ($kc) { + [System.Array]$kcList = $app.KeyCredentials $PSBoundParameters['Id'] = $id - $PSBoundParameters['KeyCredentials'] = $kc + foreach ($k in $kc) { + $kcList += $k + } + $PSBoundParameters['KeyCredentials'] = $kcList Az.MSGraph.internal\Update-AzADApplication @PSBoundParameters } } diff --git a/src/Resources/MSGraph.Autorest/custom/New-AzADServicePrincipal.ps1 b/src/Resources/MSGraph.Autorest/custom/New-AzADServicePrincipal.ps1 index b9eaf5adeff3..6b8d545cbc99 100644 --- a/src/Resources/MSGraph.Autorest/custom/New-AzADServicePrincipal.ps1 +++ b/src/Resources/MSGraph.Autorest/custom/New-AzADServicePrincipal.ps1 @@ -297,17 +297,11 @@ function New-AzADServicePrincipal { # Supports $filter (eq, ne, NOT, ge, le, in, startsWith), $search, and $orderBy. ${DisplayName}, - [Parameter(ParameterSetName = 'ApplicationObjectWithPasswordCredentialParameterSet', Mandatory, ValueFromPipeline, HelpMessage = "The application object, could be used as pipeline input.")] - [Parameter(ParameterSetName = 'ApplicationObjectWithKeyCredentialParameterSet', Mandatory, ValueFromPipeline, HelpMessage = "The application object, could be used as pipeline input.")] - [Parameter(ParameterSetName = 'ApplicationObjectWithPasswordPlainParameterSet', Mandatory, ValueFromPipeline, HelpMessage = "The application object, could be used as pipeline input.")] - [Parameter(ParameterSetName = 'ApplicationObjectWithKeyPlainParameterSet', Mandatory, ValueFromPipeline, HelpMessage = "The application object, could be used as pipeline input.")] + [Parameter(ParameterSetName = 'ApplicationObjectParameterSet', Mandatory, ValueFromPipeline, HelpMessage = "The application object, could be used as pipeline input.")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] ${ApplicationObject}, - [Parameter(ParameterSetName = 'ApplicationWithPasswordCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName = 'ApplicationWithKeyCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName = 'ApplicationWithKeyPlainParameterSet', Mandatory)] [Parameter(ParameterSetName = 'SimpleParameterSet')] [Alias('AppId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] @@ -341,33 +335,23 @@ function New-AzADServicePrincipal { # Not nullable. ${ReplyUrl}, - [Parameter(ParameterSetName = 'ApplicationWithKeyPlainParameterSet', Mandatory, HelpMessage = "The value of the 'asymmetric' credential type. It represents the base 64 encoded certificate.")] - [Parameter(ParameterSetName = 'ApplicationObjectWithKeyPlainParameterSet', Mandatory, HelpMessage = "The value of the 'asymmetric' credential type. It represents the base 64 encoded certificate.")] [Parameter(ParameterSetName = 'DisplayNameWithKeyPlainParameterSet', Mandatory, HelpMessage = "The value of the 'asymmetric' credential type. It represents the base 64 encoded certificate.")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] ${CertValue}, - [Parameter(ParameterSetName = 'ApplicationWithKeyPlainParameterSet', HelpMessage = "The effective start date of the credential usage. The default start date value is today. For an 'asymmetric' type credential, this must be set to on or after the date that the X509 certificate is valid from.")] - [Parameter(ParameterSetName = 'ApplicationObjectWithPasswordPlainParameterSet', HelpMessage = "The effective start date of the credential usage. The default start date value is today. For an 'asymmetric' type credential, this must be set to on or after the date that the X509 certificate is valid from.")] - [Parameter(ParameterSetName = 'ApplicationObjectWithKeyPlainParameterSet', HelpMessage = "The effective start date of the credential usage. The default start date value is today. For an 'asymmetric' type credential, this must be set to on or after the date that the X509 certificate is valid from.")] [Parameter(ParameterSetName = 'DisplayNameWithKeyPlainParameterSet', HelpMessage = "The effective start date of the credential usage. The default start date value is today. For an 'asymmetric' type credential, this must be set to on or after the date that the X509 certificate is valid from.")] [Parameter(ParameterSetName = 'SimpleParameterSet')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] ${StartDate}, - [Parameter(ParameterSetName = 'ApplicationWithKeyPlainParameterSet', HelpMessage = "The effective end date of the credential usage. The default end date value is one year from today. For an 'asymmetric' type credential, this must be set to on or before the date that the X509 certificate is valid.")] - [Parameter(ParameterSetName = 'ApplicationObjectWithPasswordPlainParameterSet', HelpMessage = "The effective end date of the credential usage. The default end date value is one year from today. For an 'asymmetric' type credential, this must be set to on or before the date that the X509 certificate is valid.")] - [Parameter(ParameterSetName = 'ApplicationObjectWithKeyPlainParameterSet', HelpMessage = "The effective end date of the credential usage. The default end date value is one year from today. For an 'asymmetric' type credential, this must be set to on or before the date that the X509 certificate is valid.")] [Parameter(ParameterSetName = 'DisplayNameWithKeyPlainParameterSet', HelpMessage = "The effective end date of the credential usage. The default end date value is one year from today. For an 'asymmetric' type credential, this must be set to on or before the date that the X509 certificate is valid.")] [Parameter(ParameterSetName = 'SimpleParameterSet', HelpMessage = "The effective end date of the credential usage. The default end date value is one year from today. For an 'asymmetric' type credential, this must be set to on or before the date that the X509 certificate is valid.")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] ${EndDate}, - [Parameter(ParameterSetName = 'ApplicationWithKeyCredentialParameterSet', Mandatory, HelpMessage = "key credentials associated with the service principal.")] - [Parameter(ParameterSetName = 'ApplicationObjectWithKeyCredentialParameterSet', Mandatory, HelpMessage = "key credentials associated with the service principal.")] [Parameter(ParameterSetName = 'DisplayNameWithKeyCredentialParameterSet', Mandatory, HelpMessage = "key credentials associated with the service principal.")] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] @@ -379,8 +363,6 @@ function New-AzADServicePrincipal { # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredential}, - [Parameter(ParameterSetName = 'ApplicationWithPasswordCredentialParameterSet', Mandatory, HelpMessage = "Password credentials associated with the service principal.")] - [Parameter(ParameterSetName = 'ApplicationObjectWithPasswordCredentialParameterSet', Mandatory, HelpMessage = "Password credentials associated with the service principal.")] [Parameter(ParameterSetName = 'DisplayNameWithPasswordCredentialParameterSet', Mandatory, HelpMessage = "Password credentials associated with the service principal.")] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] @@ -724,7 +706,10 @@ function New-AzADServicePrincipal { if ($PSBoundParameters['ApplicationObject']) { $PSBoundParameters['AppId'] = $PSBoundParameters['ApplicationObject'].AppId $null = $PSBoundParameters.Remove('ApplicationObject') - } elseif (!$PSBoundParameters['ApplicationId']) { + } elseif ($PSBoundParameters['ApplicationId']) { + $PSBoundParameters['AppId'] = $PSBoundParameters['ApplicationId'] + $null = $PSBoundParameters.Remove('ApplicationId') + } else { if (!$PSBoundParameters['DisplayName']) { $param['DisplayName'] = "azure-powershell-" + (Get-Date).ToString("MM-dd-yyyy-HH-mm-ss") } else { @@ -751,13 +736,14 @@ function New-AzADServicePrincipal { $param['EndDate'] = $PSBoundParameters['EndDate'] $null = $PSBoundParameters.Remove('EndDate') } + if ($PSBoundParameters['CertValue']) { + $param['CertValue'] = $PSBoundParameters['CertValue'] + $null = $PSBoundParameters.Remove('CertValue') + } } $app = New-AzADApplication @param $PSBoundParameters['AppId'] = $app.AppId - } else { - $PSBoundParameters['AppId'] = $PSBoundParameters['ApplicationId'] - $null = $PSBoundParameters.Remove('ApplicationId') } $sp = Az.MSGraph.internal\New-AzADServicePrincipal @PSBoundParameters diff --git a/src/Resources/MSGraph.Autorest/custom/New-AzADSpCredential.ps1 b/src/Resources/MSGraph.Autorest/custom/New-AzADSpCredential.ps1 index bde8a053b107..9e26602b1b9c 100644 --- a/src/Resources/MSGraph.Autorest/custom/New-AzADSpCredential.ps1 +++ b/src/Resources/MSGraph.Autorest/custom/New-AzADSpCredential.ps1 @@ -194,6 +194,9 @@ function New-AzADSpCredential { switch ($PSCmdlet.ParameterSetName) { {$_ -in 'SpObjectIdWithPasswordParameterSet', 'SpObjectIdWithKeyCredentialParameterSet', 'SpObjectIdWithPasswordCredentialParameterSet', 'SpObjectIdWithCertValueParameterSet'} { $id = $PSBoundParameters['ObjectId'] + if ($kc) { + $sp = Get-AzADServicePrincipal -ObjectId $id + } $null = $PSBoundParameters.Remove('ObjectId') break } @@ -211,6 +214,9 @@ function New-AzADSpCredential { } {$_ -in 'ServicePrincipalObjectWithPasswordParameterSet', 'ServicePrincipalObjectWithKeyCredentialParameterSet', 'ServicePrincipalObjectWithPasswordCredentialParameterSet', 'ServicePrincipalObjectWithCertValueParameterSet'} { $id = $PSBoundParameters['ServicePrincipalObject'].Id + if ($kc) { + $sp = Get-AzADServicePrincipal -ObjectId $id + } $null = $PSBoundParameters.Remove('ServicePrincipalObject') break } @@ -230,8 +236,12 @@ function New-AzADSpCredential { } } if ($kc) { + [System.Array]$kcList = $sp.KeyCredentials $PSBoundParameters['Id'] = $id - $PSBoundParameters['KeyCredentials'] = $kc + foreach ($k in $kc) { + $kcList += $k + } + $PSBoundParameters['KeyCredentials'] = $kcList Az.MSGraph.internal\Update-AzADServicePrincipal @PSBoundParameters } } diff --git a/src/Resources/MSGraph.Autorest/docs/Az.MSGraph.md b/src/Resources/MSGraph.Autorest/docs/Az.MSGraph.md index ac92bcc8ee57..783de172b91f 100644 --- a/src/Resources/MSGraph.Autorest/docs/Az.MSGraph.md +++ b/src/Resources/MSGraph.Autorest/docs/Az.MSGraph.md @@ -1,6 +1,6 @@ --- Module Name: Az.MSGraph -Module Guid: 0ce0be77-f0b8-4f48-a526-a42a7e272e07 +Module Guid: 0fcdc3b3-bb14-4092-a847-d0cd87a0c25a Download Help Link: https://docs.microsoft.com/powershell/module/az.msgraph Help Version: 1.0.0.0 Locale: en-US diff --git a/src/Resources/MSGraph.Autorest/docs/New-AzADServicePrincipal.md b/src/Resources/MSGraph.Autorest/docs/New-AzADServicePrincipal.md index 8a7f7a42e0fe..71dec180bcd1 100644 --- a/src/Resources/MSGraph.Autorest/docs/New-AzADServicePrincipal.md +++ b/src/Resources/MSGraph.Autorest/docs/New-AzADServicePrincipal.md @@ -34,76 +34,7 @@ New-AzADServicePrincipal [-AccountEnabled] [-AddIn ] [-A [] ``` -### ApplicationObjectWithKeyCredentialParameterSet -``` -New-AzADServicePrincipal -ApplicationObject - -KeyCredential [-AccountEnabled] [-AddIn ] - [-AlternativeName ] [-AppDescription ] [-AppOwnerOrganizationId ] - [-AppRole ] [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-Endpoint ] [-Homepage ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] [-ReplyUrl ] - [-Role ] [-SamlSingleSignOnSetting ] [-Scope ] - [-ServicePrincipalName ] [-ServicePrincipalType ] [-Tag ] - [-TokenEncryptionKeyId ] [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] [-DefaultProfile ] [-Confirm] [-WhatIf] - [] -``` - -### ApplicationObjectWithKeyPlainParameterSet -``` -New-AzADServicePrincipal -ApplicationObject -CertValue [-AccountEnabled] - [-AddIn ] [-AlternativeName ] [-AppDescription ] - [-AppOwnerOrganizationId ] [-AppRole ] - [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-EndDate ] [-Endpoint ] [-Homepage ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] [-ReplyUrl ] - [-Role ] [-SamlSingleSignOnSetting ] [-Scope ] - [-ServicePrincipalName ] [-ServicePrincipalType ] [-StartDate ] [-Tag ] - [-TokenEncryptionKeyId ] [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] [-DefaultProfile ] [-Confirm] [-WhatIf] - [] -``` - -### ApplicationObjectWithPasswordCredentialParameterSet -``` -New-AzADServicePrincipal -ApplicationObject - -PasswordCredential [-AccountEnabled] [-AddIn ] - [-AlternativeName ] [-AppDescription ] [-AppOwnerOrganizationId ] - [-AppRole ] [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-Endpoint ] [-Homepage ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] [-ReplyUrl ] - [-Role ] [-SamlSingleSignOnSetting ] [-Scope ] - [-ServicePrincipalName ] [-ServicePrincipalType ] [-Tag ] - [-TokenEncryptionKeyId ] [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] [-DefaultProfile ] [-Confirm] [-WhatIf] - [] -``` - -### ApplicationObjectWithPasswordPlainParameterSet +### ApplicationObjectParameterSet ``` New-AzADServicePrincipal -ApplicationObject [-AccountEnabled] [-AddIn ] [-AlternativeName ] [-AppDescription ] @@ -113,75 +44,6 @@ New-AzADServicePrincipal -ApplicationObject [-Accou [-ClaimsMappingPolicy ] [-DelegatedPermissionClassification ] [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-EndDate ] [-Endpoint ] [-Homepage ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] [-ReplyUrl ] - [-Role ] [-SamlSingleSignOnSetting ] [-Scope ] - [-ServicePrincipalName ] [-ServicePrincipalType ] [-StartDate ] [-Tag ] - [-TokenEncryptionKeyId ] [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] [-DefaultProfile ] [-Confirm] [-WhatIf] - [] -``` - -### ApplicationWithKeyCredentialParameterSet -``` -New-AzADServicePrincipal -ApplicationId -KeyCredential - [-AccountEnabled] [-AddIn ] [-AlternativeName ] [-AppDescription ] - [-AppOwnerOrganizationId ] [-AppRole ] - [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-Endpoint ] [-Homepage ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] [-ReplyUrl ] - [-Role ] [-SamlSingleSignOnSetting ] [-Scope ] - [-ServicePrincipalName ] [-ServicePrincipalType ] [-Tag ] - [-TokenEncryptionKeyId ] [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] [-DefaultProfile ] [-Confirm] [-WhatIf] - [] -``` - -### ApplicationWithKeyPlainParameterSet -``` -New-AzADServicePrincipal -ApplicationId -CertValue [-AccountEnabled] - [-AddIn ] [-AlternativeName ] [-AppDescription ] - [-AppOwnerOrganizationId ] [-AppRole ] - [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-EndDate ] [-Endpoint ] [-Homepage ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] [-ReplyUrl ] - [-Role ] [-SamlSingleSignOnSetting ] [-Scope ] - [-ServicePrincipalName ] [-ServicePrincipalType ] [-StartDate ] [-Tag ] - [-TokenEncryptionKeyId ] [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] [-DefaultProfile ] [-Confirm] [-WhatIf] - [] -``` - -### ApplicationWithPasswordCredentialParameterSet -``` -New-AzADServicePrincipal -ApplicationId -PasswordCredential - [-AccountEnabled] [-AddIn ] [-AlternativeName ] [-AppDescription ] - [-AppOwnerOrganizationId ] [-AppRole ] - [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] [-Endpoint ] [-Homepage ] [-HomeRealmDiscoveryPolicy ] [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] @@ -362,10 +224,10 @@ The unique identifier for the associated application (its appId property). ```yaml Type: System.Guid -Parameter Sets: ApplicationWithKeyCredentialParameterSet, ApplicationWithKeyPlainParameterSet, ApplicationWithPasswordCredentialParameterSet, SimpleParameterSet +Parameter Sets: SimpleParameterSet Aliases: AppId -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -378,7 +240,7 @@ To construct, see NOTES section for APPLICATIONOBJECT properties and create a ha ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication -Parameter Sets: ApplicationObjectWithKeyCredentialParameterSet, ApplicationObjectWithKeyPlainParameterSet, ApplicationObjectWithPasswordCredentialParameterSet, ApplicationObjectWithPasswordPlainParameterSet +Parameter Sets: ApplicationObjectParameterSet Aliases: Required: True @@ -479,7 +341,7 @@ It represents the base 64 encoded certificate. ```yaml Type: System.String -Parameter Sets: ApplicationObjectWithKeyPlainParameterSet, ApplicationWithKeyPlainParameterSet, DisplayNameWithKeyPlainParameterSet +Parameter Sets: DisplayNameWithKeyPlainParameterSet Aliases: Required: True @@ -611,7 +473,7 @@ For an 'asymmetric' type credential, this must be set to on or before the date t ```yaml Type: System.DateTime -Parameter Sets: ApplicationObjectWithKeyPlainParameterSet, ApplicationObjectWithPasswordPlainParameterSet, ApplicationWithKeyPlainParameterSet, DisplayNameWithKeyPlainParameterSet, SimpleParameterSet +Parameter Sets: DisplayNameWithKeyPlainParameterSet, SimpleParameterSet Aliases: Required: False @@ -692,7 +554,7 @@ To construct, see NOTES section for KEYCREDENTIAL properties and create a hash t ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[] -Parameter Sets: ApplicationObjectWithKeyCredentialParameterSet, ApplicationWithKeyCredentialParameterSet, DisplayNameWithKeyCredentialParameterSet +Parameter Sets: DisplayNameWithKeyCredentialParameterSet Aliases: KeyCredentials Required: True @@ -791,7 +653,7 @@ To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a h ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[] -Parameter Sets: ApplicationObjectWithPasswordCredentialParameterSet, ApplicationWithPasswordCredentialParameterSet, DisplayNameWithPasswordCredentialParameterSet +Parameter Sets: DisplayNameWithPasswordCredentialParameterSet Aliases: PasswordCredentials Required: True @@ -942,7 +804,7 @@ For an 'asymmetric' type credential, this must be set to on or after the date th ```yaml Type: System.DateTime -Parameter Sets: ApplicationObjectWithKeyPlainParameterSet, ApplicationObjectWithPasswordPlainParameterSet, ApplicationWithKeyPlainParameterSet, DisplayNameWithKeyPlainParameterSet, SimpleParameterSet +Parameter Sets: DisplayNameWithKeyPlainParameterSet, SimpleParameterSet Aliases: Required: False diff --git a/src/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipal.ps1 b/src/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipal.ps1 index 5ed7b39ef458..5737726b0cf5 100644 --- a/src/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipal.ps1 +++ b/src/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipal.ps1 @@ -303,9 +303,6 @@ param( ${DisplayName}, [Parameter(ParameterSetName='SimpleParameterSet')] - [Parameter(ParameterSetName='ApplicationWithKeyPlainParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationWithKeyCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationWithPasswordCredentialParameterSet', Mandatory)] [Alias('AppId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Guid] @@ -340,9 +337,6 @@ param( [Parameter(ParameterSetName='SimpleParameterSet')] [Parameter(ParameterSetName='DisplayNameWithKeyPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationObjectWithKeyPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationObjectWithPasswordPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationWithKeyPlainParameterSet')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The effective start date of the credential usage. @@ -352,9 +346,6 @@ param( [Parameter(ParameterSetName='SimpleParameterSet')] [Parameter(ParameterSetName='DisplayNameWithKeyPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationObjectWithKeyPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationObjectWithPasswordPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationWithKeyPlainParameterSet')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The effective end date of the credential usage. @@ -630,8 +621,6 @@ param( ${TransitiveMemberOf}, [Parameter(ParameterSetName='DisplayNameWithKeyPlainParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationObjectWithKeyPlainParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationWithKeyPlainParameterSet', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The value of the 'asymmetric' credential type. @@ -639,8 +628,6 @@ param( ${CertValue}, [Parameter(ParameterSetName='DisplayNameWithKeyCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationObjectWithKeyCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationWithKeyCredentialParameterSet', Mandatory)] [Alias('KeyCredentials')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] @@ -650,8 +637,6 @@ param( ${KeyCredential}, [Parameter(ParameterSetName='DisplayNameWithPasswordCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationObjectWithPasswordCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationWithPasswordCredentialParameterSet', Mandatory)] [Alias('PasswordCredentials')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] @@ -660,10 +645,7 @@ param( # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, - [Parameter(ParameterSetName='ApplicationObjectWithKeyPlainParameterSet', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='ApplicationObjectWithPasswordPlainParameterSet', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='ApplicationObjectWithKeyCredentialParameterSet', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='ApplicationObjectWithPasswordCredentialParameterSet', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ApplicationObjectParameterSet', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. @@ -730,13 +712,7 @@ begin { DisplayNameWithKeyPlainParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; DisplayNameWithKeyCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; DisplayNameWithPasswordCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationObjectWithKeyPlainParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationObjectWithPasswordPlainParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationObjectWithKeyCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationObjectWithPasswordCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationWithKeyPlainParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationWithKeyCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationWithPasswordCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; + ApplicationObjectParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 index c17ad42eef46..d94c15fc744f 100644 --- a/src/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/src/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -3729,9 +3729,6 @@ param( ${DisplayName}, [Parameter(ParameterSetName='SimpleParameterSet')] - [Parameter(ParameterSetName='ApplicationWithKeyPlainParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationWithKeyCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationWithPasswordCredentialParameterSet', Mandatory)] [Alias('AppId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Guid] @@ -3766,9 +3763,6 @@ param( [Parameter(ParameterSetName='SimpleParameterSet')] [Parameter(ParameterSetName='DisplayNameWithKeyPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationObjectWithKeyPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationObjectWithPasswordPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationWithKeyPlainParameterSet')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The effective start date of the credential usage. @@ -3778,9 +3772,6 @@ param( [Parameter(ParameterSetName='SimpleParameterSet')] [Parameter(ParameterSetName='DisplayNameWithKeyPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationObjectWithKeyPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationObjectWithPasswordPlainParameterSet')] - [Parameter(ParameterSetName='ApplicationWithKeyPlainParameterSet')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The effective end date of the credential usage. @@ -4056,8 +4047,6 @@ param( ${TransitiveMemberOf}, [Parameter(ParameterSetName='DisplayNameWithKeyPlainParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationObjectWithKeyPlainParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationWithKeyPlainParameterSet', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The value of the 'asymmetric' credential type. @@ -4065,8 +4054,6 @@ param( ${CertValue}, [Parameter(ParameterSetName='DisplayNameWithKeyCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationObjectWithKeyCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationWithKeyCredentialParameterSet', Mandatory)] [Alias('KeyCredentials')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] @@ -4076,8 +4063,6 @@ param( ${KeyCredential}, [Parameter(ParameterSetName='DisplayNameWithPasswordCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationObjectWithPasswordCredentialParameterSet', Mandatory)] - [Parameter(ParameterSetName='ApplicationWithPasswordCredentialParameterSet', Mandatory)] [Alias('PasswordCredentials')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] @@ -4086,10 +4071,7 @@ param( # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, - [Parameter(ParameterSetName='ApplicationObjectWithKeyPlainParameterSet', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='ApplicationObjectWithPasswordPlainParameterSet', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='ApplicationObjectWithKeyCredentialParameterSet', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='ApplicationObjectWithPasswordCredentialParameterSet', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ApplicationObjectParameterSet', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. @@ -4156,13 +4138,7 @@ begin { DisplayNameWithKeyPlainParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; DisplayNameWithKeyCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; DisplayNameWithPasswordCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationObjectWithKeyPlainParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationObjectWithPasswordPlainParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationObjectWithKeyCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationObjectWithPasswordCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationWithKeyPlainParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationWithKeyCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; - ApplicationWithPasswordCredentialParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; + ApplicationObjectParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipal'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/Resources/MSGraph.Autorest/generate-info.json b/src/Resources/MSGraph.Autorest/generate-info.json index 746cb9fb3da3..bd7c59fa58cb 100644 --- a/src/Resources/MSGraph.Autorest/generate-info.json +++ b/src/Resources/MSGraph.Autorest/generate-info.json @@ -1,8 +1,8 @@ { - "swagger_commit": "4c50e693e709f9a88ed342abfdb54a67ed901ba5", - "autorest_powershell": "3.0.474", - "autorest": "`-- (empty)", - "node": "v14.15.5", "autorest_modelerfour": "4.15.414", - "autorest_core": "3.7.6" + "node": "v14.15.5", + "autorest_core": "3.7.6", + "autorest_powershell": "3.0.476", + "swagger_commit": "9f48feaf684784644513d11ddb7bd0ac2e32f48e", + "autorest": "`-- (empty)" } diff --git a/src/Resources/MSGraph.Autorest/generated/api/MSGraph.cs b/src/Resources/MSGraph.Autorest/generated/api/MSGraph.cs index 4aa1c18cfee2..6f6a7e18ae73 100644 --- a/src/Resources/MSGraph.Autorest/generated/api/MSGraph.cs +++ b/src/Resources/MSGraph.Autorest/generated/api/MSGraph.cs @@ -638,9 +638,9 @@ public partial class MSGraph "/applications/" + global::System.Uri.EscapeDataString(applicationId) + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -698,9 +698,9 @@ public partial class MSGraph "/applications/" + applicationId + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -825,11 +825,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -892,11 +892,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -2124,9 +2124,9 @@ public partial class MSGraph "/groups/" + global::System.Uri.EscapeDataString(groupId) + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -2184,9 +2184,9 @@ public partial class MSGraph "/groups/" + groupId + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -2309,11 +2309,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -2376,11 +2376,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -2679,11 +2679,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -2753,11 +2753,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -3802,9 +3802,9 @@ public partial class MSGraph "/servicePrincipals/" + global::System.Uri.EscapeDataString(servicePrincipalId) + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -3862,9 +3862,9 @@ public partial class MSGraph "/servicePrincipals/" + servicePrincipalId + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -3989,11 +3989,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -4056,11 +4056,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -4612,9 +4612,9 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/me" + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -4660,9 +4660,9 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/me" + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -4768,9 +4768,9 @@ public partial class MSGraph "/users/" + global::System.Uri.EscapeDataString(userId) + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -4825,9 +4825,9 @@ public partial class MSGraph "/users/" + userId + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -4950,11 +4950,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -5017,11 +5017,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(each?.ToString()??global::System.String.Empty) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } diff --git a/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyCredential.json.cs b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyCredential.json.cs index a44bb8951a02..f3d70f844aa3 100644 --- a/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyCredential.json.cs +++ b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyCredential.json.cs @@ -111,7 +111,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNod AddIf( null != this._customKeyIdentifier ? global::System.Convert.ToBase64String( this._customKeyIdentifier) : null ,(v)=> container.Add( "customKeyIdentifier",v) ); AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); AddIf( null != this._endDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._endDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endDateTime" ,container.Add ); - AddIf( null != this._key ? global::System.Convert.ToBase64String( this._key).TrimEnd(new char[] {'='}).Replace('+', '-').Replace('/', '_') : null ,(v)=> container.Add( "key",v) ); + AddIf( null != this._key ? global::System.Convert.ToBase64String( this._key) : null ,(v)=> container.Add( "key",v) ); AddIf( null != (((object)this._keyId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._keyId.ToString()) : null, "keyId" ,container.Add ); AddIf( null != this._startDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._startDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startDateTime" ,container.Add ); AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); diff --git a/src/Resources/MSGraph.Autorest/test/Application.Tests.ps1 b/src/Resources/MSGraph.Autorest/test/Application.Tests.ps1 index 1170510fc9ce..3c8da642b753 100644 --- a/src/Resources/MSGraph.Autorest/test/Application.Tests.ps1 +++ b/src/Resources/MSGraph.Autorest/test/Application.Tests.ps1 @@ -17,33 +17,46 @@ if(($null -eq $TestName) -or ($TestName -contains 'Application')) Describe 'Application' -Tag 'LiveOnly' { It 'CRUD' { { - New-AzMgApplication -DisplayName $env.appName1 -ReplyUrls $env.reply1 -HomePage $env.homepage1 -AvailableToOtherTenants $true -StartDate (Get-Date) + New-AzADApplication -DisplayName $env.appName1 -ReplyUrls $env.reply1 -HomePage $env.homepage1 -AvailableToOtherTenants $true -StartDate (Get-Date) - $app = Get-AzMgApplication -DisplayName $env.appName1 + $app = Get-AzADApplication -DisplayName $env.appName1 $app | Should -Not -Be $null $app.Web.RedirectUri | Should -Be $env.reply1 $app.Web.HomePageUrl | should -Be $env.homepage1 $app.SignInAudience | Should -Be 'AzureADMultipleOrgs' - (Get-AzMgApplication -ObjectId $app.id -Select Id).Id | Should -Be $app.Id - (Get-AzMgApplication -ApplicationId $app.AppId -Select Id).Id | Should -Be $app.Id + (Get-AzADApplication -ObjectId $app.id -Select Id).Id | Should -Be $app.Id + (Get-AzADApplication -ApplicationId $app.AppId -Select Id).Id | Should -Be $app.Id - Update-AzMgApplication -ObjectId $app.Id -ReplyUrl $env.reply2 -HomePage $env.homepage2 -AvailableToOtherTenants $false + Update-AzADApplication -ObjectId $app.Id -ReplyUrl $env.reply2 -HomePage $env.homepage2 -AvailableToOtherTenants $false - $appUpdate = Get-AzMgApplication -DisplayName $env.appName1 + $appUpdate = Get-AzADApplication -DisplayName $env.appName1 $appUpdate.Web.RedirectUri | Should -Be $env.reply2 $appUpdate.Web.HomePageUrl | should -Be $env.homepage2 $appUpdate.SignInAudience | Should -Be 'AzureADMyOrg' - (Get-AzMgAppCredential -ObjectId $app.Id) | Should -Not -Be $null - $cred = New-AzMgAppCredential -ObjectId $app.Id -StartDate (get-date) - Remove-AzMgAppCredential -ObjectId $app.Id -KeyId $cred.KeyId + (Get-AzADAppCredential -ObjectId $app.Id) | Should -Not -Be $null + $pw = New-AzADAppCredential -ObjectId $app.Id -StartDate (get-date) + + + $certFile = Join-Path $PSScriptRoot 'msgraphtest2.cer' + $content=get-content $certFile -AsByteStream + $certvalue=[System.Convert]::ToBase64String($content) + $cert = New-AzADAppCredential -ObjectId $app.Id -CertValue $certvalue + + Remove-AzADAppCredential -ObjectId $app.Id -KeyId $pw.KeyId + + $sp1 = New-AzADServicePrincipal -ApplicationId $app.AppId + $sp2 = New-AzADServicePrincipal -DisplayName $env.spName2 + Remove-AzADServicePrincipal -ServicePrincipalName $sp1.ServicePrincipalName[0] + Remove-AzADServicePrincipal -ObjectId $sp2.Id + Remove-AzADApplication -DisplayName $env.spName2 } | Should -Not -Throw } AfterAll { - Remove-AzMgApplication -DisplayName $env.appName1 + Remove-AzADApplication -DisplayName $env.appName1 } } diff --git a/src/Resources/MSGraph.Autorest/test/New-AzADServicePrincipal.Tests.ps1 b/src/Resources/MSGraph.Autorest/test/New-AzADServicePrincipal.Tests.ps1 index e78d1fd22730..ba30724d0cc5 100644 --- a/src/Resources/MSGraph.Autorest/test/New-AzADServicePrincipal.Tests.ps1 +++ b/src/Resources/MSGraph.Autorest/test/New-AzADServicePrincipal.Tests.ps1 @@ -31,31 +31,7 @@ Describe 'New-AzADServicePrincipal' { { throw [System.NotImplementedException] } | Should -Not -Throw } - It 'ApplicationWithPasswordCredentialParameterSet' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'ApplicationWithKeyCredentialParameterSet' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'ApplicationWithKeyPlainParameterSet' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'ApplicationObjectWithPasswordPlainParameterSet' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'ApplicationObjectWithKeyPlainParameterSet' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'ApplicationObjectWithKeyCredentialParameterSet' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'ApplicationObjectWithPasswordCredentialParameterSet' -skip { + It 'ApplicationObjectParameterSet' -skip { { throw [System.NotImplementedException] } | Should -Not -Throw } } diff --git a/src/Resources/MSGraph.Autorest/test/msgraphtest2.cer b/src/Resources/MSGraph.Autorest/test/msgraphtest2.cer new file mode 100644 index 000000000000..0962c2e729c2 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/test/msgraphtest2.cer @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIIEGTCCAwGgAwIBAgIQJGmcQ90Ht55ojXCPEWWLQDANBgkqhkiG9w0BAQsFADBN +MUswSQYDVQQDHkIATQBTAC0ATwByAGcAYQBuAGkAegBhAHQAaQBvAG4ALQBQADIA +UAAtAEEAYwBjAGUAcwBzACAAWwAyADAAMgAxAF0wHhcNMjEwOTI3MDQxNTQ1WhcN +MjEwOTI4MDQyMDQ1WjBlMTQwMgYKCZImiZPyLGQBGRYkNzJmOTg4YmYtODZmMS00 +MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3MS0wKwYDVQQDDCRmZWJhNWM1Zi00MDE3LTRh +ODQtYjhkNS1hY2FkOWEyMjVkODQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQDh7ksk8f/SxuyXZkrxHOBn4fF5QSy10khH4YcYlo3BXZsIprWQF1zduqRZ +MWGOHRxTux2WaL2AATZAdOcd5hqznRM7qpvLwFOGZvp2pxJ1zIOyuyOCFYy9sq2i +I0r+I19M7zoc6Hxws5df2894ZsScQVC2+z3nen9b0EURF9CZ4PAraGeJwAsFG45S +kUAw+44JMFw1v87CUGQBzQaOKq/z/xY3OrPpf2eAtcramRctZymZwlqMB/8VYQkJ +LGaKLYiOBEtgdaPSQYA/VZ5d6huTGirvvI/85ckep0t+oqCcV6U+A/uHW0o7KS5L +z15cDkQtrq5D513w5UuP6BY/gBkDAgMBAAGjgdwwgdkwDgYDVR0PAQH/BAQDAgWg +MIGUBgNVHREEgYwwgYmCD0RFU0tUT1AtQTlBMVVEMoIPREVTS1RPUC1BOUExVUQy +giUyNDA0OmY4MDE6YzAwMjo1MDo4NWE2OjY1Y2Q6MWVkOTpjMzcygiUyNDA0OmY4 +MDE6YzAwMjo1MDo3OWUxOmM2MGU6NDIxYzozMjc1ggkxMC4xNy45LjaCDDE3Mi4y +MC4yNDAuMTATBgNVHSUEDDAKBggrBgEFBQcDATAbBgkrBgEEAYI3FQoEDjAMMAoG +CCsGAQUFBwMBMA0GCSqGSIb3DQEBCwUAA4IBAQAfKBnGUmj0DfFCRXlnChE3UrJ3 +Pv/Jj12GOKWWWokowY67gvvoAf1BWpyhXLNC8f7M3TMj3LDkfSgQr2zZx45TvDm4 +6hmWSVViYB4y5iYAZs6ZU8qHd1LsuvtKehRWjlokPwzoncZMY8G9N7FFs6G+X1f0 +QyMjQS6pR1B6kfvSXfc+BfI3PWKliYyiyLIkN8FsRv1leU4XFHPQxW+mR11QuUja +gar3muui3dsRAMOYslaL+bRONWvjPuPLbCFCSExl65/CZo9TjtUUTPnksB2zQhOl +jt9bt64s4pJoGyGDFeu1g4PJDzR2E1oqRTs2KVAptBvU5RHgky3Y1nHRdfhL +-----END CERTIFICATE----- diff --git a/src/Resources/Resources/Az.Resources.psd1 b/src/Resources/Resources/Az.Resources.psd1 index efe29e5e4fe2..8a88e6943926 100644 --- a/src/Resources/Resources/Az.Resources.psd1 +++ b/src/Resources/Resources/Az.Resources.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 2/10/2022 +# Generated on: 2/23/2022 # @{ @@ -191,7 +191,9 @@ PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. - Tags = 'Azure','ResourceManager','ARM','Provider','ResourceGroup','Deployment','ActiveDirectory','Authorization','Management','ManagementGroups','Tags' + Tags = 'Azure', 'ResourceManager', 'ARM', 'Provider', 'ResourceGroup', + 'Deployment', 'ActiveDirectory', 'Authorization', 'Management', + 'ManagementGroups', 'Tags' # A URL to the license for this module. LicenseUri = 'https://aka.ms/azps-license' @@ -216,7 +218,7 @@ PrivateData = @{ } # End of PSData hashtable - } # End of PrivateData hashtable +} # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' diff --git a/src/Resources/Resources/help/Az.Resources.md b/src/Resources/Resources/help/Az.Resources.md index 3aa89a41990c..f7ba81847995 100644 --- a/src/Resources/Resources/help/Az.Resources.md +++ b/src/Resources/Resources/help/Az.Resources.md @@ -153,6 +153,8 @@ The cmdlet may call below Microsoft Graph API according to input parameters: - GET /directoryObjects/{id} - POST /directoryObjects/getByIds +Please notice that this cmdlet will mark `ObjectType` as `Unknown` in output if the object of role assignment is not found or current account has insufficient privileges to get object type. + ### [Get-AzRoleDefinition](Get-AzRoleDefinition.md) Lists all Azure RBAC roles that are available for assignment. @@ -247,6 +249,8 @@ The cmdlet may call below Microsoft Graph API according to input parameters: - GET /groups/{id} - GET /directoryObjects/{id} +Please notice that this cmdlet will mark `ObjectType` as `Unknown` in output if the object of role assignment is not found or current account has insufficient privileges to get object type. + ### [New-AzRoleDefinition](New-AzRoleDefinition.md) Creates a custom role in Azure RBAC. Provide either a JSON role definition file or a PSRoleDefinition object as input. @@ -359,6 +363,8 @@ The cmdlet may call below Microsoft Graph API according to input parameters: - GET /directoryObjects/{id} - POST /directoryObjects/getByIds +Please notice that this cmdlet will mark `ObjectType` as `Unknown` in output if the object of role assignment is not found or current account has insufficient privileges to get object type. + ### [Remove-AzRoleDefinition](Remove-AzRoleDefinition.md) Deletes a custom role in Azure RBAC. The role to be deleted is specified using the Id property of the role. @@ -426,6 +432,8 @@ The cmdlet may call below Microsoft Graph API according to input parameters: - GET /directoryObjects/{id} - POST /directoryObjects/getByIds +Please notice that this cmdlet will mark `ObjectType` as `Unknown` in output if the object of role assignment is not found or current account has insufficient privileges to get object type. + ### [Set-AzRoleDefinition](Set-AzRoleDefinition.md) Modifies a custom role in Azure RBAC. Provide the modified role definition either as a JSON file or as a PSRoleDefinition. diff --git a/src/Resources/Resources/help/New-AzADServicePrincipal.md b/src/Resources/Resources/help/New-AzADServicePrincipal.md index d1228c97bb45..96f72db1e321 100644 --- a/src/Resources/Resources/help/New-AzADServicePrincipal.md +++ b/src/Resources/Resources/help/New-AzADServicePrincipal.md @@ -107,149 +107,7 @@ New-AzADServicePrincipal -DisplayName [-Role ] [-Scope [-WhatIf] [-Confirm] [] ``` -### ApplicationWithPasswordCredentialParameterSet -``` -New-AzADServicePrincipal -ApplicationId [-Role ] [-Scope ] [-Homepage ] - [-ReplyUrl ] [-AccountEnabled] [-AddIn ] [-AlternativeName ] - [-AppDescription ] [-AppOwnerOrganizationId ] [-AppRole ] - [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-Endpoint ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] - [-SamlSingleSignOnSetting ] [-ServicePrincipalName ] - [-ServicePrincipalType ] [-Tag ] [-TokenEncryptionKeyId ] - [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] - -PasswordCredential [-DefaultProfile ] [-WhatIf] [-Confirm] - [] -``` - -### ApplicationWithKeyCredentialParameterSet -``` -New-AzADServicePrincipal -ApplicationId [-Role ] [-Scope ] [-Homepage ] - [-ReplyUrl ] [-AccountEnabled] [-AddIn ] [-AlternativeName ] - [-AppDescription ] [-AppOwnerOrganizationId ] [-AppRole ] - [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-Endpoint ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] - [-SamlSingleSignOnSetting ] [-ServicePrincipalName ] - [-ServicePrincipalType ] [-Tag ] [-TokenEncryptionKeyId ] - [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] -KeyCredential - [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ApplicationWithKeyPlainParameterSet -``` -New-AzADServicePrincipal -ApplicationId [-Role ] [-Scope ] [-Homepage ] - [-ReplyUrl ] [-StartDate ] [-EndDate ] [-AccountEnabled] - [-AddIn ] [-AlternativeName ] [-AppDescription ] - [-AppOwnerOrganizationId ] [-AppRole ] - [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-Endpoint ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] - [-SamlSingleSignOnSetting ] [-ServicePrincipalName ] - [-ServicePrincipalType ] [-Tag ] [-TokenEncryptionKeyId ] - [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] -CertValue [-DefaultProfile ] - [-WhatIf] [-Confirm] [] -``` - -### ApplicationObjectWithPasswordPlainParameterSet -``` -New-AzADServicePrincipal [-Role ] [-Scope ] [-Homepage ] [-ReplyUrl ] - [-StartDate ] [-EndDate ] [-AccountEnabled] [-AddIn ] - [-AlternativeName ] [-AppDescription ] [-AppOwnerOrganizationId ] - [-AppRole ] [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-Endpoint ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] - [-SamlSingleSignOnSetting ] [-ServicePrincipalName ] - [-ServicePrincipalType ] [-Tag ] [-TokenEncryptionKeyId ] - [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] -ApplicationObject - [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ApplicationObjectWithKeyPlainParameterSet -``` -New-AzADServicePrincipal [-Role ] [-Scope ] [-Homepage ] [-ReplyUrl ] - [-StartDate ] [-EndDate ] [-AccountEnabled] [-AddIn ] - [-AlternativeName ] [-AppDescription ] [-AppOwnerOrganizationId ] - [-AppRole ] [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-Endpoint ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] - [-SamlSingleSignOnSetting ] [-ServicePrincipalName ] - [-ServicePrincipalType ] [-Tag ] [-TokenEncryptionKeyId ] - [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] -CertValue - -ApplicationObject [-DefaultProfile ] [-WhatIf] [-Confirm] - [] -``` - -### ApplicationObjectWithKeyCredentialParameterSet -``` -New-AzADServicePrincipal [-Role ] [-Scope ] [-Homepage ] [-ReplyUrl ] - [-AccountEnabled] [-AddIn ] [-AlternativeName ] [-AppDescription ] - [-AppOwnerOrganizationId ] [-AppRole ] - [-AppRoleAssignedTo ] - [-AppRoleAssignment ] [-AppRoleAssignmentRequired] - [-ClaimsMappingPolicy ] - [-DelegatedPermissionClassification ] - [-DeletedDateTime ] [-Description ] [-DisabledByMicrosoftStatus ] - [-Endpoint ] - [-HomeRealmDiscoveryPolicy ] - [-Info ] [-LoginUrl ] [-LogoutUrl ] [-Note ] - [-NotificationEmailAddress ] [-Oauth2PermissionScope ] - [-PreferredSingleSignOnMode ] [-PreferredTokenSigningKeyThumbprint ] - [-SamlSingleSignOnSetting ] [-ServicePrincipalName ] - [-ServicePrincipalType ] [-Tag ] [-TokenEncryptionKeyId ] - [-TokenIssuancePolicy ] - [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] -KeyCredential - -ApplicationObject [-DefaultProfile ] [-WhatIf] [-Confirm] - [] -``` - -### ApplicationObjectWithPasswordCredentialParameterSet +### ApplicationObjectParameterSet ``` New-AzADServicePrincipal [-Role ] [-Scope ] [-Homepage ] [-ReplyUrl ] [-AccountEnabled] [-AddIn ] [-AlternativeName ] [-AppDescription ] @@ -268,8 +126,7 @@ New-AzADServicePrincipal [-Role ] [-Scope ] [-Homepage ] [-ServicePrincipalType ] [-Tag ] [-TokenEncryptionKeyId ] [-TokenIssuancePolicy ] [-TokenLifetimePolicy ] - [-TransitiveMemberOf ] - -PasswordCredential -ApplicationObject + [-TransitiveMemberOf ] -ApplicationObject [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -381,25 +238,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -```yaml -Type: System.Guid -Parameter Sets: ApplicationWithPasswordCredentialParameterSet, ApplicationWithKeyCredentialParameterSet, ApplicationWithKeyPlainParameterSet -Aliases: AppId - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -ApplicationObject The application object, could be used as pipeline input. To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication -Parameter Sets: ApplicationObjectWithPasswordPlainParameterSet, ApplicationObjectWithKeyPlainParameterSet, ApplicationObjectWithKeyCredentialParameterSet, ApplicationObjectWithPasswordCredentialParameterSet +Parameter Sets: ApplicationObjectParameterSet Aliases: Required: True @@ -500,7 +345,7 @@ It represents the base 64 encoded certificate. ```yaml Type: System.String -Parameter Sets: DisplayNameWithKeyPlainParameterSet, ApplicationWithKeyPlainParameterSet, ApplicationObjectWithKeyPlainParameterSet +Parameter Sets: DisplayNameWithKeyPlainParameterSet Aliases: Required: True @@ -644,7 +489,7 @@ For an 'asymmetric' type credential, this must be set to on or before the date t ```yaml Type: System.DateTime -Parameter Sets: SimpleParameterSet, DisplayNameWithKeyPlainParameterSet, ApplicationWithKeyPlainParameterSet, ApplicationObjectWithPasswordPlainParameterSet, ApplicationObjectWithKeyPlainParameterSet +Parameter Sets: SimpleParameterSet, DisplayNameWithKeyPlainParameterSet Aliases: Required: False @@ -725,7 +570,7 @@ To construct, see NOTES section for KEYCREDENTIAL properties and create a hash t ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[] -Parameter Sets: DisplayNameWithKeyCredentialParameterSet, ApplicationWithKeyCredentialParameterSet, ApplicationObjectWithKeyCredentialParameterSet +Parameter Sets: DisplayNameWithKeyCredentialParameterSet Aliases: KeyCredentials Required: True @@ -824,7 +669,7 @@ To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a h ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[] -Parameter Sets: DisplayNameWithPasswordCredentialParameterSet, ApplicationWithPasswordCredentialParameterSet, ApplicationObjectWithPasswordCredentialParameterSet +Parameter Sets: DisplayNameWithPasswordCredentialParameterSet Aliases: PasswordCredentials Required: True @@ -975,7 +820,7 @@ For an 'asymmetric' type credential, this must be set to on or after the date th ```yaml Type: System.DateTime -Parameter Sets: SimpleParameterSet, DisplayNameWithKeyPlainParameterSet, ApplicationWithKeyPlainParameterSet, ApplicationObjectWithPasswordPlainParameterSet, ApplicationObjectWithKeyPlainParameterSet +Parameter Sets: SimpleParameterSet, DisplayNameWithKeyPlainParameterSet Aliases: Required: False From aebcb388c46ecfb09f0b50758fefb53c73c6dbbb Mon Sep 17 00:00:00 2001 From: VeryEarly Date: Wed, 23 Feb 2022 21:11:54 +0800 Subject: [PATCH 2/2] update changelog, suppress breaking change issues --- src/Resources/Resources/ChangeLog.md | 3 +++ .../Exceptions/Az.Resources/BreakingChangeIssues.csv | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Resources/Resources/ChangeLog.md b/src/Resources/Resources/ChangeLog.md index 68c8d43069da..000f7132590f 100644 --- a/src/Resources/Resources/ChangeLog.md +++ b/src/Resources/Resources/ChangeLog.md @@ -19,6 +19,9 @@ --> ## Upcoming Release +* Fixed keycredential key format base64url -> byte [17131] +* Fixed add key credential overwrite existing one [17088] +* Deleted parameter sets cannot be reached for `New-AzADSericePrincipal` * Marked `ObjectType` as `Unknown` if object is not found or current account has insufficient privileges to get object type for role assignment [#16981] * Fixed that `Get-AzRoleAssignment` shows empty RoleDefinitionName for custom roles when not specifying scope [#16991] * Unified the returned `RoleDefinitionId` in PSRoleAssignment to GUID [#16991] diff --git a/tools/StaticAnalysis/Exceptions/Az.Resources/BreakingChangeIssues.csv b/tools/StaticAnalysis/Exceptions/Az.Resources/BreakingChangeIssues.csv index bf86f3e608a8..f28babc24b47 100644 --- a/tools/StaticAnalysis/Exceptions/Az.Resources/BreakingChangeIssues.csv +++ b/tools/StaticAnalysis/Exceptions/Az.Resources/BreakingChangeIssues.csv @@ -12,4 +12,11 @@ "Az.Resources","Update-AzADServicePrincipal","Update-AzADServicePrincipal","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Update-AzADServicePrincipal' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Update-AzADServicePrincipal'." "Az.Resources","Update-AzADServicePrincipal","Update-AzADServicePrincipal","0","1050","The parameter set 'SpApplicationIdWithDisplayNameParameterSet' for cmdlet 'Update-AzADServicePrincipal' has been removed.","Add parameter set 'SpApplicationIdWithDisplayNameParameterSet' back to cmdlet 'Update-AzADServicePrincipal'." "Az.Resources","Update-AzADServicePrincipal","Update-AzADServicePrincipal","0","1050","The parameter set 'InputObjectWithDisplayNameParameterSet' for cmdlet 'Update-AzADServicePrincipal' has been removed.","Add parameter set 'InputObjectWithDisplayNameParameterSet' back to cmdlet 'Update-AzADServicePrincipal'." -"Az.Resources","New-AzADUser","New-AzADUser","0","2020","The cmdlet 'New-AzADUser' no longer supports the type 'System.Management.Automation.SwitchParameter' for parameter 'AccountEnabled'.","Change the type for parameter 'AccountEnabled' back to 'System.Management.Automation.SwitchParameter'." \ No newline at end of file +"Az.Resources","New-AzADUser","New-AzADUser","0","2020","The cmdlet 'New-AzADUser' no longer supports the type 'System.Management.Automation.SwitchParameter' for parameter 'AccountEnabled'.","Change the type for parameter 'AccountEnabled' back to 'System.Management.Automation.SwitchParameter'." +"Az.Resources","New-AzADServicePrincipal","New-AzADServicePrincipal","0","1050","The parameter set 'ApplicationWithPasswordCredentialParameterSet' for cmdlet 'New-AzADServicePrincipal' has been removed.","Add parameter set 'ApplicationWithPasswordCredentialParameterSet' back to cmdlet 'New-AzADServicePrincipal'." +"Az.Resources","New-AzADServicePrincipal","New-AzADServicePrincipal","0","1050","The parameter set 'ApplicationWithKeyCredentialParameterSet' for cmdlet 'New-AzADServicePrincipal' has been removed.","Add parameter set 'ApplicationWithKeyCredentialParameterSet' back to cmdlet 'New-AzADServicePrincipal'." +"Az.Resources","New-AzADServicePrincipal","New-AzADServicePrincipal","0","1050","The parameter set 'ApplicationWithKeyPlainParameterSet' for cmdlet 'New-AzADServicePrincipal' has been removed.","Add parameter set 'ApplicationWithKeyPlainParameterSet' back to cmdlet 'New-AzADServicePrincipal'." +"Az.Resources","New-AzADServicePrincipal","New-AzADServicePrincipal","0","1050","The parameter set 'ApplicationObjectWithPasswordPlainParameterSet' for cmdlet 'New-AzADServicePrincipal' has been removed.","Add parameter set 'ApplicationObjectWithPasswordPlainParameterSet' back to cmdlet 'New-AzADServicePrincipal'." +"Az.Resources","New-AzADServicePrincipal","New-AzADServicePrincipal","0","1050","The parameter set 'ApplicationObjectWithKeyPlainParameterSet' for cmdlet 'New-AzADServicePrincipal' has been removed.","Add parameter set 'ApplicationObjectWithKeyPlainParameterSet' back to cmdlet 'New-AzADServicePrincipal'." +"Az.Resources","New-AzADServicePrincipal","New-AzADServicePrincipal","0","1050","The parameter set 'ApplicationObjectWithKeyCredentialParameterSet' for cmdlet 'New-AzADServicePrincipal' has been removed.","Add parameter set 'ApplicationObjectWithKeyCredentialParameterSet' back to cmdlet 'New-AzADServicePrincipal'." +"Az.Resources","New-AzADServicePrincipal","New-AzADServicePrincipal","0","1050","The parameter set 'ApplicationObjectWithPasswordCredentialParameterSet' for cmdlet 'New-AzADServicePrincipal' has been removed.","Add parameter set 'ApplicationObjectWithPasswordCredentialParameterSet' back to cmdlet 'New-AzADServicePrincipal'."