@autorest/powershell 2.1.401 → 3.0.0

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.
Files changed (477) hide show
  1. package/.rush/temp/package-deps_build.json +213 -186
  2. package/.rush/temp/shrinkwrap-deps.json +322 -326
  3. package/autorest-configuration.md +60 -47
  4. package/dist/cmdlets/class.d.ts +21 -8
  5. package/dist/cmdlets/class.d.ts.map +1 -1
  6. package/dist/cmdlets/class.js +475 -151
  7. package/dist/cmdlets/class.js.map +1 -1
  8. package/dist/cmdlets/namespace.d.ts.map +1 -1
  9. package/dist/cmdlets/namespace.js +1 -0
  10. package/dist/cmdlets/namespace.js.map +1 -1
  11. package/dist/enums/namespace.d.ts.map +1 -1
  12. package/dist/enums/namespace.js +17 -10
  13. package/dist/enums/namespace.js.map +1 -1
  14. package/dist/generators/csproj.d.ts.map +1 -1
  15. package/dist/generators/csproj.js +2 -1
  16. package/dist/generators/csproj.js.map +1 -1
  17. package/dist/generators/gitignore.d.ts.map +1 -1
  18. package/dist/generators/gitignore.js +1 -0
  19. package/dist/generators/gitignore.js.map +1 -1
  20. package/dist/generators/nuspec.d.ts.map +1 -1
  21. package/dist/generators/nuspec.js +4 -3
  22. package/dist/generators/nuspec.js.map +1 -1
  23. package/dist/generators/psm1.d.ts.map +1 -1
  24. package/dist/generators/psm1.js +24 -15
  25. package/dist/generators/psm1.js.map +1 -1
  26. package/dist/generators/script-cmdlet.d.ts.map +1 -1
  27. package/dist/generators/script-cmdlet.js +1 -1
  28. package/dist/generators/script-cmdlet.js.map +1 -1
  29. package/dist/internal/name-inferrer.d.ts.map +1 -1
  30. package/dist/internal/name-inferrer.js +2 -0
  31. package/dist/internal/name-inferrer.js.map +1 -1
  32. package/dist/internal/project.d.ts +46 -5
  33. package/dist/internal/project.d.ts.map +1 -1
  34. package/dist/internal/project.js +72 -13
  35. package/dist/internal/project.js.map +1 -1
  36. package/dist/internal/state.d.ts +3 -2
  37. package/dist/internal/state.d.ts.map +1 -1
  38. package/dist/internal/state.js +3 -3
  39. package/dist/internal/state.js.map +1 -1
  40. package/dist/llcsharp/clientruntime.d.ts +5 -0
  41. package/dist/llcsharp/clientruntime.d.ts.map +1 -1
  42. package/dist/llcsharp/clientruntime.js +5 -0
  43. package/dist/llcsharp/clientruntime.js.map +1 -1
  44. package/dist/llcsharp/enums/enum.d.ts +2 -2
  45. package/dist/llcsharp/enums/enum.d.ts.map +1 -1
  46. package/dist/llcsharp/enums/enum.js +11 -10
  47. package/dist/llcsharp/enums/enum.js.map +1 -1
  48. package/dist/llcsharp/generator.d.ts +3 -3
  49. package/dist/llcsharp/generator.d.ts.map +1 -1
  50. package/dist/llcsharp/generator.js +4 -2
  51. package/dist/llcsharp/generator.js.map +1 -1
  52. package/dist/llcsharp/model/interface.d.ts +3 -2
  53. package/dist/llcsharp/model/interface.d.ts.map +1 -1
  54. package/dist/llcsharp/model/interface.js +68 -17
  55. package/dist/llcsharp/model/interface.js.map +1 -1
  56. package/dist/llcsharp/model/model-class-dictionary.d.ts.map +1 -1
  57. package/dist/llcsharp/model/model-class-dictionary.js +12 -6
  58. package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
  59. package/dist/llcsharp/model/model-class-json.d.ts.map +1 -1
  60. package/dist/llcsharp/model/model-class-json.js +20 -12
  61. package/dist/llcsharp/model/model-class-json.js.map +1 -1
  62. package/dist/llcsharp/model/model-class-serializer.d.ts +9 -21
  63. package/dist/llcsharp/model/model-class-serializer.d.ts.map +1 -1
  64. package/dist/llcsharp/model/model-class-serializer.js +21 -50
  65. package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
  66. package/dist/llcsharp/model/model-class.d.ts +7 -4
  67. package/dist/llcsharp/model/model-class.d.ts.map +1 -1
  68. package/dist/llcsharp/model/model-class.js +147 -82
  69. package/dist/llcsharp/model/model-class.js.map +1 -1
  70. package/dist/llcsharp/model/namespace.d.ts +4 -4
  71. package/dist/llcsharp/model/namespace.d.ts.map +1 -1
  72. package/dist/llcsharp/model/namespace.js +40 -18
  73. package/dist/llcsharp/model/namespace.js.map +1 -1
  74. package/dist/llcsharp/model/property.d.ts +4 -4
  75. package/dist/llcsharp/model/property.d.ts.map +1 -1
  76. package/dist/llcsharp/model/property.js +9 -7
  77. package/dist/llcsharp/model/property.js.map +1 -1
  78. package/dist/llcsharp/operation/api-class.d.ts.map +1 -1
  79. package/dist/llcsharp/operation/api-class.js +24 -23
  80. package/dist/llcsharp/operation/api-class.js.map +1 -1
  81. package/dist/llcsharp/operation/method.d.ts +7 -5
  82. package/dist/llcsharp/operation/method.d.ts.map +1 -1
  83. package/dist/llcsharp/operation/method.js +157 -93
  84. package/dist/llcsharp/operation/method.js.map +1 -1
  85. package/dist/llcsharp/operation/namespace.js +2 -1
  86. package/dist/llcsharp/operation/namespace.js.map +1 -1
  87. package/dist/llcsharp/operation/parameter.d.ts +4 -4
  88. package/dist/llcsharp/operation/parameter.d.ts.map +1 -1
  89. package/dist/llcsharp/operation/parameter.js +7 -5
  90. package/dist/llcsharp/operation/parameter.js.map +1 -1
  91. package/dist/llcsharp/project.d.ts +4 -0
  92. package/dist/llcsharp/project.d.ts.map +1 -1
  93. package/dist/llcsharp/project.js +7 -2
  94. package/dist/llcsharp/project.js.map +1 -1
  95. package/dist/llcsharp/schema/Uuid.d.ts +2 -2
  96. package/dist/llcsharp/schema/Uuid.d.ts.map +1 -1
  97. package/dist/llcsharp/schema/Uuid.js.map +1 -1
  98. package/dist/llcsharp/schema/array.d.ts +3 -3
  99. package/dist/llcsharp/schema/array.d.ts.map +1 -1
  100. package/dist/llcsharp/schema/array.js +15 -8
  101. package/dist/llcsharp/schema/array.js.map +1 -1
  102. package/dist/llcsharp/schema/binary.d.ts +3 -3
  103. package/dist/llcsharp/schema/binary.d.ts.map +1 -1
  104. package/dist/llcsharp/schema/binary.js.map +1 -1
  105. package/dist/llcsharp/schema/boolean.d.ts +4 -4
  106. package/dist/llcsharp/schema/boolean.d.ts.map +1 -1
  107. package/dist/llcsharp/schema/boolean.js +1 -1
  108. package/dist/llcsharp/schema/boolean.js.map +1 -1
  109. package/dist/llcsharp/schema/byte-array.d.ts +3 -3
  110. package/dist/llcsharp/schema/byte-array.d.ts.map +1 -1
  111. package/dist/llcsharp/schema/byte-array.js +12 -2
  112. package/dist/llcsharp/schema/byte-array.js.map +1 -1
  113. package/dist/llcsharp/schema/char.d.ts +4 -4
  114. package/dist/llcsharp/schema/char.d.ts.map +1 -1
  115. package/dist/llcsharp/schema/char.js +3 -3
  116. package/dist/llcsharp/schema/char.js.map +1 -1
  117. package/dist/llcsharp/schema/date-time.d.ts +7 -7
  118. package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
  119. package/dist/llcsharp/schema/date-time.js +4 -4
  120. package/dist/llcsharp/schema/date-time.js.map +1 -1
  121. package/dist/llcsharp/schema/date.d.ts +2 -2
  122. package/dist/llcsharp/schema/date.d.ts.map +1 -1
  123. package/dist/llcsharp/schema/date.js.map +1 -1
  124. package/dist/llcsharp/schema/duration.d.ts +5 -5
  125. package/dist/llcsharp/schema/duration.d.ts.map +1 -1
  126. package/dist/llcsharp/schema/duration.js +2 -2
  127. package/dist/llcsharp/schema/duration.js.map +1 -1
  128. package/dist/llcsharp/schema/enum.d.ts +2 -2
  129. package/dist/llcsharp/schema/enum.d.ts.map +1 -1
  130. package/dist/llcsharp/schema/enum.js +5 -3
  131. package/dist/llcsharp/schema/enum.js.map +1 -1
  132. package/dist/llcsharp/schema/extended-type-declaration.d.ts +2 -2
  133. package/dist/llcsharp/schema/extended-type-declaration.d.ts.map +1 -1
  134. package/dist/llcsharp/schema/integer.d.ts +4 -4
  135. package/dist/llcsharp/schema/integer.d.ts.map +1 -1
  136. package/dist/llcsharp/schema/integer.js +1 -1
  137. package/dist/llcsharp/schema/integer.js.map +1 -1
  138. package/dist/llcsharp/schema/object.d.ts +3 -3
  139. package/dist/llcsharp/schema/object.d.ts.map +1 -1
  140. package/dist/llcsharp/schema/object.js +25 -21
  141. package/dist/llcsharp/schema/object.js.map +1 -1
  142. package/dist/llcsharp/schema/password.d.ts +23 -0
  143. package/dist/llcsharp/schema/password.d.ts.map +1 -0
  144. package/dist/llcsharp/schema/password.js +89 -0
  145. package/dist/llcsharp/schema/password.js.map +1 -0
  146. package/dist/llcsharp/schema/primitive.d.ts +4 -4
  147. package/dist/llcsharp/schema/primitive.d.ts.map +1 -1
  148. package/dist/llcsharp/schema/primitive.js +7 -3
  149. package/dist/llcsharp/schema/primitive.js.map +1 -1
  150. package/dist/llcsharp/schema/schema-resolver.d.ts +4 -3
  151. package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
  152. package/dist/llcsharp/schema/schema-resolver.js +61 -64
  153. package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
  154. package/dist/llcsharp/schema/string.d.ts +3 -3
  155. package/dist/llcsharp/schema/string.d.ts.map +1 -1
  156. package/dist/llcsharp/schema/string.js +14 -10
  157. package/dist/llcsharp/schema/string.js.map +1 -1
  158. package/dist/main.d.ts.map +1 -1
  159. package/dist/main.js +23 -14
  160. package/dist/main.js.map +1 -1
  161. package/dist/models/model-extensions.d.ts +3 -2
  162. package/dist/models/model-extensions.d.ts.map +1 -1
  163. package/dist/models/model-extensions.js +195 -168
  164. package/dist/models/model-extensions.js.map +1 -1
  165. package/dist/module/module-class.d.ts +4 -2
  166. package/dist/module/module-class.d.ts.map +1 -1
  167. package/dist/module/module-class.js +67 -13
  168. package/dist/module/module-class.js.map +1 -1
  169. package/dist/module/module-namespace.d.ts +2 -2
  170. package/dist/module/module-namespace.d.ts.map +1 -1
  171. package/dist/module/module-namespace.js +3 -2
  172. package/dist/module/module-namespace.js.map +1 -1
  173. package/dist/plugins/add-azure-completers-v2.d.ts +3 -0
  174. package/dist/plugins/add-azure-completers-v2.d.ts.map +1 -0
  175. package/dist/plugins/{add-azure-completers.js → add-azure-completers-v2.js} +7 -5
  176. package/dist/plugins/add-azure-completers-v2.js.map +1 -0
  177. package/dist/plugins/create-commands-v2.d.ts +40 -0
  178. package/dist/plugins/create-commands-v2.d.ts.map +1 -0
  179. package/dist/plugins/{create-commands.js → create-commands-v2.js} +128 -78
  180. package/dist/plugins/create-commands-v2.js.map +1 -0
  181. package/dist/plugins/cs-namer-v2.d.ts +3 -0
  182. package/dist/plugins/cs-namer-v2.d.ts.map +1 -0
  183. package/dist/plugins/cs-namer-v2.js +230 -0
  184. package/dist/plugins/cs-namer-v2.js.map +1 -0
  185. package/dist/plugins/llcsharp-v2.d.ts +3 -0
  186. package/dist/plugins/llcsharp-v2.d.ts.map +1 -0
  187. package/dist/plugins/{llcsharp.js → llcsharp-v2.js} +3 -3
  188. package/dist/plugins/llcsharp-v2.js.map +1 -0
  189. package/dist/plugins/modifiers-v2.d.ts +3 -0
  190. package/dist/plugins/modifiers-v2.d.ts.map +1 -0
  191. package/dist/plugins/{modifiers.js → modifiers-v2.js} +151 -32
  192. package/dist/plugins/modifiers-v2.js.map +1 -0
  193. package/dist/plugins/plugin-create-inline-properties.d.ts +4 -0
  194. package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -0
  195. package/dist/plugins/plugin-create-inline-properties.js +356 -0
  196. package/dist/plugins/plugin-create-inline-properties.js.map +1 -0
  197. package/dist/plugins/plugin-tweak-m4-model.d.ts +3 -0
  198. package/dist/plugins/plugin-tweak-m4-model.d.ts.map +1 -0
  199. package/dist/plugins/plugin-tweak-m4-model.js +166 -0
  200. package/dist/plugins/plugin-tweak-m4-model.js.map +1 -0
  201. package/dist/plugins/plugin-tweak-model-azure-v2.d.ts +3 -0
  202. package/dist/plugins/plugin-tweak-model-azure-v2.d.ts.map +1 -0
  203. package/dist/plugins/plugin-tweak-model-azure-v2.js +169 -0
  204. package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -0
  205. package/dist/plugins/plugin-tweak-model.d.ts +9 -0
  206. package/dist/plugins/plugin-tweak-model.d.ts.map +1 -0
  207. package/dist/plugins/plugin-tweak-model.js +572 -0
  208. package/dist/plugins/plugin-tweak-model.js.map +1 -0
  209. package/dist/plugins/powershell-v2.d.ts +3 -0
  210. package/dist/plugins/powershell-v2.d.ts.map +1 -0
  211. package/dist/plugins/{powershell.js → powershell-v2.js} +9 -4
  212. package/dist/plugins/powershell-v2.js.map +1 -0
  213. package/dist/plugins/{ps-namer.d.ts → ps-namer-v2.d.ts} +2 -2
  214. package/dist/plugins/ps-namer-v2.d.ts.map +1 -0
  215. package/dist/plugins/{ps-namer.js → ps-namer-v2.js} +64 -49
  216. package/dist/plugins/ps-namer-v2.js.map +1 -0
  217. package/dist/utils/PwshModel.d.ts +8 -0
  218. package/dist/utils/PwshModel.d.ts.map +1 -0
  219. package/dist/utils/PwshModel.js +17 -0
  220. package/dist/utils/PwshModel.js.map +1 -0
  221. package/dist/utils/command-operation.d.ts +51 -0
  222. package/dist/utils/command-operation.d.ts.map +1 -0
  223. package/dist/utils/command-operation.js +33 -0
  224. package/dist/utils/command-operation.js.map +1 -0
  225. package/dist/utils/components.d.ts +133 -0
  226. package/dist/utils/components.d.ts.map +1 -0
  227. package/dist/utils/components.js +100 -0
  228. package/dist/utils/components.js.map +1 -0
  229. package/dist/utils/extensions.d.ts +11 -0
  230. package/dist/utils/extensions.d.ts.map +1 -0
  231. package/dist/utils/extensions.js +16 -0
  232. package/dist/utils/extensions.js.map +1 -0
  233. package/dist/utils/http-definitions.d.ts +45 -0
  234. package/dist/utils/http-definitions.d.ts.map +1 -0
  235. package/dist/utils/http-definitions.js +47 -0
  236. package/dist/utils/http-definitions.js.map +1 -0
  237. package/dist/utils/http-operation.d.ts +8 -0
  238. package/dist/utils/http-operation.d.ts.map +1 -0
  239. package/dist/utils/http-operation.js +254 -0
  240. package/dist/utils/http-operation.js.map +1 -0
  241. package/dist/utils/info.d.ts +36 -0
  242. package/dist/utils/info.d.ts.map +1 -0
  243. package/dist/utils/info.js +36 -0
  244. package/dist/utils/info.js.map +1 -0
  245. package/dist/utils/model-state.d.ts +44 -0
  246. package/dist/utils/model-state.d.ts.map +1 -0
  247. package/dist/utils/model-state.js +206 -0
  248. package/dist/utils/model-state.js.map +1 -0
  249. package/dist/utils/powershell-comment.d.ts +2 -0
  250. package/dist/utils/powershell-comment.d.ts.map +1 -0
  251. package/dist/utils/powershell-comment.js +25 -0
  252. package/dist/utils/powershell-comment.js.map +1 -0
  253. package/dist/utils/programatic-operation.d.ts +20 -0
  254. package/dist/utils/programatic-operation.d.ts.map +1 -0
  255. package/dist/utils/programatic-operation.js +29 -0
  256. package/dist/utils/programatic-operation.js.map +1 -0
  257. package/dist/utils/resolve-conflicts.d.ts +7 -0
  258. package/dist/utils/resolve-conflicts.d.ts.map +1 -0
  259. package/dist/utils/resolve-conflicts.js +57 -0
  260. package/dist/utils/resolve-conflicts.js.map +1 -0
  261. package/dist/utils/schema.d.ts +116 -0
  262. package/dist/utils/schema.d.ts.map +1 -0
  263. package/dist/utils/schema.js +186 -0
  264. package/dist/utils/schema.js.map +1 -0
  265. package/dist/utils/security-scheme.d.ts +123 -0
  266. package/dist/utils/security-scheme.d.ts.map +1 -0
  267. package/dist/utils/security-scheme.js +119 -0
  268. package/dist/utils/security-scheme.js.map +1 -0
  269. package/dist/utils/uid.d.ts +2 -0
  270. package/dist/utils/uid.d.ts.map +1 -0
  271. package/dist/utils/uid.js +8 -0
  272. package/dist/utils/uid.js.map +1 -0
  273. package/package.json +22 -21
  274. package/resources/assets/build-module.ps1 +12 -15
  275. package/resources/assets/check-dependencies.ps1 +4 -14
  276. package/resources/assets/create-model-cmdlets.ps1 +157 -0
  277. package/resources/assets/custom/{readme.md → README.md} +7 -7
  278. package/resources/assets/docs/README.md +11 -0
  279. package/resources/assets/examples/{readme.md → README.md} +0 -0
  280. package/resources/assets/export-surface.ps1 +1 -11
  281. package/resources/assets/exports/{readme.md → README.md} +2 -2
  282. package/resources/assets/generate-help.ps1 +2 -12
  283. package/resources/assets/how-to.md +5 -5
  284. package/resources/assets/internal/{readme.md → README.md} +3 -3
  285. package/resources/assets/pack-module.ps1 +1 -11
  286. package/resources/assets/resources/{readme.md → README.md} +0 -0
  287. package/resources/assets/run-module.ps1 +3 -11
  288. package/resources/assets/test/{readme.md → README.md} +0 -0
  289. package/resources/assets/test/loadEnv.ps1 +1 -11
  290. package/resources/assets/test-module.ps1 +39 -24
  291. package/resources/assets/tools/Resources/{readme.md → README.md} +3 -2
  292. package/resources/assets/tools/Resources/docs/{readme.md → README.md} +1 -1
  293. package/resources/assets/tools/Resources/examples/{readme.md → README.md} +0 -0
  294. package/resources/assets/tools/Resources/how-to.md +5 -5
  295. package/resources/assets/tools/Resources/resources/{readme.md → README.md} +0 -0
  296. package/resources/assets/tools/Resources/test/{readme.md → README.md} +0 -0
  297. package/resources/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml +496 -0
  298. package/resources/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml +468 -0
  299. package/resources/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml +303 -0
  300. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Az.Accounts.nuspec +5 -3
  301. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 +387 -0
  302. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 +375 -0
  303. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll +0 -0
  304. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll +0 -0
  305. package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies → 2.7.5/AzSharedAlcAssemblies}/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  306. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  307. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll +0 -0
  308. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll +0 -0
  309. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll +0 -0
  310. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Hyak.Common.dll +0 -0
  311. package/resources/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll +0 -0
  312. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.Common.dll +0 -0
  313. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
  314. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json +945 -404
  315. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
  316. package/resources/modules/Az.Accounts/{1.8.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json → 2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json} +906 -488
  317. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
  318. package/resources/modules/Az.Accounts/{1.8.1/Microsoft.Azure.PowerShell.Authentication.deps.json → 2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json} +301 -719
  319. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
  320. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  321. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
  322. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Authorization.dll +0 -0
  323. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Compute.dll +0 -0
  324. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
  325. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.KeyVault.dll +0 -0
  326. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Monitor.dll +0 -0
  327. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Network.dll +0 -0
  328. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll +0 -0
  329. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
  330. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
  331. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Websites.dll +0 -0
  332. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json +2413 -0
  333. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
  334. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml +3567 -1995
  335. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
  336. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll +0 -0
  337. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Storage.dll +0 -0
  338. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Strategies.dll +0 -0
  339. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Rest.ClientRuntime.Azure.dll +0 -0
  340. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll +0 -0
  341. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.WindowsAzure.Storage.DataMovement.dll +0 -0
  342. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.WindowsAzure.Storage.dll +0 -0
  343. package/resources/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 +219 -0
  344. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll +0 -0
  345. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll +0 -0
  346. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  347. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  348. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  349. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll +0 -0
  350. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll +0 -0
  351. package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/Newtonsoft.Json.10.dll → 2.7.5/PreloadAssemblies/Newtonsoft.Json.dll} +0 -0
  352. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll +0 -0
  353. package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/System.Diagnostics.DiagnosticSource.4.0.4.0.dll → 2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll} +0 -0
  354. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll +0 -0
  355. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Memory.dll +0 -0
  356. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll +0 -0
  357. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll +0 -0
  358. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll +0 -0
  359. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Reflection.DispatchProxy.dll +0 -0
  360. package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.4.0.5.0.dll → 2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll} +0 -0
  361. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.AccessControl.dll +0 -0
  362. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll +0 -0
  363. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.Permissions.dll +0 -0
  364. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.Principal.Windows.dll +0 -0
  365. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll +0 -0
  366. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll +0 -0
  367. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll +0 -0
  368. package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/System.Threading.Tasks.Extensions.4.2.0.0.dll → 2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll} +0 -0
  369. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Xml.ReaderWriter.dll +0 -0
  370. package/resources/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 +278 -0
  371. package/resources/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 +234 -0
  372. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/[Content_Types].xml +1 -0
  373. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/_rels/.rels +2 -2
  374. package/resources/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt +50 -0
  375. package/resources/modules/Az.Accounts/{1.8.1/package/services/metadata/core-properties/b4e383786e734eb49545960a9feff173.psmdcp → 2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp} +2 -2
  376. package/resources/psruntime/AsyncCommandRuntime.cs +4 -0
  377. package/resources/psruntime/AsyncOperationResponse.cs +10 -11
  378. package/resources/psruntime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +3 -1
  379. package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +94 -87
  380. package/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +168 -102
  381. package/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs +22 -11
  382. package/resources/psruntime/BuildTime/Cmdlets/GetScriptCmdlet.cs +2 -1
  383. package/resources/psruntime/BuildTime/MarkdownRenderer.cs +1 -8
  384. package/resources/psruntime/BuildTime/Models/PsHelpMarkdownOutputs.cs +33 -11
  385. package/resources/psruntime/BuildTime/Models/PsHelpTypes.cs +3 -0
  386. package/resources/psruntime/BuildTime/Models/PsMarkdownTypes.cs +17 -14
  387. package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +111 -13
  388. package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +18 -3
  389. package/resources/psruntime/BuildTime/PsAttributes.cs +1 -1
  390. package/resources/psruntime/BuildTime/PsExtensions.cs +9 -0
  391. package/resources/psruntime/BuildTime/PsHelpers.cs +2 -1
  392. package/resources/psruntime/DictionaryExtensions.cs +8 -11
  393. package/resources/psruntime/EventDataExtensions.cs +1 -1
  394. package/resources/psruntime/MessageAttribute.cs +360 -0
  395. package/resources/psruntime/MessageAttributeHelper.cs +161 -0
  396. package/resources/psruntime/Properties/Resources.Designer.cs +5633 -0
  397. package/resources/psruntime/Properties/Resources.resx +1741 -0
  398. package/resources/psruntime/TypeConverterExtensions.cs +31 -10
  399. package/resources/runtime/csharp/client/Extensions.cs +7 -1
  400. package/resources/runtime/csharp/client/IAssociativeArray.cs +4 -1
  401. package/resources/runtime/csharp/client/UndeclaredResponseException.cs +10 -2
  402. package/resources/runtime/csharp/json/Customizations/IJsonSerializable.cs +21 -7
  403. package/resources/runtime/csharp/json/Nodes/JsonNumber.cs +5 -5
  404. package/resources/runtime/csharp/pipeline/ISendAsync.cs +7 -3
  405. package/resources/runtime/csharp/pipeline/PipelineMocking.cs +17 -9
  406. package/resources/utils/Unprotect-SecureString.ps1 +16 -0
  407. package/changelog.md +0 -4
  408. package/dist/llcsharp/enums/json-serializer.d.ts +0 -9
  409. package/dist/llcsharp/enums/json-serializer.d.ts.map +0 -1
  410. package/dist/llcsharp/enums/json-serializer.js +0 -41
  411. package/dist/llcsharp/enums/json-serializer.js.map +0 -1
  412. package/dist/llcsharp/model/model-class-xml.d.ts +0 -15
  413. package/dist/llcsharp/model/model-class-xml.d.ts.map +0 -1
  414. package/dist/llcsharp/model/model-class-xml.js +0 -145
  415. package/dist/llcsharp/model/model-class-xml.js.map +0 -1
  416. package/dist/plugins/add-azure-completers.d.ts +0 -3
  417. package/dist/plugins/add-azure-completers.d.ts.map +0 -1
  418. package/dist/plugins/add-azure-completers.js.map +0 -1
  419. package/dist/plugins/create-commands.d.ts +0 -38
  420. package/dist/plugins/create-commands.d.ts.map +0 -1
  421. package/dist/plugins/create-commands.js.map +0 -1
  422. package/dist/plugins/cs-namer.d.ts +0 -3
  423. package/dist/plugins/cs-namer.d.ts.map +0 -1
  424. package/dist/plugins/cs-namer.js +0 -203
  425. package/dist/plugins/cs-namer.js.map +0 -1
  426. package/dist/plugins/llcsharp.d.ts +0 -3
  427. package/dist/plugins/llcsharp.d.ts.map +0 -1
  428. package/dist/plugins/llcsharp.js.map +0 -1
  429. package/dist/plugins/modifiers.d.ts +0 -3
  430. package/dist/plugins/modifiers.d.ts.map +0 -1
  431. package/dist/plugins/modifiers.js.map +0 -1
  432. package/dist/plugins/powershell.d.ts +0 -3
  433. package/dist/plugins/powershell.d.ts.map +0 -1
  434. package/dist/plugins/powershell.js.map +0 -1
  435. package/dist/plugins/ps-namer.d.ts.map +0 -1
  436. package/dist/plugins/ps-namer.js.map +0 -1
  437. package/resources/assets/docs/readme.md +0 -11
  438. package/resources/modules/Az.Accounts/1.8.1/Accounts.format.ps1xml +0 -368
  439. package/resources/modules/Az.Accounts/1.8.1/Accounts.generated.format.ps1xml +0 -422
  440. package/resources/modules/Az.Accounts/1.8.1/Accounts.types.ps1xml +0 -281
  441. package/resources/modules/Az.Accounts/1.8.1/Az.Accounts.psd1 +0 -360
  442. package/resources/modules/Az.Accounts/1.8.1/Az.Accounts.psm1 +0 -339
  443. package/resources/modules/Az.Accounts/1.8.1/Microsoft.ApplicationInsights.dll +0 -0
  444. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
  445. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
  446. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
  447. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
  448. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
  449. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
  450. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
  451. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Common.dll +0 -0
  452. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Rest.ClientRuntime.dll +0 -0
  453. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Azure.Core.dll +0 -0
  454. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  455. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll +0 -0
  456. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.dll +0 -0
  457. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Numerics.Vectors.dll +0 -0
  458. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Runtime.CompilerServices.Unsafe.dll +0 -0
  459. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Text.Encodings.Web.dll +0 -0
  460. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Text.Json.dll +0 -0
  461. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Threading.Tasks.Extensions.dll +0 -0
  462. package/resources/modules/Az.Accounts/1.8.1/PostImportScripts/LoadAuthenticators.ps1 +0 -197
  463. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Azure.Core.dll +0 -0
  464. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  465. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll +0 -0
  466. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.dll +0 -0
  467. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Buffers.dll +0 -0
  468. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll +0 -0
  469. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Numerics.Vectors.dll +0 -0
  470. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Private.ServiceModel.dll +0 -0
  471. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.4.0.4.0.dll +0 -0
  472. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.4.0.4.1.dll +0 -0
  473. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.ServiceModel.Primitives.dll +0 -0
  474. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Text.Encodings.Web.dll +0 -0
  475. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Text.Json.dll +0 -0
  476. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Threading.Tasks.Extensions.4.3.1.0.dll +0 -0
  477. package/resources/modules/Az.Accounts/1.8.1/StartupScripts/AzError.ps1 +0 -256
@@ -52,6 +52,17 @@ schema: {HelpInfo.Schema.ToString(3)}
52
52
 
53
53
  internal class HelpExampleOutput
54
54
  {
55
+ private string ExampleTemplate =
56
+ "{0}{1}" + Environment.NewLine +
57
+ "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine +
58
+ "{5}" + Environment.NewLine + Environment.NewLine;
59
+
60
+ private string ExampleTemplateWithOutput =
61
+ "{0}{1}" + Environment.NewLine +
62
+ "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine +
63
+ "{5}" + Environment.NewLine + "{6}" + Environment.NewLine + "{7}" + Environment.NewLine + Environment.NewLine +
64
+ "{8}" + Environment.NewLine + Environment.NewLine;
65
+
55
66
  public MarkdownExampleHelpInfo ExampleInfo { get; }
56
67
 
57
68
  public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo)
@@ -59,17 +70,26 @@ schema: {HelpInfo.Schema.ToString(3)}
59
70
  ExampleInfo = exampleInfo;
60
71
  }
61
72
 
62
- public override string ToString() => $@"{ExampleNameHeader}{ExampleInfo.Name}
63
- {ExampleCodeHeader}
64
- {ExampleInfo.Code}
65
- {ExampleCodeFooter}
66
-
67
- {ExampleInfo.Description.ToDescriptionFormat()}
68
-
69
- ";
73
+ public override string ToString()
74
+ {
75
+ if (string.IsNullOrEmpty(ExampleInfo.Output))
76
+ {
77
+ return string.Format(ExampleTemplate,
78
+ ExampleNameHeader, ExampleInfo.Name,
79
+ ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter,
80
+ ExampleInfo.Description.ToDescriptionFormat());
81
+ }
82
+ else
83
+ {
84
+ return string.Format(ExampleTemplateWithOutput,
85
+ ExampleNameHeader, ExampleInfo.Name,
86
+ ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter,
87
+ ExampleOutputHeader, ExampleInfo.Output, ExampleOutputFooter,
88
+ ExampleInfo.Description.ToDescriptionFormat()); ;
89
+ }
90
+ }
70
91
  }
71
-
72
-
92
+
73
93
  internal class HelpParameterOutput
74
94
  {
75
95
  public MarkdownParameterHelpInfo ParameterInfo { get; }
@@ -141,7 +161,7 @@ Locale: en-US
141
161
  }
142
162
 
143
163
  public override string ToString() => $@"### [{HelpInfo.CmdletName}]({HelpInfo.CmdletName}.md)
144
- {HelpInfo.Description.ToDescriptionFormat()}
164
+ {HelpInfo.Synopsis.ToDescriptionFormat()}
145
165
 
146
166
  ";
147
167
  }
@@ -161,6 +181,8 @@ Locale: en-US
161
181
  public const string ExampleNameHeader = "### ";
162
182
  public const string ExampleCodeHeader = "```powershell";
163
183
  public const string ExampleCodeFooter = "```";
184
+ public const string ExampleOutputHeader = "```output";
185
+ public const string ExampleOutputFooter = "```";
164
186
 
165
187
  public static HelpMetadataOutput ToHelpMetadataOutput(this MarkdownHelpInfo helpInfo) => new HelpMetadataOutput(helpInfo);
166
188
 
@@ -109,18 +109,21 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
109
109
  {
110
110
  public string Title { get; }
111
111
  public string Code { get; }
112
+ public string Output { get; }
112
113
  public string Remarks { get; }
113
114
 
114
115
  public PsHelpExampleInfo(PSObject exampleObject)
115
116
  {
116
117
  Title = exampleObject.GetProperty<string>("title");
117
118
  Code = exampleObject.GetProperty<string>("code");
119
+ Output = exampleObject.GetProperty<string>("output");
118
120
  Remarks = exampleObject.GetProperty<PSObject[]>("remarks").EmptyIfNull().ToDescriptionText();
119
121
  }
120
122
  public PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample)
121
123
  {
122
124
  Title = markdownExample.Name;
123
125
  Code = markdownExample.Code;
126
+ Output = markdownExample.Output;
124
127
  Remarks = markdownExample.Description;
125
128
  }
126
129
 
@@ -39,7 +39,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
39
39
  public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string externalHelpFilename = "")
40
40
  {
41
41
  ExternalHelpFilename = externalHelpFilename;
42
- ModuleName = variantGroup.ModuleName;
42
+ ModuleName = variantGroup.RootModuleName != "" ? variantGroup.RootModuleName : variantGroup.ModuleName;
43
43
  var helpInfo = variantGroup.HelpInfo;
44
44
  var commentInfo = variantGroup.CommentInfo;
45
45
  Schema = Version.Parse("2.0.0");
@@ -52,12 +52,12 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
52
52
  SyntaxInfos = variantGroup.Variants
53
53
  .Select(v => new MarkdownSyntaxHelpInfo(v, variantGroup.ParameterGroups, v.VariantName == variantGroup.DefaultParameterSetName))
54
54
  .OrderByDescending(v => v.IsDefault).ThenBy(v => v.ParameterSetName).ToArray();
55
- Examples = GetExamplesFromMarkdown(examplesFolder).NullIfEmpty()
55
+ Examples = GetExamplesFromMarkdown(examplesFolder).NullIfEmpty()
56
56
  ?? helpInfo.Examples.Select(e => e.ToExampleHelpInfo()).ToArray().NullIfEmpty()
57
57
  ?? DefaultExampleHelpInfos;
58
58
 
59
59
  Parameters = variantGroup.ParameterGroups
60
- .Where(pg => !pg.DontShow)
60
+ .Where(pg => !pg.DontShow && !pg.Parameters.All(p => p.IsHidden()))
61
61
  .Select(pg => new MarkdownParameterHelpInfo(
62
62
  variantGroup.Variants.SelectMany(v => v.HelpInfo.Parameters).Where(phi => phi.Name == pg.ParameterName).ToArray(), pg))
63
63
  .OrderBy(phi => phi.Name).ToArray();
@@ -91,12 +91,17 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
91
91
  var code = codeStartIndex.HasValue && codeEndIndex.HasValue
92
92
  ? String.Join(Environment.NewLine, eg.Skip(codeStartIndex.Value + 1).Take(codeEndIndex.Value - (codeStartIndex.Value + 1)))
93
93
  : String.Empty;
94
- var descriptionStartIndex = (codeEndIndex ?? 0) + 1;
94
+ var outputStartIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue);
95
+ var outputEndIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i > outputStartIndex);
96
+ var output = outputStartIndex.HasValue && outputEndIndex.HasValue
97
+ ? String.Join(Environment.NewLine, eg.Skip(outputStartIndex.Value + 1).Take(outputEndIndex.Value - (outputStartIndex.Value + 1)))
98
+ : String.Empty;
99
+ var descriptionStartIndex = (outputEndIndex ?? (codeEndIndex ?? 0)) + 1;
95
100
  descriptionStartIndex = String.IsNullOrWhiteSpace(eg[descriptionStartIndex]) ? descriptionStartIndex + 1 : descriptionStartIndex;
96
101
  var descriptionEndIndex = eg.Length - 1;
97
102
  descriptionEndIndex = String.IsNullOrWhiteSpace(eg[descriptionEndIndex]) ? descriptionEndIndex - 1 : descriptionEndIndex;
98
103
  var description = String.Join(Environment.NewLine, eg.Skip(descriptionStartIndex).Take((descriptionEndIndex + 1) - descriptionStartIndex));
99
- return new MarkdownExampleHelpInfo(name, code, description);
104
+ return new MarkdownExampleHelpInfo(name, code, output, description);
100
105
  }).ToArray();
101
106
  }
102
107
  }
@@ -115,7 +120,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
115
120
  IsDefault = isDefault;
116
121
  ParameterSetName = Variant.VariantName;
117
122
  Parameters = Variant.Parameters
118
- .Where(p => !p.DontShow).OrderByDescending(p => p.IsMandatory)
123
+ .Where(p => !p.DontShow && !p.IsHidden()).OrderByDescending(p => p.IsMandatory)
119
124
  //https://stackoverflow.com/a/6461526/294804
120
125
  .ThenByDescending(p => p.Position.HasValue).ThenBy(p => p.Position)
121
126
  // Use the OrderCategory of the parameter group because the final order category is the highest of the group, and not the order category of the individual parameters from the variants.
@@ -132,10 +137,6 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
132
137
  {
133
138
  parameterStrings = parameterStrings.Append(" [-Confirm]").Append(" [-WhatIf]");
134
139
  }
135
- if (Variant.SupportsPaging)
136
- {
137
- parameterStrings = parameterStrings.Append(" [-First <UInt64>]").Append(" [-IncludeTotalCount]").Append(" [-Skip <UInt64>]");
138
- }
139
140
  parameterStrings = parameterStrings.Append(" [<CommonParameters>]");
140
141
 
141
142
  var lines = new List<string>(20);
@@ -158,12 +159,14 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
158
159
  {
159
160
  public string Name { get; }
160
161
  public string Code { get; }
162
+ public string Output { get; }
161
163
  public string Description { get; }
162
164
 
163
- public MarkdownExampleHelpInfo(string name, string code, string description)
165
+ public MarkdownExampleHelpInfo(string name, string code, string output, string description)
164
166
  {
165
167
  Name = name;
166
168
  Code = code;
169
+ Output = output;
167
170
  Description = description;
168
171
  }
169
172
  }
@@ -217,12 +220,12 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
217
220
 
218
221
  internal static class MarkdownTypesExtensions
219
222
  {
220
- public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Remarks);
223
+ public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks);
221
224
 
222
225
  public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos =
223
226
  {
224
- new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"PS C:\> {{{{ Add code here }}}}{Environment.NewLine}{Environment.NewLine}{{{{ Add output here }}}}", @"{{ Add description here }}"),
225
- new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"PS C:\> {{{{ Add code here }}}}{Environment.NewLine}{Environment.NewLine}{{{{ Add output here }}}}", @"{{ Add description here }}")
227
+ new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"),
228
+ new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"),
226
229
  };
227
230
 
228
231
  public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters =
@@ -96,6 +96,17 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
96
96
  public override string ToString() => HasValidateNotNull ? $"{Indent}[ValidateNotNull()]{Environment.NewLine}" : String.Empty;
97
97
  }
98
98
 
99
+ internal class AllowEmptyArrayOutput
100
+ {
101
+ public bool HasAllowEmptyArray { get; }
102
+
103
+ public AllowEmptyArrayOutput(bool hasAllowEmptyArray)
104
+ {
105
+ HasAllowEmptyArray = hasAllowEmptyArray;
106
+ }
107
+
108
+ public override string ToString() => HasAllowEmptyArray ? $"{Indent}[AllowEmptyCollection()]{Environment.NewLine}" : String.Empty;
109
+ }
99
110
  internal class ArgumentCompleterOutput
100
111
  {
101
112
  public CompleterInfo CompleterInfo { get; }
@@ -157,15 +168,56 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
157
168
  public override string ToString() => $"{Indent}${{{ParameterName}}}{(IsLast ? String.Empty : $",{Environment.NewLine}")}{Environment.NewLine}";
158
169
  }
159
170
 
160
- internal class BeginOutput
171
+ internal class BaseOutput
161
172
  {
162
173
  public VariantGroup VariantGroup { get; }
163
174
 
164
- public BeginOutput(VariantGroup variantGroup)
175
+ protected static readonly bool IsAzure = Convert.ToBoolean(@"${$project.azure}");
176
+ public BaseOutput(VariantGroup variantGroup)
165
177
  {
166
178
  VariantGroup = variantGroup;
167
179
  }
180
+ public string ClearTelemetryContext()
181
+ {
182
+ return (!VariantGroup.IsInternal && IsAzure) ? $@"{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()" : "";
183
+ }
184
+ }
185
+
186
+ internal class BeginOutput : BaseOutput
187
+ {
188
+ public BeginOutput(VariantGroup variantGroup) : base(variantGroup)
189
+ {
190
+ }
168
191
 
192
+ public string GetProcessCustomAttributesAtRuntime()
193
+ {
194
+ return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Message.ClientRuntime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)";
195
+ }
196
+ private string GetTelemetry()
197
+ {
198
+ if (!VariantGroup.IsInternal && IsAzure)
199
+ {
200
+ return $@"
201
+ {Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{
202
+ {Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
203
+ {Indent}{Indent}}}
204
+ {Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
205
+ {Indent}{Indent}if ($preTelemetryId -eq '') {{
206
+ {Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
207
+ {Indent}{Indent}{Indent}[Microsoft.Rest.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
208
+ {Indent}{Indent}}} else {{
209
+ {Indent}{Indent}{Indent}$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
210
+ {Indent}{Indent}{Indent}if ($internalCalledCmdlets -eq '') {{
211
+ {Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
212
+ {Indent}{Indent}{Indent}}} else {{
213
+ {Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
214
+ {Indent}{Indent}{Indent}}}
215
+ {Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
216
+ {Indent}{Indent}}}
217
+ ";
218
+ }
219
+ return "";
220
+ }
169
221
  public override string ToString() => $@"begin {{
170
222
  {Indent}try {{
171
223
  {Indent}{Indent}$outBuffer = $null
@@ -173,12 +225,15 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
173
225
  {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1
174
226
  {Indent}{Indent}}}
175
227
  {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName
228
+ {GetTelemetry()}
176
229
  {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()}
230
+ {GetProcessCustomAttributesAtRuntime()}
177
231
  {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
178
232
  {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}}
179
233
  {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
180
234
  {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet)
181
235
  {Indent}}} catch {{
236
+ {ClearTelemetryContext()}
182
237
  {Indent}{Indent}throw
183
238
  {Indent}}}
184
239
  }}
@@ -215,28 +270,69 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
215
270
  }
216
271
  }
217
272
 
218
- internal class ProcessOutput
273
+ internal class ProcessOutput : BaseOutput
219
274
  {
275
+ public ProcessOutput(VariantGroup variantGroup) : base(variantGroup)
276
+ {
277
+ }
278
+
279
+ private string GetFinally()
280
+ {
281
+ if (IsAzure && !VariantGroup.IsInternal)
282
+ {
283
+ return $@"
284
+ {Indent}finally {{
285
+ {Indent}{Indent}$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
286
+ {Indent}{Indent}$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
287
+ {Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
288
+ {Indent}}}
289
+ ";
290
+ }
291
+ return "";
292
+ }
220
293
  public override string ToString() => $@"process {{
221
294
  {Indent}try {{
222
295
  {Indent}{Indent}$steppablePipeline.Process($_)
223
296
  {Indent}}} catch {{
297
+ {ClearTelemetryContext()}
224
298
  {Indent}{Indent}throw
225
299
  {Indent}}}
300
+ {GetFinally()}
226
301
  }}
227
-
228
302
  ";
229
303
  }
230
304
 
231
- internal class EndOutput
305
+ internal class EndOutput : BaseOutput
232
306
  {
307
+ public EndOutput(VariantGroup variantGroup) : base(variantGroup)
308
+ {
309
+ }
310
+
311
+ private string GetTelemetry()
312
+ {
313
+ if (!VariantGroup.IsInternal && IsAzure)
314
+ {
315
+ return $@"
316
+ {Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
317
+ {Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
318
+ {Indent}{Indent}if ($preTelemetryId -eq '') {{
319
+ {Indent}{Indent}{Indent}[Microsoft.Rest.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
320
+ {Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
321
+ {Indent}{Indent}}}
322
+ {Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
323
+ ";
324
+ }
325
+ return "";
326
+ }
233
327
  public override string ToString() => $@"end {{
234
328
  {Indent}try {{
235
329
  {Indent}{Indent}$steppablePipeline.End()
330
+ {GetTelemetry()}
236
331
  {Indent}}} catch {{
332
+ {ClearTelemetryContext()}
237
333
  {Indent}{Indent}throw
238
334
  {Indent}}}
239
- }}
335
+ }}
240
336
  ";
241
337
  }
242
338
 
@@ -290,7 +386,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
290
386
 
291
387
  public override string ToString() => !String.IsNullOrEmpty(Description)
292
388
  ? Description.ToDescriptionFormat(false).NormalizeNewLines()
293
- .Split(new [] { Environment.NewLine }, StringSplitOptions.None)
389
+ .Split(new[] { Environment.NewLine }, StringSplitOptions.None)
294
390
  .Aggregate(String.Empty, (c, n) => c + $"{Indent}# {n}{Environment.NewLine}")
295
391
  : String.Empty;
296
392
  }
@@ -366,7 +462,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
366
462
  public Type ParameterType { get; }
367
463
  public bool IsMandatory { get; }
368
464
  public int? Position { get; }
369
-
465
+
370
466
  public bool IncludeSpace { get; }
371
467
  public bool IncludeDash { get; }
372
468
 
@@ -432,7 +528,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
432
528
  // https://stackoverflow.com/a/5284606/294804
433
529
  private static string RemoveEnd(this string text, string suffix) => text.EndsWith(suffix) ? text.Substring(0, text.Length - suffix.Length) : text;
434
530
 
435
- public static string ToPsSingleLine(this string value, string replacer = " ") => value.ReplaceNewLines(replacer, new []{"<br>", "\r\n", "\n"});
531
+ public static string ToPsSingleLine(this string value, string replacer = " ") => value.ReplaceNewLines(replacer, new[] { "<br>", "\r\n", "\n" });
436
532
 
437
533
  public static string ToPsStringLiteral(this string value) => value?.Replace("'", "''").Replace("‘", "''").Replace("’", "''").ToPsSingleLine().Trim() ?? String.Empty;
438
534
 
@@ -465,6 +561,8 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
465
561
 
466
562
  public static ValidateNotNullOutput ToValidateNotNullOutput(this bool hasValidateNotNull) => new ValidateNotNullOutput(hasValidateNotNull);
467
563
 
564
+ public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray);
565
+
468
566
  public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo);
469
567
 
470
568
  public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup);
@@ -475,9 +573,9 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
475
573
 
476
574
  public static BeginOutput ToBeginOutput(this VariantGroup variantGroup) => new BeginOutput(variantGroup);
477
575
 
478
- public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput();
576
+ public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(variantGroup);
479
577
 
480
- public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput();
578
+ public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(variantGroup);
481
579
 
482
580
  public static HelpCommentOutput ToHelpCommentOutput(this VariantGroup variantGroup) => new HelpCommentOutput(variantGroup);
483
581
 
@@ -497,7 +595,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
497
595
 
498
596
  public static string ToNoteOutput(this ComplexInterfaceInfo complexInterfaceInfo, string currentIndent = "", bool includeDashes = false, bool includeBackticks = false, bool isFirst = true)
499
597
  {
500
- string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) =>
598
+ string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) =>
501
599
  $"{indent}{(dash ? "- " : String.Empty)}{(backtick ? "`" : String.Empty)}{info.ToPropertySyntaxOutput()}{(backtick ? "`" : String.Empty)}: {info.Description}";
502
600
 
503
601
  var nested = complexInterfaceInfo.NestedInfos.Select(ni =>
@@ -506,7 +604,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
506
604
  return ni.IsComplexInterface
507
605
  ? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false)
508
606
  : RenderProperty(ni, nestedIndent, includeDashes, includeBackticks);
509
- }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, !isFirst && includeBackticks));
607
+ }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, includeBackticks));
510
608
  return String.Join(Environment.NewLine, nested);
511
609
  }
512
610
  }
@@ -30,6 +30,8 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
30
30
  internal class VariantGroup
31
31
  {
32
32
  public string ModuleName { get; }
33
+
34
+ public string RootModuleName {get => @"${$project.rootModuleName}";}
33
35
  public string CmdletName { get; }
34
36
  public string CmdletVerb { get; }
35
37
  public string CmdletNoun { get; }
@@ -171,6 +173,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
171
173
 
172
174
  public string[] Aliases { get; }
173
175
  public bool HasValidateNotNull { get; }
176
+ public bool HasAllowEmptyArray { get; }
174
177
  public CompleterInfo CompleterInfo { get; }
175
178
  public DefaultInfo DefaultInfo { get; }
176
179
  public bool HasDefaultInfo { get; }
@@ -205,6 +208,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
205
208
 
206
209
  Aliases = Parameters.SelectMany(p => p.Attributes).ToAliasNames().ToArray();
207
210
  HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType<ValidateNotNullAttribute>()).Any();
211
+ HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType<AllowEmptyCollectionAttribute>()).Any();
208
212
  CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo()
209
213
  ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo();
210
214
  DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this)
@@ -383,7 +387,9 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
383
387
  helpInfo.OutputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(ot => ot.Name).ToArray())
384
388
  .Where(o => o != "None").Distinct().OrderBy(o => o).ToArray();
385
389
 
386
- OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{variantGroup.ModuleName.ToLowerInvariant()}/{variantGroup.CmdletName.ToLowerInvariant()}";
390
+ // Use root module name in the help link
391
+ var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant();
392
+ OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}";
387
393
  RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray();
388
394
  }
389
395
  }
@@ -466,12 +472,21 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
466
472
  {
467
473
  var parameters = variant.Metadata.Parameters.AsEnumerable();
468
474
  var parameterHelp = variant.HelpInfo.Parameters.AsEnumerable();
475
+
469
476
  if (variant.HasParameterSets)
470
477
  {
471
478
  parameters = parameters.Where(p => p.Value.ParameterSets.Keys.Any(k => k == variant.VariantName || k == AllParameterSets));
472
- parameterHelp = parameterHelp.Where(ph => !ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets));
479
+ parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount");
480
+ }
481
+ var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key)));
482
+ if (variant.SupportsPaging) {
483
+ // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters
484
+ variant.Info.Parameters["First"].Attributes.OfType<ParameterAttribute>().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects.";
485
+ variant.Info.Parameters["Skip"].Attributes.OfType<ParameterAttribute>().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects.";
486
+ result = result.Append(new Parameter(variant.VariantName, "First", variant.Info.Parameters["First"], parameterHelp.FirstOrDefault(ph => ph.Name == "First")));
487
+ result = result.Append(new Parameter(variant.VariantName, "Skip", variant.Info.Parameters["Skip"], parameterHelp.FirstOrDefault(ph => ph.Name == "Skip")));
473
488
  }
474
- return parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))).ToArray();
489
+ return result.ToArray();
475
490
  }
476
491
 
477
492
  public static Attribute[] ToAttributes(this Variant variant) => variant.IsFunction
@@ -17,7 +17,7 @@ namespace Microsoft.Rest
17
17
  }
18
18
  }
19
19
 
20
- [AttributeUsage(AttributeTargets.Class)]
20
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)]
21
21
  public class DoNotExportAttribute : Attribute
22
22
  {
23
23
  }
@@ -156,5 +156,14 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
156
156
 
157
157
  public static void RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block)
158
158
  => engineIntrinsics.RunScript<PSObject>(block.ToString());
159
+
160
+ /// <summary>
161
+ /// Returns if a parameter should be hidden by checking for <see cref="DoNotExportAttribute" />.
162
+ /// </summary>
163
+ /// <param name="parameter">A PowerShell parameter.</param>
164
+ public static bool IsHidden(this Parameter parameter)
165
+ {
166
+ return parameter.Attributes.Any(attr => attr is DoNotExportAttribute);
167
+ }
159
168
  }
160
169
  }
@@ -39,9 +39,10 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
39
39
  public static IEnumerable<FunctionInfo> GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder)
40
40
  {
41
41
  // https://stackoverflow.com/a/40969712/294804
42
+ var wrappedFolder = scriptFolder.Contains("'") ? $@"""{scriptFolder}""" : $@"'{scriptFolder}'";
42
43
  var getCmdletsCommand = $@"
43
44
  $currentFunctions = Get-ChildItem function:
44
- Get-ChildItem -Path '{scriptFolder}' -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }}
45
+ Get-ChildItem -Path {wrappedFolder} -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }}
45
46
  Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }}
46
47
  ";
47
48
  return cmdlet?.RunScript<FunctionInfo>(getCmdletsCommand) ?? RunScript<FunctionInfo>(getCmdletsCommand);
@@ -8,26 +8,23 @@ namespace Microsoft.Rest.ClientRuntime
8
8
  {
9
9
  internal static void HashTableToDictionary<V>(System.Collections.Hashtable hashtable, System.Collections.Generic.IDictionary<string, V> dictionary)
10
10
  {
11
+ if (null == hashtable)
12
+ {
13
+ return;
14
+ }
11
15
  foreach (var each in hashtable.Keys)
12
16
  {
13
17
  var key = each.ToString();
14
18
  var value = hashtable[key];
15
19
  if (null != value)
16
20
  {
17
- if (value is System.Collections.Hashtable nested)
21
+ try
18
22
  {
19
- HashTableToDictionary<V>(nested, new System.Collections.Generic.Dictionary<string, V>());
23
+ dictionary[key] = (V)value;
20
24
  }
21
- else
25
+ catch
22
26
  {
23
- try
24
- {
25
- dictionary[key] = (V)value;
26
- }
27
- catch
28
- {
29
- // Values getting dropped; not compatible with target dictionary. Not sure what to do here.
30
- }
27
+ // Values getting dropped; not compatible with target dictionary. Not sure what to do here.
31
28
  }
32
29
  }
33
30
  }
@@ -7,7 +7,6 @@ namespace Microsoft.Rest.ClientRuntime
7
7
  {
8
8
  using System;
9
9
 
10
- [System.ComponentModel.TypeConverter(typeof(EventDataConverter))]
11
10
  /// <summary>
12
11
  /// PowerShell-specific data on top of the llc# EventData
13
12
  /// </summary>
@@ -16,6 +15,7 @@ namespace Microsoft.Rest.ClientRuntime
16
15
  /// Obviously, this code would need to be duplcated on both modules.
17
16
  /// This is preferable to sharing a common library, as versioning makes that problematic.
18
17
  /// </remarks>
18
+ [System.ComponentModel.TypeConverter(typeof(EventDataConverter))]
19
19
  public partial class EventData : EventArgs
20
20
  {
21
21
  }