Skip to content

Commit bc4bce9

Browse files
Move Resources to main (Azure#21084)
1 parent d693836 commit bc4bce9

21 files changed

+118
-73
lines changed

src/Resources/Authorization.Autorest/create-model-cmdlets.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ function CreateModelCmdlet {
2323
}
2424

2525
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
26-
$ModuleName = ''
2726
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
2827
$null = New-Item -ItemType Directory -Force -Path $OutputDir
28+
if ('Az.Resources'.length -gt 0) {
29+
$ModuleName = 'Az.Resources'
30+
} else {
31+
$ModuleName = 'Az.Authorization'
32+
}
2933

3034
$CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
3135
$Content = ''
@@ -64,10 +68,10 @@ function CreateModelCmdlet {
6468
$ObjectType = $Model
6569
$ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
6670
# remove duplicated module name
67-
if ($ObjectType.StartsWith($ModuleName)) {
71+
if ($ObjectType.StartsWith('')) {
6872
$ModulePrefix = ''
6973
} else {
70-
$ModulePrefix = $ModuleName
74+
$ModulePrefix = ''
7175
}
7276
$OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
7377

@@ -158,7 +162,7 @@ Create an in-memory object for ${ObjectType}.
158162
.Outputs
159163
${ObjectTypeWithNamespace}
160164
.Link
161-
https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
165+
https://learn.microsoft.com/powershell/module/${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
162166
#>
163167
function New-Az${ModulePrefix}${ObjectType}Object {
164168
[OutputType('${ObjectTypeWithNamespace}')]

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: 6fd3fa0e-907d-4510-9563-4edf3773736d
3+
Module Guid: 5d67217e-5bcb-4c75-80ab-67f60154a5b2
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.authorization
55
Help Version: 1.0.0.0
66
Locale: en-US
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"swagger_commit": "2278f5552561a7959a49a1e38cb7ddbb349d1589",
3-
"autorest_core": "3.9.3",
42
"node": "v14.15.5",
5-
"autorest_modelerfour": "4.15.414",
6-
"autorest_powershell": "3.0.498",
7-
"autorest": "`-- (empty)"
3+
"autorest_powershell": "3.0.502",
4+
"autorest_core": "3.9.4",
5+
"swagger_commit": "b187f8bbf2171697f327ad16577c1b9cba2ef18e",
6+
"autorest": "`-- (empty)",
7+
"autorest_modelerfour": "4.15.414"
88
}

src/Resources/MSGraph.Autorest/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,12 @@ directive:
211211
- where:
212212
subject: UserSigned$
213213
hide: true
214-
214+
- where:
215+
parameter-name: AccountEnabled
216+
verb: Update
217+
subject: User
218+
set:
219+
parameter-description: "true for enabling the account; otherwise, false. Always true when combined with `-Password`. `-AccountEnabled $false` is ignored when changing the account's password."
215220
- where:
216221
verb: Get
217222
variant: ^List(.*)

src/Resources/MSGraph.Autorest/create-model-cmdlets.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ function CreateModelCmdlet {
2323
}
2424

2525
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
26-
$ModuleName = 'AD'
2726
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
2827
$null = New-Item -ItemType Directory -Force -Path $OutputDir
28+
if ('Az.Resources'.length -gt 0) {
29+
$ModuleName = 'Az.Resources'
30+
} else {
31+
$ModuleName = 'Az.MSGraph'
32+
}
2933

3034
$CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
3135
$Content = ''
@@ -64,10 +68,10 @@ function CreateModelCmdlet {
6468
$ObjectType = $Model
6569
$ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
6670
# remove duplicated module name
67-
if ($ObjectType.StartsWith($ModuleName)) {
71+
if ($ObjectType.StartsWith('AD')) {
6872
$ModulePrefix = ''
6973
} else {
70-
$ModulePrefix = $ModuleName
74+
$ModulePrefix = 'AD'
7175
}
7276
$OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
7377

@@ -158,7 +162,7 @@ Create an in-memory object for ${ObjectType}.
158162
.Outputs
159163
${ObjectTypeWithNamespace}
160164
.Link
161-
https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
165+
https://learn.microsoft.com/powershell/module/${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
162166
#>
163167
function New-Az${ModulePrefix}${ObjectType}Object {
164168
[OutputType('${ObjectTypeWithNamespace}')]

src/Resources/MSGraph.Autorest/custom/Get-AzADAppFederatedIdentityCredential.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Get federatedIdentityCredentials by Id from applications.
2020
.Description
2121
Get federatedIdentityCredentials by Id from applications.
2222
.Link
23-
https://learn.microsoft.com/powershell/module/az.resources/get-azadappfederatedidentitycredentials
23+
https://learn.microsoft.com/powershell/module/az.resources/get-azadappfederatedcredential
2424
#>
2525
function Get-AzADAppFederatedCredential {
2626
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential])]

src/Resources/MSGraph.Autorest/custom/New-AzADAppFederatedIdentityCredential.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Create federatedIdentityCredential for applications.
2020
.Description
2121
Create federatedIdentityCredential for applications.
2222
.Link
23-
https://learn.microsoft.com/powershell/module/az.resources/new-azadappfederatedidentitycredential
23+
https://learn.microsoft.com/powershell/module/az.resources/new-azadappfederatedcredential
2424
#>
2525
function New-AzADAppFederatedCredential {
2626
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential])]

src/Resources/MSGraph.Autorest/custom/Update-AzADUser.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,16 @@ function Update-AzADUser {
6464
[System.Boolean]
6565
[Alias('EnableAccount')]
6666
# true for enabling the account; otherwise, false.
67+
# Always true when combined with `-Password`.
68+
# `-AccountEnabled $false` is ignored when changing the account's password.
6769
${AccountEnabled},
6870

6971
[Parameter()]
7072
[SecureString]
71-
# Password for the user. It must meet the tenant's password complexity requirements. It is recommended to set a strong password.
73+
# The password for the user. This property is required when a user is created.
74+
# It can be updated, but the user will be required to change the password on the next login.
75+
# The password must satisfy minimum requirements as speci./fied by the user's passwordPolicies property.
76+
# By default, a strong password is required. When changing the password using this method, AccountEnabled is set to true.
7277
${Password},
7378

7479
[Parameter()]

src/Resources/MSGraph.Autorest/docs/Update-AzADUser.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ Update user by user principal name
8989

9090
### -AccountEnabled
9191
true for enabling the account; otherwise, false.
92+
Always true when combined with `-Password`.
93+
`-AccountEnabled $false` is ignored when changing the account's password.
9294

9395
```yaml
9496
Type: System.Boolean
@@ -585,9 +587,14 @@ Accept wildcard characters: False
585587
```
586588
587589
### -Password
588-
Password for the user.
589-
It must meet the tenant's password complexity requirements.
590-
It is recommended to set a strong password.
590+
The password for the user.
591+
This property is required when a user is created.
592+
593+
It can be updated, but the user will be required to change the password on the next login.
594+
595+
The password must satisfy minimum requirements as speci./fied by the user's passwordPolicies property.
596+
By default, a strong password is required.
597+
When changing the password using this method, AccountEnabled is set to true.
591598
592599
```yaml
593600
Type: System.Security.SecureString

src/Resources/MSGraph.Autorest/exports/Get-AzADAppFederatedCredential.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ APPLICATIONOBJECT <MicrosoftGraphApplication>: application object
165165
[DeletedDateTime <DateTime?>]: Date and time when this object was deleted. Always null when the object hasn't been deleted.
166166
[DisplayName <String>]: The name displayed in directory
167167
.Link
168-
https://learn.microsoft.com/powershell/module/az.resources/get-azadappfederatedidentitycredentials
168+
https://learn.microsoft.com/powershell/module/az.resources/get-azadappfederatedcredential
169169
#>
170170
function Get-AzADAppFederatedCredential {
171171
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential])]

0 commit comments

Comments
 (0)