@autorest/powershell 4.0.739 → 4.0.741

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.
@@ -77,7 +77,7 @@
77
77
  "powershell/models/model-extensions.ts": "2b3c129d070b0a30b01d32eb8998043c30b1bd7d",
78
78
  "powershell/module/module-class.ts": "ffef6105f5566125c72dc525dd33ed0ddd05b910",
79
79
  "powershell/module/module-namespace.ts": "f6afc90087e8d733f0323b0de8ba41d923955732",
80
- "powershell/package.json": "68a440080329d61ccc28c7a53ff9b1fce052bb79",
80
+ "powershell/package.json": "36fd3215ffadadd5121309a0380c0c6c3d7b6a25",
81
81
  "powershell/plugins/add-azure-completers-v2.ts": "46e91eb274a6a863315be8c0d5c9d84597654bce",
82
82
  "powershell/plugins/create-commands-v2.ts": "b4788ac66e3c21959b38f69a78d275991f90b660",
83
83
  "powershell/plugins/cs-namer-v2.ts": "f16981643ae24355e937ea717e33508e46dd2da2",
@@ -227,10 +227,10 @@
227
227
  "powershell/resources/psruntime/BuildTime/MarkdownRenderer.cs": "e8c3896a1b305d424abec25daefd9cb3549a694b",
228
228
  "powershell/resources/psruntime/BuildTime/Models/PsFormatTypes.cs": "40fffed4474e6e4c2d7a057370a2aa036001b09a",
229
229
  "powershell/resources/psruntime/BuildTime/Models/PsHelpMarkdownOutputs.cs": "056be554968d76667c0659d169f674ef5dbb74ed",
230
- "powershell/resources/psruntime/BuildTime/Models/PsHelpTypes.cs": "34d832146757eab7d8e1bd3feba5d411577f388a",
230
+ "powershell/resources/psruntime/BuildTime/Models/PsHelpTypes.cs": "4f239ab459b0abf4f3e1dc0cb7e6cf490fb9cf21",
231
231
  "powershell/resources/psruntime/BuildTime/Models/PsMarkdownTypes.cs": "c2c068932d2e4ab31a46d566e7b24f357f68c6f8",
232
232
  "powershell/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs": "345f1f9808087b45984e0dabc2400b1499b68c44",
233
- "powershell/resources/psruntime/BuildTime/Models/PsProxyTypes.cs": "965ff78cb2a5e33020bb6286330f06d191b5f459",
233
+ "powershell/resources/psruntime/BuildTime/Models/PsProxyTypes.cs": "75ea91810089fb5d7170f1bed0d8023aabd2f74a",
234
234
  "powershell/resources/psruntime/BuildTime/PsAttributes.cs": "42cd061f1a91cef396cd392584e7eab268c4bc3a",
235
235
  "powershell/resources/psruntime/BuildTime/PsExtensions.cs": "52083232ddc161a0f41496cbdf979d709c490194",
236
236
  "powershell/resources/psruntime/BuildTime/PsHelpers.cs": "c9bae00316dedb24a93eeebf73b2728fe9447494",
@@ -242,10 +242,10 @@
242
242
  "powershell/resources/psruntime/EventsExtensions.cs": "5e48b435c0a6c99a65ad95d650ffde11f9efe35e",
243
243
  "powershell/resources/psruntime/HttpPipeline.cs": "4516bef63e05634d04b5f06bdfaa90f372781756",
244
244
  "powershell/resources/psruntime/HttpPipelineMocking.ps1": "52f55ab1356870378ebb305f2e517cfd394b2156",
245
- "powershell/resources/psruntime/MessageAttribute.cs": "16a5ffafe7ad5c0c613caf799ec58ad5572622b6",
245
+ "powershell/resources/psruntime/MessageAttribute.cs": "e48d2538e92a0f002ef126f677b3108ec2f571ad",
246
246
  "powershell/resources/psruntime/MessageAttributeHelper.cs": "2efbd0e1a8a9a3b95030b307ac2879c0fd35fe29",
247
247
  "powershell/resources/psruntime/Properties/Resources.Designer.cs": "ac7efe778055c411b87b0d633841491d9e350140",
248
- "powershell/resources/psruntime/Properties/Resources.resx": "a08a2e50172b2515e33f003f7981b55bd46ff74d",
248
+ "powershell/resources/psruntime/Properties/Resources.resx": "4ef90b70573def55db4edb67adc7e68640723674",
249
249
  "powershell/resources/psruntime/TypeConverterExtensions.cs": "602599d518674ba4cba13cda445d7485f26a63bc",
250
250
  "powershell/resources/runtime/csharp/client/CmdInfoHandler.cs": "f6fcec8201c4e4d81a4f3af9ef07dfedf634f71d",
251
251
  "powershell/resources/runtime/csharp/client/Context.cs": "82ff28b553ab1f1472fee2c90558631ddce84969",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/powershell",
3
- "version": "4.0.739",
3
+ "version": "4.0.741",
4
4
  "description": "AutoRest PowerShell Cmdlet Generator",
5
5
  "main": "dist/exports.js",
6
6
  "typings": "dist/exports.d.ts",
@@ -36,14 +36,23 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
36
36
  public object Role { get; }
37
37
  public string NonTerminatingErrors { get; }
38
38
 
39
+ public static string CapitalizeFirstLetter(string text)
40
+ {
41
+ if (string.IsNullOrEmpty(text))
42
+ return text;
43
+
44
+ return char.ToUpper(text[0]) + text.Substring(1);
45
+ }
46
+
39
47
  public PsHelpInfo(PSObject helpObject = null)
40
48
  {
41
49
  helpObject = helpObject ?? new PSObject();
42
50
  CmdletName = helpObject.GetProperty<string>("Name").NullIfEmpty() ?? helpObject.GetNestedProperty<string>("details", "name");
43
51
  ModuleName = helpObject.GetProperty<string>("ModuleName");
44
- Synopsis = helpObject.GetProperty<string>("Synopsis");
52
+ Synopsis = CapitalizeFirstLetter(helpObject.GetProperty<string>("Synopsis"));
45
53
  Description = helpObject.GetProperty<PSObject[]>("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ??
46
54
  helpObject.GetNestedProperty<PSObject[]>("details", "description").EmptyIfNull().ToDescriptionText();
55
+ Description = CapitalizeFirstLetter(Description);
47
56
  AlertText = helpObject.GetNestedProperty<PSObject[]>("alertSet", "alert").EmptyIfNull().ToDescriptionText();
48
57
  Category = helpObject.GetProperty<string>("Category");
49
58
  HasCommonParameters = helpObject.GetProperty<string>("CommonParameters").ToNullableBool();
@@ -392,6 +392,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
392
392
  var helpInfo = variantGroup.HelpInfo;
393
393
  Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType<DescriptionAttribute>().FirstOrDefault()?.Description.NullIfEmpty()
394
394
  ?? helpInfo.Description.EmptyIfNull();
395
+ Description = PsHelpInfo.CapitalizeFirstLetter(Description);
395
396
  // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation.
396
397
  var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis;
397
398
  Synopsis = synopsis.NullIfEmpty() ?? Description;
@@ -16,9 +16,12 @@ namespace Microsoft.Message.ClientRuntime
16
16
  public class GenericBreakingChangeAttribute : Attribute
17
17
  {
18
18
  private string _message;
19
- //A dexcription of what the change is about, non mandatory
19
+ //A description of what the change is about, non mandatory
20
20
  public string ChangeDescription { get; set; } = null;
21
21
 
22
+ //Name of the module that is being deprecated
23
+ public string moduleName { get; set; } = String.IsNullOrEmpty(@"${$project.rootModuleName}") ? @"${$project.moduleName}" : @"${$project.rootModuleName}";
24
+
22
25
  //The version the change is effective from, non mandatory
23
26
  public string DeprecateByVersion { get; }
24
27
  public string DeprecateByAzVersion { get; }
@@ -82,7 +85,7 @@ namespace Microsoft.Message.ClientRuntime
82
85
  }
83
86
 
84
87
  writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion));
85
- writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion));
88
+ writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.moduleName, this.DeprecateByVersion));
86
89
 
87
90
  if (OldWay != null && NewWay != null)
88
91
  {
@@ -191,11 +194,11 @@ namespace Microsoft.Message.ClientRuntime
191
194
  this.IsEstimatedGaDateSet = true;
192
195
  }
193
196
  }
194
-
197
+
195
198
  public void PrintCustomAttributeInfo(Action<string> writeOutput)
196
199
  {
197
200
  writeOutput(this._message);
198
-
201
+
199
202
  if (IsEstimatedGaDateSet)
200
203
  {
201
204
  writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString()));
@@ -1705,7 +1705,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can
1705
1705
  </data>
1706
1706
  <data name="BreakingChangesAttributesInEffectByVersion" xml:space="preserve">
1707
1707
  <value>
1708
- - The change is expected to take effect from version : '{0}'</value>
1708
+ - The change is expected to take effect in '{0}' from version : '{1}'</value>
1709
1709
  </data>
1710
1710
  <data name="BreakingChangesAttributesUsageChangeMessage" xml:space="preserve">
1711
1711
  <value>```powershell