@autorest/powershell 3.0.514 → 3.0.516

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,7 @@
21
21
  "powershell/generators/psm1.custom.ts": "7977240814d1a71c9ab05dc51d0266fa505a4833",
22
22
  "powershell/generators/psm1.internal.ts": "76911b9c45af5a17197c1c8e5db7ebe6c9afea4e",
23
23
  "powershell/generators/psm1.ts": "c0af240d4e0b04409685180ecbecfd91fe8c0b09",
24
- "powershell/generators/readme.ts": "b8563b454f6deaeb4d66424ebc278b90a5836776",
24
+ "powershell/generators/readme.ts": "7b6bd39f2b2984209d1bf4eab6a4f7707b1dc354",
25
25
  "powershell/generators/script-cmdlet.ts": "bf8a72600f7fc351176ff510cb85bc5f38378bfb",
26
26
  "powershell/internal/name-inferrer.ts": "425704ee9cbf78949f9021861db6e8a148a7b2d3",
27
27
  "powershell/internal/powershell-declarations.ts": "813d9eed0c12f90d2bc8bba08ae1c81529fd3bcc",
@@ -72,7 +72,7 @@
72
72
  "powershell/models/model-extensions.ts": "92f57419e2bb8aec5272d62742ad528caebb66f4",
73
73
  "powershell/module/module-class.ts": "c792f01e3bfecb7c22efd953feb175f6b8394c78",
74
74
  "powershell/module/module-namespace.ts": "f6afc90087e8d733f0323b0de8ba41d923955732",
75
- "powershell/package.json": "3179bdb12ee275001db8de9fe954c6d3f36afc23",
75
+ "powershell/package.json": "8908cb2667590c2a8bcf3fc0c45d9868c66a38ea",
76
76
  "powershell/plugins/add-azure-completers-v2.ts": "557ce4326318c82f91445490a162f20fa029fed3",
77
77
  "powershell/plugins/create-commands-v2.ts": "0190353c046a386a6458d2394377da59ae271643",
78
78
  "powershell/plugins/cs-namer-v2.ts": "e294a2f5ac3db421d030a3bba8343a3d4a9ea6ab",
@@ -101,12 +101,12 @@
101
101
  "powershell/resources/assets/pack-module.ps1": "3a263c5fd58c6f124693c3004db4b960ed579f39",
102
102
  "powershell/resources/assets/resources/README.md": "c532566d4700f25121ebf7cd78071002f888d096",
103
103
  "powershell/resources/assets/run-module.ps1": "eb6557320316b6de2c2ec3ab39f9c10c54fcd9cd",
104
- "powershell/resources/assets/test-module.ps1": "517b9d1e7b781a2b47a058645cce3ab1c991ab36",
104
+ "powershell/resources/assets/test-module.ps1": "3a1055f2c698041d3b4234383c1e77efa211a57d",
105
105
  "powershell/resources/assets/test/README.md": "bef2317f03ce8baf52bff238510e27a0ffe79aaa",
106
- "powershell/resources/assets/test/loadEnv.ps1": "1d350fe78c673fb88c577c04f61277ab75bdcf25",
106
+ "powershell/resources/assets/test/loadEnv.ps1": "079c89ae2f53e8f9be1489838594b6bc0c555602",
107
107
  "powershell/resources/assets/tools/Resources/.gitattributes": "2125666142eb661091cc5f32af2ed2f3fc65571d",
108
108
  "powershell/resources/assets/tools/Resources/.gitignore": "8b93ac424812ec6872783420ed87e82d10f2242b",
109
- "powershell/resources/assets/tools/Resources/README.md": "31fed0aedd4e2624b00f92efafbaa285e52aaa4f",
109
+ "powershell/resources/assets/tools/Resources/README.md": "cdaf3a995a725177a11845056d23cfd14e2bb5c2",
110
110
  "powershell/resources/assets/tools/Resources/custom/New-AzDeployment.ps1": "131b39a02d7fe531d7e33fc76b542078b1214ffa",
111
111
  "powershell/resources/assets/tools/Resources/docs/README.md": "3b56cb561c1faa09c38cd1cce8553110175f0400",
112
112
  "powershell/resources/assets/tools/Resources/examples/README.md": "ac871d71fc727e571a0eec3e0b02c21b045be88f",
@@ -216,7 +216,7 @@
216
216
  "powershell/resources/psruntime/BuildTime/Models/PsHelpMarkdownOutputs.cs": "056be554968d76667c0659d169f674ef5dbb74ed",
217
217
  "powershell/resources/psruntime/BuildTime/Models/PsHelpTypes.cs": "34d832146757eab7d8e1bd3feba5d411577f388a",
218
218
  "powershell/resources/psruntime/BuildTime/Models/PsMarkdownTypes.cs": "04c8ab64ab6269ee2cf7193494425d869bb6b94d",
219
- "powershell/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs": "9ed5b71113bf747288c8d96e44b94da3c83029b4",
219
+ "powershell/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs": "9d5cfa42acda3a0e411a441f0d826e43bc3379d2",
220
220
  "powershell/resources/psruntime/BuildTime/Models/PsProxyTypes.cs": "d12d48f864b20004aa129623ebd032e8f16cdee2",
221
221
  "powershell/resources/psruntime/BuildTime/PsAttributes.cs": "6e9782492bcc53aec43e807ca6c24969771b772b",
222
222
  "powershell/resources/psruntime/BuildTime/PsExtensions.cs": "a816496e5ec66952ba2f8f3709f665b02e24020a",
@@ -320,6 +320,7 @@
320
320
  "powershell/resources/runtime/csharp/pipeline/delegates.cs": "3abbd1354807e026f0d05a72e7d538533d775984",
321
321
  "powershell/resources/runtime/csharp/xml/IXmlSerializable.cs": "4ec8c13c3edc40460647700ab83cd5c632caa1e7",
322
322
  "powershell/resources/signing/MSSharedLibKey.snk": "695f1b38774e839e5b90059bfb7f32df1dff4223",
323
+ "powershell/resources/utils/Get-SubscriptionIdTestSafe.ps1": "5319862d3372af080cc563328c861f4378d66f4e",
323
324
  "powershell/resources/utils/Unprotect-SecureString.ps1": "cb05b51a6220840d617a439a947a359f8685a05d",
324
325
  "powershell/test/noun-cleaning.ts": "417bad4010ba2831134b54f7bf4070ca00919944",
325
326
  "powershell/test/operationId-inferring.ts": "81d8c4ad530768e911901868fea21bdfba836dd7",
@@ -1 +1 @@
1
- {"version":3,"file":"readme.d.ts","sourceRoot":"","sources":["../../generators/readme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,iBAkCpD"}
1
+ {"version":3,"file":"readme.d.ts","sourceRoot":"","sources":["../../generators/readme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,iBA+BpD"}
@@ -21,9 +21,6 @@ AutoRest does not generate authentication code for the module. Authentication is
21
21
  This directory contains the PowerShell module for the ${project.serviceName} service.
22
22
 
23
23
  ---
24
- ## Status
25
- [![${project.moduleName}](https://img.shields.io/powershellgallery/v/${project.moduleName}.svg?style=flat-square&label=${project.moduleName} "${project.moduleName}")](https://www.powershellgallery.com/packages/${project.moduleName}/)
26
-
27
24
  ## Info
28
25
  - Modifiable: yes
29
26
  - Generated: all
@@ -1 +1 @@
1
- {"version":3,"file":"readme.js","sourceRoot":"","sources":["../../generators/readme.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAGhG,qDAAiD;AAE1C,KAAK,UAAU,cAAc,CAAC,OAAgB;IACnD,MAAM,EAAE,GAAG,IAAI,gBAAM,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1E,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,SAAS,GAAG;;2FAE2E,OAAO,CAAC,sBAAsB;;;;CAIxH,CAAC;KACC;IAED,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,UAAU;wDACO,OAAO,CAAC,WAAW;;;;KAItE,OAAO,CAAC,UAAU,gDAAgD,OAAO,CAAC,UAAU,gCAAgC,OAAO,CAAC,UAAU,KAAK,OAAO,CAAC,UAAU,kDAAkD,OAAO,CAAC,UAAU;;;;;;;;;;;EAWpO,SAAS;;0CAE+B,OAAO,CAAC,UAAU,iCAAiC,CAAC,CAAC;IAC7F,EAAE,CAAC,IAAI,EAAE,CAAC;IACV,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,mBAAmB,CAAC,CAAC;AACnF,CAAC;AAlCD,wCAkCC"}
1
+ {"version":3,"file":"readme.js","sourceRoot":"","sources":["../../generators/readme.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAGhG,qDAAiD;AAE1C,KAAK,UAAU,cAAc,CAAC,OAAgB;IACnD,MAAM,EAAE,GAAG,IAAI,gBAAM,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1E,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,SAAS,GAAG;;2FAE2E,OAAO,CAAC,sBAAsB;;;;CAIxH,CAAC;KACC;IAED,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,UAAU;wDACO,OAAO,CAAC,WAAW;;;;;;;;;;;;EAYzE,SAAS;;0CAE+B,OAAO,CAAC,UAAU,iCAAiC,CAAC,CAAC;IAC7F,EAAE,CAAC,IAAI,EAAE,CAAC;IACV,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,mBAAmB,CAAC,CAAC;AACnF,CAAC;AA/BD,wCA+BC"}
@@ -23,9 +23,6 @@ AutoRest does not generate authentication code for the module. Authentication is
23
23
  This directory contains the PowerShell module for the ${project.serviceName} service.
24
24
 
25
25
  ---
26
- ## Status
27
- [![${project.moduleName}](https://img.shields.io/powershellgallery/v/${project.moduleName}.svg?style=flat-square&label=${project.moduleName} "${project.moduleName}")](https://www.powershellgallery.com/packages/${project.moduleName}/)
28
-
29
26
  ## Info
30
27
  - Modifiable: yes
31
28
  - Generated: all
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/powershell",
3
- "version": "3.0.514",
3
+ "version": "3.0.516",
4
4
  "description": "AutoRest PowerShell Cmdlet Generator",
5
5
  "main": "dist/exports.js",
6
6
  "typings": "dist/exports.d.ts",
@@ -14,5 +14,5 @@ if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) {
14
14
  $env = @{}
15
15
  if (Test-Path -Path $envFilePath) {
16
16
  $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json
17
- $PSDefaultParameterValues=@{"*:SubscriptionId"=$env.SubscriptionId; "*:Tenant"=$env.Tenant}
17
+ $PSDefaultParameterValues=@{"*:Tenant"=$env.Tenant}
18
18
  }
@@ -63,13 +63,14 @@ try
63
63
  if ($TestMode -ne 'playback')
64
64
  {
65
65
  setupEnv
66
+ } else {
67
+ $env:AzPSAutorestTestPlaybackMode = $true
66
68
  }
67
69
  $testFolder = Join-Path $PSScriptRoot '${$lib.path.relative($project.baseFolder, $project.testFolder)}'
68
70
  if ($null -ne $TestName)
69
71
  {
70
72
  Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml")
71
- } else
72
- {
73
+ } else {
73
74
  Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml")
74
75
  }
75
76
  } Finally
@@ -78,6 +79,9 @@ try
78
79
  {
79
80
  cleanupEnv
80
81
  }
82
+ else {
83
+ $env:AzPSAutorestTestPlaybackMode = ''
84
+ }
81
85
  }
82
86
 
83
87
  Write-Host -ForegroundColor Green '-------------Done-------------'
@@ -3,9 +3,6 @@
3
3
  This directory contains the PowerShell module for the Resources service.
4
4
 
5
5
  ---
6
- ## Status
7
- [![Az.Resources.TestSupport](https://img.shields.io/powershellgallery/v/Az.Resources.TestSupport.svg?style=flat-square&label=Az.Resources.TestSupport "Az.Resources.TestSupport")](https://www.powershellgallery.com/packages/Az.Resources.TestSupport/)
8
-
9
6
  ## Info
10
7
  - Modifiable: yes
11
8
  - Generated: all
@@ -269,9 +269,26 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
269
269
  var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList();
270
270
  var parameterName = defaultInfo.ParameterGroup.ParameterName;
271
271
  sb.AppendLine();
272
- sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{");
273
- sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}");
274
- sb.Append($"{Indent}{Indent}}}");
272
+ //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to
273
+ //override default value set in required readme
274
+ if ("SubscriptionId".Equals(parameterName))
275
+ {
276
+ sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{");
277
+ sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false");
278
+ sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ $testPlayback = $testPlayback -or ('Microsoft.Message.ClientRuntime.PipelineMock' -eq $_.Target.GetType().FullName) }}");
279
+ sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{");
280
+ sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')");
281
+ sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{");
282
+ sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}");
283
+ sb.AppendLine($"{Indent}{Indent}{Indent}}}");
284
+ sb.Append($"{Indent}{Indent}}}");
285
+ }
286
+ else
287
+ {
288
+ sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{");
289
+ sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}");
290
+ sb.Append($"{Indent}{Indent}}}");
291
+ }
275
292
  }
276
293
  return sb.ToString();
277
294
  }
@@ -0,0 +1,7 @@
1
+ param()
2
+ if ($env:AzPSAutorestTestPlaybackMode) {
3
+ $loadEnvPath = Join-Path $PSScriptRoot '..' 'test' 'loadEnv.ps1'
4
+ . ($loadEnvPath)
5
+ return $env.SubscriptionId
6
+ }
7
+ return (Get-AzContext).Subscription.Id