Skip to content

Commit c299c5a

Browse files
Move DataProtection to main
1 parent 0441386 commit c299c5a

File tree

893 files changed

+41303
-15906
lines changed

Some content is hidden

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

893 files changed

+41303
-15906
lines changed

src/DataProtection/Az.DataProtection.format.ps1xml

Lines changed: 576 additions & 230 deletions
Large diffs are not rendered by default.

src/DataProtection/Az.DataProtection.psd1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 12/31/2021
6+
# Generated on: 6/13/2022
77
#
88

99
@{
@@ -80,6 +80,7 @@ FunctionsToExport = 'Backup-AzDataProtectionBackupInstanceAdhoc',
8080
'Get-AzDataProtectionOperation',
8181
'Get-AzDataProtectionPolicyTemplate',
8282
'Get-AzDataProtectionRecoveryPoint',
83+
'Get-AzDataProtectionResourceGuard',
8384
'Initialize-AzDataProtectionBackupInstance',
8485
'Initialize-AzDataProtectionRestoreRequest',
8586
'New-AzDataProtectionBackupInstance',
@@ -88,15 +89,22 @@ FunctionsToExport = 'Backup-AzDataProtectionBackupInstanceAdhoc',
8889
'New-AzDataProtectionBackupVaultStorageSettingObject',
8990
'New-AzDataProtectionPolicyTagCriteriaClientObject',
9091
'New-AzDataProtectionPolicyTriggerScheduleClientObject',
92+
'New-AzDataProtectionResourceGuard',
9193
'New-AzDataProtectionRetentionLifeCycleClientObject',
9294
'Remove-AzDataProtectionBackupInstance',
9395
'Remove-AzDataProtectionBackupPolicy',
9496
'Remove-AzDataProtectionBackupVault',
97+
'Remove-AzDataProtectionResourceGuard',
98+
'Resume-AzDataProtectionBackupInstanceProtection',
9599
'Search-AzDataProtectionBackupInstanceInAzGraph',
96100
'Search-AzDataProtectionJobInAzGraph',
97101
'Start-AzDataProtectionBackupInstanceRestore',
102+
'Stop-AzDataProtectionBackupInstanceProtection',
103+
'Suspend-AzDataProtectionBackupInstanceBackup',
104+
'Sync-AzDataProtectionBackupInstance',
98105
'Update-AzDataProtectionBackupInstanceAssociatedPolicy',
99-
'Update-AzDataProtectionBackupVault'
106+
'Update-AzDataProtectionBackupVault',
107+
'Update-AzDataProtectionResourceGuard'
100108

101109
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
102110
CmdletsToExport = @()
@@ -134,7 +142,7 @@ PrivateData = @{
134142
# IconUri = ''
135143

136144
# ReleaseNotes of this module
137-
ReleaseNotes = '* Fixed trigger schedule client for ''New-AzDataProtectionPolicyTriggerScheduleClientObject'''
145+
# ReleaseNotes = ''
138146

139147
# Prerelease string of this module
140148
# Prerelease = ''
Lines changed: 89 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# region Generated
2-
# ----------------------------------------------------------------------------------
3-
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# ----------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
@@ -12,92 +12,104 @@
1212
# limitations under the License.
1313
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
1414
# is regenerated.
15-
# ----------------------------------------------------------------------------------
16-
# Load required Az.Accounts module
17-
$accountsName = 'Az.Accounts'
18-
$accountsModule = Get-Module -Name $accountsName
19-
if(-not $accountsModule) {
20-
$localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
21-
if(Test-Path -Path $localAccountsPath) {
22-
$localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
23-
if($localAccounts) {
24-
$accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
25-
}
26-
}
15+
# ----------------------------------------------------------------------------------
16+
# Load required Az.Accounts module
17+
$accountsName = 'Az.Accounts'
18+
$accountsModule = Get-Module -Name $accountsName
2719
if(-not $accountsModule) {
28-
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.2.3' } | Measure-Object).Count -gt 0
29-
if($hasAdequateVersion) {
30-
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.2.3 -Scope Global -PassThru
20+
$localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
21+
if(Test-Path -Path $localAccountsPath) {
22+
$localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
23+
if($localAccounts) {
24+
$accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
25+
}
26+
}
27+
if(-not $accountsModule) {
28+
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
29+
if($hasAdequateVersion) {
30+
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
31+
}
3132
}
3233
}
33-
}
34-
if(-not $accountsModule) {
35-
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
36-
} elseif (($accountsModule.Version -lt [System.Version]'2.2.3') -and (-not $localAccounts)) {
37-
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
38-
}
39-
Write-Information "Loaded Module '$($accountsModule.Name)'"
40-
# Load the private module dll
41-
$null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.DataProtection.private.dll')
42-
# Get the private module's instance
43-
$instance = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Module]::Instance
44-
# Ask for the shared functionality table
45-
$VTable = Register-AzModule
4634

47-
# Tweaks the pipeline on module load
48-
$instance.OnModuleLoad = $VTable.OnModuleLoad
49-
50-
# Tweaks the pipeline per call
51-
$instance.OnNewRequest = $VTable.OnNewRequest
35+
if(-not $accountsModule) {
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
39+
}
40+
Write-Information "Loaded Module '$($accountsModule.Name)'"
5241

53-
# Gets shared parameter values
54-
$instance.GetParameterValue = $VTable.GetParameterValue
42+
# Load the private module dll
43+
$null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.DataProtection.private.dll')
5544

56-
# Allows shared module to listen to events from this module
57-
$instance.EventListener = $VTable.EventListener
45+
# Get the private module's instance
46+
$instance = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Module]::Instance
5847

59-
# Gets shared argument completers
60-
$instance.ArgumentCompleter = $VTable.ArgumentCompleter
48+
# Ask for the shared functionality table
49+
$VTable = Register-AzModule
50+
51+
# Tweaks the pipeline on module load
52+
$instance.OnModuleLoad = $VTable.OnModuleLoad
6153

62-
# The name of the currently selected Azure profile
63-
$instance.ProfileName = $VTable.ProfileName
54+
# Following two delegates are added for telemetry
55+
$instance.GetTelemetryId = $VTable.GetTelemetryId
56+
$instance.Telemetry = $VTable.Telemetry
57+
6458

65-
# Load the custom module
66-
$customModulePath = Join-Path $PSScriptRoot './custom/Az.DataProtection.custom.psm1'
67-
if(Test-Path $customModulePath) {
68-
$null = Import-Module -Name $customModulePath
69-
}
59+
# Tweaks the pipeline per call
60+
$instance.OnNewRequest = $VTable.OnNewRequest
61+
62+
# Gets shared parameter values
63+
$instance.GetParameterValue = $VTable.GetParameterValue
64+
65+
# Allows shared module to listen to events from this module
66+
$instance.EventListener = $VTable.EventListener
67+
68+
# Gets shared argument completers
69+
$instance.ArgumentCompleter = $VTable.ArgumentCompleter
70+
71+
# The name of the currently selected Azure profile
72+
$instance.ProfileName = $VTable.ProfileName
7073

71-
# Export nothing to clear implicit exports
72-
Export-ModuleMember
73-
# Export proxy cmdlet scripts
74-
$exportsPath = Join-Path $PSScriptRoot './exports'
75-
$directories = Get-ChildItem -Directory -Path $exportsPath
76-
$profileDirectory = $null
77-
if($instance.ProfileName) {
78-
if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
79-
$profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
80-
} else {
81-
# Don't export anything if the profile doesn't exist for the module
82-
$exportsPath = $null
83-
Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
74+
75+
# Load the custom module
76+
$customModulePath = Join-Path $PSScriptRoot './custom/Az.DataProtection.custom.psm1'
77+
if(Test-Path $customModulePath) {
78+
$null = Import-Module -Name $customModulePath
8479
}
85-
} elseif(($directories | Measure-Object).Count -gt 0) {
86-
# Load the last folder if no profile is selected
87-
$profileDirectory = $directories | Select-Object -Last 1
88-
}
80+
81+
# Export nothing to clear implicit exports
82+
Export-ModuleMember
8983

90-
if($profileDirectory) {
91-
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
92-
$exportsPath = $profileDirectory.FullName
93-
}
84+
# Export proxy cmdlet scripts
85+
$exportsPath = Join-Path $PSScriptRoot './exports'
86+
$directories = Get-ChildItem -Directory -Path $exportsPath
87+
$profileDirectory = $null
88+
if($instance.ProfileName) {
89+
if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
90+
$profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
91+
} else {
92+
# Don't export anything if the profile doesn't exist for the module
93+
$exportsPath = $null
94+
Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
95+
}
96+
} elseif(($directories | Measure-Object).Count -gt 0) {
97+
# Load the last folder if no profile is selected
98+
$profileDirectory = $directories | Select-Object -Last 1
99+
}
100+
101+
if($profileDirectory) {
102+
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
103+
$exportsPath = $profileDirectory.FullName
104+
}
105+
106+
if($exportsPath) {
107+
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
108+
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
109+
Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
110+
}
94111

95-
if($exportsPath) {
96-
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
97-
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
98-
Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
99-
}
100-
# Finalize initialization of this module
101-
$instance.Init();
102-
Write-Information "Loaded Module '$($instance.Name)'"
112+
# Finalize initialization of this module
113+
$instance.Init();
114+
Write-Information "Loaded Module '$($instance.Name)'"
103115
# endregion

0 commit comments

Comments
 (0)