Skip to content

Commit 3be834a

Browse files
VeryEarlyazure-powershell-botdingmeng-xue
authored
[Az.Resources] new features for MSGraph (#17849)
Force merge * Move Resources to release-2022-04-26 * Update ChangeLog.md * Update Az.Resources.md * Update Az.MSGraph.md Co-authored-by: azure-powershell-bot <[email protected]> Co-authored-by: Dingmeng Xue <[email protected]>
1 parent f67c618 commit 3be834a

File tree

251 files changed

+10403
-2551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+10403
-2551
lines changed

src/Resources/Authorization.Autorest/Az.Authorization.psm1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
}
2626
}
2727
if(-not $accountsModule) {
28-
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.2.3' } | Measure-Object).Count -gt 0
28+
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
2929
if($hasAdequateVersion) {
30-
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.2.3 -Scope Global -PassThru
30+
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
3131
}
3232
}
3333
}
3434

3535
if(-not $accountsModule) {
36-
Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
37-
} elseif (($accountsModule.Version -lt [System.Version]'2.2.3') -and (-not $localAccounts)) {
38-
Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
36+
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
37+
} elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
38+
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
3939
}
4040
Write-Information "Loaded Module '$($accountsModule.Name)'"
4141

@@ -50,6 +50,10 @@
5050

5151
# Tweaks the pipeline on module load
5252
$instance.OnModuleLoad = $VTable.OnModuleLoad
53+
54+
# Following two delegates are added for telemetry
55+
$instance.GetTelemetryId = $VTable.GetTelemetryId
56+
$instance.Telemetry = $VTable.Telemetry
5357

5458

5559
# Tweaks the pipeline per call

src/Resources/Authorization.Autorest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This directory contains the PowerShell module for the Authorization service.
1717
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
1818

1919
## Module Requirements
20-
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater
20+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
2121

2222
## Authentication
2323
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.

src/Resources/Authorization.Autorest/check-dependencies.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if(Test-Path -Path $localModulesPath) {
4747
$env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
4848
}
4949

50-
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.2.3'
50+
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5'
5151
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
5252

5353
$tools = Join-Path $PSScriptRoot 'tools'

src/Resources/Authorization.Autorest/docs/Az.Authorization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Authorization
3-
Module Guid: 66aa3bd8-7952-4e71-915e-f7d169a2440e
3+
Module Guid: 136fb5a8-3586-4da0-81ac-bc68a68d314e
44
Download Help Link: https://docs.microsoft.com/powershell/module/az.authorization
55
Help Version: 1.0.0.0
66
Locale: en-US

src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,24 @@ begin {
171171
$PSBoundParameters['OutBuffer'] = 1
172172
}
173173
$parameterSet = $PSCmdlet.ParameterSetName
174+
175+
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
176+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString()
177+
}
178+
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
179+
if ($preTelemetryId -eq '') {
180+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
181+
[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
182+
} else {
183+
$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
184+
if ($internalCalledCmdlets -eq '') {
185+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
186+
} else {
187+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
188+
}
189+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
190+
}
191+
174192
$mapping = @{
175193
Get = 'Az.Authorization.private\Get-AzRoleAssignmentSchedule_Get';
176194
GetViaIdentity = 'Az.Authorization.private\Get-AzRoleAssignmentSchedule_GetViaIdentity';
@@ -183,6 +201,7 @@ begin {
183201
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
184202
$steppablePipeline.Begin($PSCmdlet)
185203
} catch {
204+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
186205
throw
187206
}
188207
}
@@ -191,15 +210,32 @@ process {
191210
try {
192211
$steppablePipeline.Process($_)
193212
} catch {
213+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
194214
throw
195215
}
196-
}
197216

217+
finally {
218+
$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
219+
$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
220+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
221+
}
222+
223+
}
198224
end {
199225
try {
200226
$steppablePipeline.End()
227+
228+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
229+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
230+
if ($preTelemetryId -eq '') {
231+
[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
232+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
233+
}
234+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
235+
201236
} catch {
237+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
202238
throw
203239
}
204-
}
240+
}
205241
}

src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,24 @@ begin {
171171
$PSBoundParameters['OutBuffer'] = 1
172172
}
173173
$parameterSet = $PSCmdlet.ParameterSetName
174+
175+
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
176+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString()
177+
}
178+
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
179+
if ($preTelemetryId -eq '') {
180+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
181+
[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
182+
} else {
183+
$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
184+
if ($internalCalledCmdlets -eq '') {
185+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
186+
} else {
187+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
188+
}
189+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
190+
}
191+
174192
$mapping = @{
175193
Get = 'Az.Authorization.private\Get-AzRoleAssignmentScheduleInstance_Get';
176194
GetViaIdentity = 'Az.Authorization.private\Get-AzRoleAssignmentScheduleInstance_GetViaIdentity';
@@ -183,6 +201,7 @@ begin {
183201
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
184202
$steppablePipeline.Begin($PSCmdlet)
185203
} catch {
204+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
186205
throw
187206
}
188207
}
@@ -191,15 +210,32 @@ process {
191210
try {
192211
$steppablePipeline.Process($_)
193212
} catch {
213+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
194214
throw
195215
}
196-
}
197216

217+
finally {
218+
$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
219+
$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
220+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
221+
}
222+
223+
}
198224
end {
199225
try {
200226
$steppablePipeline.End()
227+
228+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
229+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
230+
if ($preTelemetryId -eq '') {
231+
[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
232+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
233+
}
234+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
235+
201236
} catch {
237+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
202238
throw
203239
}
204-
}
240+
}
205241
}

src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,24 @@ begin {
171171
$PSBoundParameters['OutBuffer'] = 1
172172
}
173173
$parameterSet = $PSCmdlet.ParameterSetName
174+
175+
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
176+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString()
177+
}
178+
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
179+
if ($preTelemetryId -eq '') {
180+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
181+
[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
182+
} else {
183+
$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
184+
if ($internalCalledCmdlets -eq '') {
185+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
186+
} else {
187+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
188+
}
189+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
190+
}
191+
174192
$mapping = @{
175193
Get = 'Az.Authorization.private\Get-AzRoleAssignmentScheduleRequest_Get';
176194
GetViaIdentity = 'Az.Authorization.private\Get-AzRoleAssignmentScheduleRequest_GetViaIdentity';
@@ -183,6 +201,7 @@ begin {
183201
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
184202
$steppablePipeline.Begin($PSCmdlet)
185203
} catch {
204+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
186205
throw
187206
}
188207
}
@@ -191,15 +210,32 @@ process {
191210
try {
192211
$steppablePipeline.Process($_)
193212
} catch {
213+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
194214
throw
195215
}
196-
}
197216

217+
finally {
218+
$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
219+
$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
220+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
221+
}
222+
223+
}
198224
end {
199225
try {
200226
$steppablePipeline.End()
227+
228+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
229+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
230+
if ($preTelemetryId -eq '') {
231+
[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
232+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
233+
}
234+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
235+
201236
} catch {
237+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
202238
throw
203239
}
204-
}
240+
}
205241
}

src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,24 @@ begin {
171171
$PSBoundParameters['OutBuffer'] = 1
172172
}
173173
$parameterSet = $PSCmdlet.ParameterSetName
174+
175+
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
176+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString()
177+
}
178+
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
179+
if ($preTelemetryId -eq '') {
180+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
181+
[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
182+
} else {
183+
$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
184+
if ($internalCalledCmdlets -eq '') {
185+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
186+
} else {
187+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
188+
}
189+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
190+
}
191+
174192
$mapping = @{
175193
Get = 'Az.Authorization.private\Get-AzRoleEligibilitySchedule_Get';
176194
GetViaIdentity = 'Az.Authorization.private\Get-AzRoleEligibilitySchedule_GetViaIdentity';
@@ -183,6 +201,7 @@ begin {
183201
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
184202
$steppablePipeline.Begin($PSCmdlet)
185203
} catch {
204+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
186205
throw
187206
}
188207
}
@@ -191,15 +210,32 @@ process {
191210
try {
192211
$steppablePipeline.Process($_)
193212
} catch {
213+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
194214
throw
195215
}
196-
}
197216

217+
finally {
218+
$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
219+
$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
220+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
221+
}
222+
223+
}
198224
end {
199225
try {
200226
$steppablePipeline.End()
227+
228+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
229+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
230+
if ($preTelemetryId -eq '') {
231+
[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
232+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
233+
}
234+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
235+
201236
} catch {
237+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
202238
throw
203239
}
204-
}
240+
}
205241
}

0 commit comments

Comments
 (0)