Skip to content

Commit 97b5d7b

Browse files
azure-pipelines[bot]azure-powershell-botVeryEarly
authored
Migrate Resources from generation to main (#26363)
* Move Resources to main * Update BreakingChangeIssues.csv * Update CredScanSuppressions.json (#26389) --------- Co-authored-by: azure-powershell-bot <[email protected]> Co-authored-by: Yabo Hu <[email protected]>
1 parent ce941f3 commit 97b5d7b

File tree

454 files changed

+38315
-24507
lines changed

Some content is hidden

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

454 files changed

+38315
-24507
lines changed

src/Resources/Authorization.Autorest/Az.Authorization.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@{
2-
GUID = '4e102780-308c-4967-9790-7a39f46355e6'
2+
GUID = '57a55527-7087-451e-84e4-04cf34c3f59d'
33
RootModule = './Az.Authorization.psm1'
44
ModuleVersion = '0.1.0'
55
CompatiblePSEditions = 'Core', 'Desktop'

src/Resources/Authorization.Autorest/build-module.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ if(-not $Isolated -and -not $Debugger) {
6767
$binFolder = Join-Path $PSScriptRoot 'bin'
6868
$objFolder = Join-Path $PSScriptRoot 'obj'
6969

70+
$isAzure = [System.Convert]::ToBoolean('true')
71+
7072
if(-not $Debugger) {
7173
Write-Host -ForegroundColor Green 'Cleaning build folders...'
7274
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
@@ -143,7 +145,7 @@ if($NoDocs) {
143145
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
144146
}
145147
$null = New-Item -ItemType Directory -Force -Path $docsFolder
146-
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
148+
$addComplexInterfaceInfo = !$isAzure
147149
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
148150
}
149151

@@ -178,5 +180,4 @@ if (-not $DisableAfterBuildTasks){
178180
}
179181
}
180182

181-
182-
Write-Host -ForegroundColor Green '-------------Done-------------'
183+
Write-Host -ForegroundColor Green '-------------Done-------------'

src/Resources/Authorization.Autorest/help/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: 4e102780-308c-4967-9790-7a39f46355e6
3+
Module Guid: 57a55527-7087-451e-84e4-04cf34c3f59d
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.authorization
55
Help Version: 1.0.0.0
66
Locale: en-US

src/Resources/MSGraph.Autorest/Az.MSGraph.format.ps1xml

Lines changed: 129 additions & 117 deletions
Large diffs are not rendered by default.

src/Resources/MSGraph.Autorest/Az.MSGraph.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.MSGraph.private.dll'
1313
FormatsToProcess = './Az.MSGraph.format.ps1xml'
14-
FunctionsToExport = 'Add-AzADAppPermission', 'Add-AzADGroupMember', 'Get-AzADAppCredential', 'Get-AzADAppFederatedCredential', 'Get-AzADApplication', 'Get-AzADAppPermission', 'Get-AzADGroup', 'Get-AzADGroupMember', 'Get-AzADGroupOwner', 'Get-AzADOrganization', 'Get-AzADServicePrincipal', 'Get-AzADServicePrincipalAppRoleAssignment', 'Get-AzADSpCredential', 'Get-AzADUser', 'New-AzADAppCredential', 'New-AzADAppFederatedCredential', 'New-AzADApplication', 'New-AzADGroup', 'New-AzADGroupOwner', 'New-AzADServicePrincipal', 'New-AzADServicePrincipalAppRoleAssignment', 'New-AzADSpCredential', 'New-AzADUser', 'Remove-AzADAppCredential', 'Remove-AzADAppFederatedCredential', 'Remove-AzADApplication', 'Remove-AzADAppPermission', 'Remove-AzADGroup', 'Remove-AzADGroupMember', 'Remove-AzADGroupOwner', 'Remove-AzADServicePrincipal', 'Remove-AzADServicePrincipalAppRoleAssignment', 'Remove-AzADSpCredential', 'Remove-AzADUser', 'Update-AzADAppFederatedCredential', 'Update-AzADApplication', 'Update-AzADGroup', 'Update-AzADServicePrincipal', 'Update-AzADServicePrincipalAppRoleAssignment', 'Update-AzADUser', '*'
15-
AliasesToExport = 'Get-AzADServicePrincipalCredential', 'New-AzADServicePrincipalCredential', 'Remove-AzADServicePrincipalCredential', 'Set-AzADApplication', 'Set-AzADServicePrincipal', 'Set-AzADUser', '*'
14+
FunctionsToExport = 'Add-AzADAppPermission', 'Add-AzADGroupMember', 'Get-AzADAppCredential', 'Get-AzADAppFederatedCredential', 'Get-AzADApplication', 'Get-AzADAppPermission', 'Get-AzADGroup', 'Get-AzADGroupMember', 'Get-AzADGroupOwner', 'Get-AzADOrganization', 'Get-AzADServicePrincipal', 'Get-AzADServicePrincipalAppRoleAssignment', 'Get-AzADSpCredential', 'Get-AzADUser', 'New-AzADAppCredential', 'New-AzADAppFederatedCredential', 'New-AzADApplication', 'New-AzADGroup', 'New-AzADGroupOwner', 'New-AzADServicePrincipal', 'New-AzADServicePrincipalAppRoleAssignment', 'New-AzADSpCredential', 'New-AzADUser', 'Remove-AzADAppCredential', 'Remove-AzADAppFederatedCredential', 'Remove-AzADApplication', 'Remove-AzADAppPermission', 'Remove-AzADGroup', 'Remove-AzADGroupMember', 'Remove-AzADGroupOwner', 'Remove-AzADServicePrincipal', 'Remove-AzADServicePrincipalAppRoleAssignment', 'Remove-AzADSpCredential', 'Remove-AzADUser', 'Update-AzADAppFederatedCredential', 'Update-AzADApplication', 'Update-AzADGroup', 'Update-AzADServicePrincipal', 'Update-AzADServicePrincipalAppRoleAssignment', 'Update-AzADUser'
15+
AliasesToExport = 'Get-AzADServicePrincipalCredential', 'New-AzADServicePrincipalCredential', 'Remove-AzADServicePrincipalCredential', 'Set-AzADApplication', 'Set-AzADServicePrincipal', 'Set-AzADUser'
1616
PrivateData = @{
1717
PSData = @{
1818
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'MSGraph'

src/Resources/MSGraph.Autorest/Az.MSGraph.psm1

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,19 @@
4747

4848
# Ask for the shared functionality table
4949
$VTable = Register-AzModule
50-
50+
5151
# Tweaks the pipeline on module load
5252
$instance.OnModuleLoad = $VTable.OnModuleLoad
5353

5454
# Following two delegates are added for telemetry
5555
$instance.GetTelemetryId = $VTable.GetTelemetryId
5656
$instance.Telemetry = $VTable.Telemetry
57-
57+
58+
# Delegate to sanitize the output object
59+
$instance.SanitizeOutput = $VTable.SanitizerHandler
60+
61+
# Delegate to get the telemetry info
62+
$instance.GetTelemetryInfo = $VTable.GetTelemetryInfo
5863

5964
# Tweaks the pipeline per call
6065
$instance.AddRequestUserAgentHandler = $VTable.AddRequestUserAgentHandler
@@ -65,26 +70,25 @@
6570
# Tweaks the pipeline per call
6671
$instance.AddAuthorizeRequestHandler = $VTable.AddAuthorizeRequestHandler
6772

68-
73+
6974
# Gets shared parameter values
7075
$instance.GetParameterValue = $VTable.GetParameterValue
71-
76+
7277
# Allows shared module to listen to events from this module
7378
$instance.EventListener = $VTable.EventListener
74-
79+
7580
# Gets shared argument completers
7681
$instance.ArgumentCompleter = $VTable.ArgumentCompleter
77-
82+
7883
# The name of the currently selected Azure profile
7984
$instance.ProfileName = $VTable.ProfileName
8085

81-
8286
# Load the custom module
8387
$customModulePath = Join-Path $PSScriptRoot './custom/Az.MSGraph.custom.psm1'
8488
if(Test-Path $customModulePath) {
8589
$null = Import-Module -Name $customModulePath
8690
}
87-
91+
8892
# Export nothing to clear implicit exports
8993
Export-ModuleMember
9094

@@ -104,12 +108,12 @@
104108
# Load the last folder if no profile is selected
105109
$profileDirectory = $directories | Select-Object -Last 1
106110
}
107-
111+
108112
if($profileDirectory) {
109113
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
110114
$exportsPath = $profileDirectory.FullName
111115
}
112-
116+
113117
if($exportsPath) {
114118
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
115119
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath

src/Resources/MSGraph.Autorest/README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
This directory contains the PowerShell module for the MSGraph service.
44

55
---
6-
## Status
7-
[![Az.MSGraph](https://img.shields.io/powershellgallery/v/Az.MSGraph.svg?style=flat-square&label=Az.MSGraph "Az.MSGraph")](https://www.powershellgallery.com/packages/Az.MSGraph/)
8-
96
## Info
107
- Modifiable: yes
118
- Generated: all
@@ -47,10 +44,6 @@ In this directory, run AutoRest:
4744
> see https://aka.ms/autorest
4845
4946
``` yaml
50-
version: "3.9.5"
51-
use-extension:
52-
"@autorest/powershell": "4.0.0-dev.14"
53-
5447
require:
5548
- $(this-folder)/../../readme.azure.noprofile.md
5649

@@ -71,6 +64,7 @@ endpoint-resource-id-key-name: MicrosoftGraphEndpointResourceId
7164
export-properties-for-dict: false
7265
nested-object-to-string: true
7366
add-api-version-in-model-namespace: true
67+
fixed-array: true
7468

7569
# Disable default settings and Set in to empty for msgraph
7670
default-exclude-tableview-properties: false
@@ -126,6 +120,23 @@ directive:
126120
where: $
127121
transform: if ($documentPath.endsWith("MSGraph.cs")) {$ = $.replace(/Count.ToString\(\)/g, "Count.ToString().ToLower()")}
128122

123+
- where:
124+
subject: ApplicationsApplication
125+
set:
126+
subject: Application
127+
- where:
128+
subject: GroupsGroup
129+
set:
130+
subject: Group
131+
- where:
132+
subject: ServicePrincipalsServicePrincipal
133+
set:
134+
subject: ServicePrincipal
135+
- where:
136+
subject: (UsersUser)(.*)
137+
set:
138+
subject: User$2
139+
129140
# hide user owned application cmdlets
130141
- where:
131142
subject: UserOwnedApplication|UserOwnedObject
@@ -232,9 +243,15 @@ directive:
232243
- where:
233244
subject: ^group$
234245
verb: ^Update$
235-
parameter-name: Id
246+
parameter-name: GroupId
236247
set:
237248
parameter-name: ObjectId
249+
- where:
250+
subject: ^group$
251+
verb: ^Update$
252+
parameter-name: ObjectId
253+
set:
254+
alias: GroupId
238255

239256
- where:
240257
subject: ^group$

src/Resources/MSGraph.Autorest/build-module.ps1

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
1313
# is regenerated.
1414
# ----------------------------------------------------------------------------------
15-
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX, [Switch]$DisableAfterBuildTasks)
15+
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX, [Switch]$DisableAfterBuildTasks)
1616
$ErrorActionPreference = 'Stop'
1717

1818
if($PSEdition -ne 'Core') {
1919
Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.'
2020
}
2121

22-
if(-not $Isolated -and -not $Debugger) {
22+
if(-not $NotIsolated -and -not $Debugger) {
2323
Write-Host -ForegroundColor Green 'Creating isolated process...'
2424
$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
25-
& "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
25+
& "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
2626

2727
if($LastExitCode -ne 0) {
2828
# Build failed. Don't attempt to run the module.
@@ -75,6 +75,8 @@ if(-not $Isolated -and -not $Debugger) {
7575
$binFolder = Join-Path $PSScriptRoot 'bin'
7676
$objFolder = Join-Path $PSScriptRoot 'obj'
7777

78+
$isAzure = [System.Convert]::ToBoolean('true')
79+
7880
if(-not $Debugger) {
7981
Write-Host -ForegroundColor Green 'Cleaning build folders...'
8082
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
@@ -131,6 +133,10 @@ $null = New-Item -ItemType Directory -Force -Path $examplesFolder
131133

132134
Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
133135
$modelCmdlets = @()
136+
$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
137+
if (Test-Path $modelCmdletFolder) {
138+
$null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
139+
}
134140
if ($modelCmdlets.Count -gt 0) {
135141
. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
136142
CreateModelCmdlet($modelCmdlets)
@@ -147,7 +153,8 @@ if($NoDocs) {
147153
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
148154
}
149155
$null = New-Item -ItemType Directory -Force -Path $docsFolder
150-
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid
156+
$addComplexInterfaceInfo = !$isAzure
157+
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
151158
}
152159

153160
Write-Host -ForegroundColor Green 'Creating format.ps1xml...'

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
1313
# is regenerated.
1414
# ----------------------------------------------------------------------------------
15-
param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
15+
param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
1616
$ErrorActionPreference = 'Stop'
1717

18-
if(-not $Isolated) {
18+
if(-not $NotIsolated) {
1919
Write-Host -ForegroundColor Green 'Creating isolated process...'
2020
$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
21-
& "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
21+
& "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
2222
return
2323
}
2424

0 commit comments

Comments
 (0)