@autorest/powershell 2.1.400 → 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 +350 -0
  2. package/.rush/temp/shrinkwrap-deps.json +433 -0
  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
@@ -0,0 +1,157 @@
1
+ # ----------------------------------------------------------------------------------
2
+ ${$project.pwshCommentHeader}
3
+ # ----------------------------------------------------------------------------------
4
+
5
+ function CreateModelCmdlet {
6
+
7
+ param([string[]]$Models)
8
+
9
+ if ($Models.Count -eq 0)
10
+ {
11
+ return
12
+ }
13
+
14
+ $ModelCsPath = Join-Path (Join-Path $PSScriptRoot '${$lib.path.relative($project.baseFolder, $project.apiFolder)}') 'Models'
15
+ $ModuleName = '${$project.subjectPrefix}'
16
+ $OutputDir = Join-Path $PSScriptRoot '${$lib.path.relative($project.baseFolder, $project.modelCmdletFolder)}'
17
+ $null = New-Item -ItemType Directory -Force -Path $OutputDir
18
+
19
+ $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
20
+ $Content = ''
21
+ $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 )
22
+ { $Content += get-content $_.fullname -raw
23
+ } }
24
+
25
+ $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content)
26
+ $Nodes = $Tree.ChildNodes().ChildNodes()
27
+ foreach ($Model in $Models)
28
+ {
29
+ $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") }
30
+ if ($InterfaceNode.count -eq 0) {
31
+ continue
32
+ }
33
+ # through a queue, we iterate all the parent models.
34
+ $Queue = @($InterfaceNode)
35
+ $visited = @("I$Model")
36
+ $AllInterfaceNodes = @()
37
+ while ($Queue.count -ne 0)
38
+ {
39
+ $AllInterfaceNodes += $Queue[0]
40
+ # Baselist contains the direct parent models.
41
+ foreach ($parent in $Queue[0].BaseList.Types)
42
+ {
43
+ if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value)))
44
+ {
45
+ $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) })
46
+ $visited = [Array]$visited + $parent.Type.Right.Identifier.Value
47
+ }
48
+ }
49
+ $first, $Queue = $Queue
50
+ }
51
+
52
+ $Namespace = $InterfaceNode.Parent.Name
53
+ $ObjectType = $Model
54
+ $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
55
+ # remove duplicated module name
56
+ if ($ObjectType.StartsWith($ModuleName)) {
57
+ $ModulePrefix = ''
58
+ } else {
59
+ $ModulePrefix = $ModuleName
60
+ }
61
+ $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
62
+
63
+ $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string]
64
+ $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string]
65
+ foreach ($Node in $AllInterfaceNodes)
66
+ {
67
+ foreach ($Member in $Node.Members)
68
+ {
69
+ $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments
70
+ $Required = $false
71
+ $Description = ""
72
+ $Readonly = $False
73
+ foreach ($Argument in $Arguments)
74
+ {
75
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Required")
76
+ {
77
+ $Required = $Argument.Expression.Token.Value
78
+ }
79
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Description")
80
+ {
81
+ $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"')
82
+ }
83
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly")
84
+ {
85
+ $Readonly = $Argument.Expression.Token.Value
86
+ }
87
+ }
88
+ if ($Readonly)
89
+ {
90
+ continue
91
+ }
92
+ $Identifier = $Member.Identifier.Value
93
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
94
+ $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string]
95
+ if ($Required)
96
+ {
97
+ $ParameterDefinePropertyList.Add("Mandatory")
98
+ }
99
+ if ($Description -ne "")
100
+ {
101
+ $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"")
102
+ }
103
+ $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList)
104
+ # check whether completer is needed
105
+ $completer = '';
106
+ if($Type.Split('.').Split('.')[-2] -eq 'Support') {
107
+ # If Type is an array, need to strip []
108
+ $strippedType = $Type.Replace('[]', '')
109
+ $completer += "`n [ArgumentCompleter([${strippedType}])]"
110
+ }
111
+ $ParameterDefineScript = "
112
+ [Parameter($ParameterDefineProperty)]${completer}
113
+ [${Type}]
114
+ `$${Identifier}"
115
+ $ParameterDefineScriptList.Add($ParameterDefineScript)
116
+ $ParameterAssignScriptList.Add("
117
+ if (`$PSBoundParameters.ContainsKey('${Identifier}')) {
118
+ `$Object.${Identifier} = `$${Identifier}
119
+ }")
120
+ }
121
+ }
122
+ $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator ","
123
+ $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator ""
124
+
125
+ $Script = "
126
+ # ----------------------------------------------------------------------------------
127
+ ${$project.pwshCommentHeaderForCsharp}
128
+ # ----------------------------------------------------------------------------------
129
+
130
+ <#
131
+ .Synopsis
132
+ Create an in-memory object for ${ObjectType}.
133
+ .Description
134
+ Create an in-memory object for ${ObjectType}.
135
+
136
+ .Outputs
137
+ ${ObjectTypeWithNamespace}
138
+ .Link
139
+ ${$project.helpLinkPrefix}az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
140
+ #>
141
+ function New-Az${ModulePrefix}${ObjectType}Object {
142
+ [OutputType('${ObjectTypeWithNamespace}')]
143
+ [CmdletBinding(PositionalBinding=`$false)]
144
+ Param(
145
+ ${ParameterDefineScript}
146
+ )
147
+
148
+ process {
149
+ `$Object = [${ObjectTypeWithNamespace}]::New()
150
+ ${ParameterAssignScript}
151
+ return `$Object
152
+ }
153
+ }
154
+ "
155
+ Set-Content -Path $OutputPath -Value $Script
156
+ }
157
+ }
@@ -12,7 +12,7 @@ For `${$project.moduleName}` to use custom cmdlets, it does this two different w
12
12
 
13
13
  For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `${$project.dll}`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
14
14
 
15
- For script cmdlets, these are loaded via the `${$lib.path.relative($project.customFolder, $project.psm1Custom)}`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundemental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
15
+ For script cmdlets, these are loaded via the `${$lib.path.relative($project.customFolder, $project.psm1Custom)}`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
16
16
 
17
17
  ## Purpose
18
18
  This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `${$lib.path.relative($project.customFolder, $project.exportsFolder)}` folder.
@@ -31,11 +31,11 @@ These provide functionality to our HTTP pipeline and other useful features. In s
31
31
 
32
32
  ### Attributes
33
33
  For processing the cmdlets, we've created some additional attributes:
34
- - `${$project.modelsExtensions.fullName}.DescriptionAttribute`
35
- - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propegated to reference documentation via [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
36
- - `${$project.modelsExtensions.fullName}.DoNotExportAttribute`
34
+ - `${$project.serviceNamespace.fullName}.DescriptionAttribute`
35
+ - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
36
+ - `${$project.serviceNamespace.fullName}.DoNotExportAttribute`
37
37
  - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `${$project.moduleName}`.
38
- - `${$project.modelsExtensions.fullName}.InternalExportAttribute`
39
- - Used in C# cmdlets to route exported cmdlets to the `${$lib.path.relative($project.customFolder, $project.internalFolder)}`, which are *not exposed* by `${$project.moduleName}`. For more information, see [readme.md](${$lib.path.relative($project.customFolder, $project.internalFolder)}/readme.md) in the `${$lib.path.relative($project.customFolder, $project.internalFolder)}` folder.
40
- - `${$project.modelsExtensions.fullName}.ProfileAttribute`
38
+ - `${$project.serviceNamespace.fullName}.InternalExportAttribute`
39
+ - Used in C# cmdlets to route exported cmdlets to the `${$lib.path.relative($project.customFolder, $project.internalFolder)}`, which are *not exposed* by `${$project.moduleName}`. For more information, see [README.md](${$lib.path.relative($project.customFolder, $project.internalFolder)}/README.md) in the `${$lib.path.relative($project.customFolder, $project.internalFolder)}` folder.
40
+ - `${$project.serviceNamespace.fullName}.ProfileAttribute`
41
41
  - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
@@ -0,0 +1,11 @@
1
+ # Docs
2
+ This directory contains the documentation of the cmdlets for the `${$project.moduleName}` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `${$lib.path.relative($project.docsFolder, $project.examplesFolder)}` folder.
3
+
4
+ ## Info
5
+ - Modifiable: no
6
+ - Generated: all
7
+ - Committed: yes
8
+ - Packaged: yes
9
+
10
+ ## Details
11
+ The process of documentation generation loads `${$project.moduleName}` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `${$lib.path.relative($project.docsFolder, $project.exportsFolder)}` folder. Additionally, when writing custom cmdlets in the `${$lib.path.relative($project.docsFolder, $project.customFolder)}` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `${$lib.path.relative($project.docsFolder, $project.examplesFolder)}` folder.
@@ -1,15 +1,5 @@
1
1
  # ----------------------------------------------------------------------------------
2
- #
3
- # Copyright Microsoft Corporation
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- # See the License for the specific language governing permissions and
12
- # limitations under the License.
2
+ ${$project.pwshCommentHeader}
13
3
  # ----------------------------------------------------------------------------------
14
4
  param([switch]$Isolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat)
15
5
  $ErrorActionPreference = 'Stop'
@@ -1,5 +1,5 @@
1
1
  # Exports
2
- This directory contains the cmdlets *exported by* `${$project.moduleName}`. No other cmdlets in this repository are directly exported. What that means is the `${$project.moduleName}` module will run [Export-ModuleMember](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `${$lib.path.relative($project.exportsFolder, $project.customFolder)}` for all custom implementation.
2
+ This directory contains the cmdlets *exported by* `${$project.moduleName}`. No other cmdlets in this repository are directly exported. What that means is the `${$project.moduleName}` module will run [Export-ModuleMember](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `${$lib.path.relative($project.exportsFolder, $project.customFolder)}` for all custom implementation.
3
3
 
4
4
  ## Info
5
5
  - Modifiable: no
@@ -8,7 +8,7 @@ This directory contains the cmdlets *exported by* `${$project.moduleName}`. No o
8
8
  - Packaged: yes
9
9
 
10
10
  ## Details
11
- The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`${$lib.path.relative($project.exportsFolder, $project.dll)}`) and from the `${$lib.path.relative($project.exportsFolder, $project.psm1Custom)}` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [readme.md](${$lib.path.relative($project.exportsFolder, $project.internalFolder)}/readme.md) in the `${$lib.path.relative($project.exportsFolder, $project.internalFolder)}` folder.
11
+ The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`${$lib.path.relative($project.exportsFolder, $project.dll)}`) and from the `${$lib.path.relative($project.exportsFolder, $project.psm1Custom)}` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](${$lib.path.relative($project.exportsFolder, $project.internalFolder)}/README.md) in the `${$lib.path.relative($project.exportsFolder, $project.internalFolder)}` folder.
12
12
 
13
13
  ## Purpose
14
14
  We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles.
@@ -1,15 +1,5 @@
1
1
  # ----------------------------------------------------------------------------------
2
- #
3
- # Copyright Microsoft Corporation
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- # See the License for the specific language governing permissions and
12
- # limitations under the License.
2
+ ${$project.pwshCommentHeader}
13
3
  # ----------------------------------------------------------------------------------
14
4
  param([switch]$Isolated)
15
5
  $ErrorActionPreference = 'Stop'
@@ -34,7 +24,7 @@ if(-not $hasProfiles) {
34
24
 
35
25
  $docsFolder = Join-Path $PSScriptRoot '${$lib.path.relative($project.baseFolder, $project.docsFolder)}'
36
26
  if(Test-Path $docsFolder) {
37
- $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'readme.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
27
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
38
28
  }
39
29
  $null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue
40
30
  $examplesFolder = Join-Path $PSScriptRoot '${$lib.path.relative($project.baseFolder, $project.examplesFolder)}'
@@ -2,19 +2,19 @@
2
2
  This document describes how to develop for `${$project.moduleName}`.
3
3
 
4
4
  ## Building `${$project.moduleName}`
5
- To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `${$lib.path.relative($project.baseFolder, $project.exportsFolder)}` folder. To read more about the proxy script cmdlets, look at the [readme.md](${$lib.path.relative($project.baseFolder, $project.exportsFolder)}/readme.md) in the `${$lib.path.relative($project.baseFolder, $project.exportsFolder)}` folder.
5
+ To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `${$lib.path.relative($project.baseFolder, $project.exportsFolder)}` folder. To read more about the proxy script cmdlets, look at the [README.md](${$lib.path.relative($project.baseFolder, $project.exportsFolder)}/README.md) in the `${$lib.path.relative($project.baseFolder, $project.exportsFolder)}` folder.
6
6
 
7
7
  ## Creating custom cmdlets
8
- To add cmdlets that were not generated by the REST specification, use the `${$lib.path.relative($project.baseFolder, $project.customFolder)}` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [readme.md](${$lib.path.relative($project.baseFolder, $project.customFolder)}/readme.md) in the `${$lib.path.relative($project.baseFolder, $project.customFolder)}` folder.
8
+ To add cmdlets that were not generated by the REST specification, use the `${$lib.path.relative($project.baseFolder, $project.customFolder)}` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [README.md](${$lib.path.relative($project.baseFolder, $project.customFolder)}/README.md) in the `${$lib.path.relative($project.baseFolder, $project.customFolder)}` folder.
9
9
 
10
10
  ## Generating documentation
11
- To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `${$lib.path.relative($project.baseFolder, $project.docsFolder)}` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [readme.md](${$lib.path.relative($project.baseFolder, $project.examplesFolder)}/readme.md) in the `${$lib.path.relative($project.baseFolder, $project.examplesFolder)}` folder. To read more about documentation, look at the [readme.md](${$lib.path.relative($project.baseFolder, $project.docsFolder)}/readme.md) in the `${$lib.path.relative($project.baseFolder, $project.docsFolder)}` folder.
11
+ To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `${$lib.path.relative($project.baseFolder, $project.docsFolder)}` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [README.md](${$lib.path.relative($project.baseFolder, $project.examplesFolder)}/README.md) in the `${$lib.path.relative($project.baseFolder, $project.examplesFolder)}` folder. To read more about documentation, look at the [README.md](${$lib.path.relative($project.baseFolder, $project.docsFolder)}/README.md) in the `${$lib.path.relative($project.baseFolder, $project.docsFolder)}` folder.
12
12
 
13
13
  ## Testing `${$project.moduleName}`
14
- To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `${$lib.path.relative($project.baseFolder, $project.testFolder)}` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [readme.md](${$lib.path.relative($project.baseFolder, $project.examplesFolder)}/readme.md) in the `${$lib.path.relative($project.baseFolder, $project.examplesFolder)}` folder.
14
+ To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `${$lib.path.relative($project.baseFolder, $project.testFolder)}` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](${$lib.path.relative($project.baseFolder, $project.examplesFolder)}/README.md) in the `${$lib.path.relative($project.baseFolder, $project.examplesFolder)}` folder.
15
15
 
16
16
  ## Packing `${$project.moduleName}`
17
- To pack `${$project.moduleName}` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/en-us/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team.
17
+ To pack `${$project.moduleName}` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team.
18
18
 
19
19
  ## Module Script Details
20
20
  There are multiple scripts created for performing different actions for developing `${$project.moduleName}`.
@@ -1,5 +1,5 @@
1
1
  # Internal
2
- This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `${$lib.path.relative($project.internalFolder, $project.customFolder)}` for all custom implementation.
2
+ This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `${$lib.path.relative($project.internalFolder, $project.customFolder)}` for all custom implementation.
3
3
 
4
4
  ## Info
5
5
  - Modifiable: no
@@ -8,7 +8,7 @@ This directory contains a module to handle *internal only* cmdlets. Cmdlets that
8
8
  - Packaged: yes
9
9
 
10
10
  ## Details
11
- The `${$lib.path.relative($project.internalFolder, $project.psm1Internal)}` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `${$project.moduleName}`. Instead, this sub-module is imported by the `${$lib.path.relative($project.internalFolder, $project.psm1Custom)}` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `${$project.moduleName}.internal\Get-Example` would call an internal cmdlet named `Get-Example`.
11
+ The `${$lib.path.relative($project.internalFolder, $project.psm1Internal)}` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `${$project.moduleName}`. Instead, this sub-module is imported by the `${$lib.path.relative($project.internalFolder, $project.psm1Custom)}` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `${$project.moduleName}.internal\Get-Example` would call an internal cmdlet named `Get-Example`.
12
12
 
13
13
  ## Purpose
14
- This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `${$project.moduleName}`.
14
+ This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `${$project.moduleName}`.
@@ -1,15 +1,5 @@
1
1
  # ----------------------------------------------------------------------------------
2
- #
3
- # Copyright Microsoft Corporation
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- # See the License for the specific language governing permissions and
12
- # limitations under the License.
2
+ ${$project.pwshCommentHeader}
13
3
  # ----------------------------------------------------------------------------------
14
4
  Write-Host -ForegroundColor Green 'Packing module...'
15
5
  dotnet pack $PSScriptRoot --no-build /nologo
@@ -1,15 +1,5 @@
1
1
  # ----------------------------------------------------------------------------------
2
- #
3
- # Copyright Microsoft Corporation
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- # See the License for the specific language governing permissions and
12
- # limitations under the License.
2
+ ${$project.pwshCommentHeader}
13
3
  # ----------------------------------------------------------------------------------
14
4
  param([switch]$Isolated, [switch]$Code)
15
5
  $ErrorActionPreference = 'Stop'
@@ -24,6 +14,8 @@ if(-not $Isolated) {
24
14
  $isAzure = $${$project.azure}
25
15
  if($isAzure) {
26
16
  . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts
17
+ # Load the latest version of Az.Accounts installed
18
+ Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version
27
19
  }
28
20
 
29
21
  $localModulesPath = Join-Path $PSScriptRoot '${$lib.path.relative($project.baseFolder, $project.dependencyModuleFolder)}'
File without changes
@@ -1,15 +1,5 @@
1
1
  # ----------------------------------------------------------------------------------
2
- #
3
- # Copyright Microsoft Corporation
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- # See the License for the specific language governing permissions and
12
- # limitations under the License.
2
+ ${$project.pwshCommentHeader}
13
3
  # ----------------------------------------------------------------------------------
14
4
  $envFile = 'env.json'
15
5
  if ($TestMode -eq 'live') {
@@ -1,39 +1,42 @@
1
1
  # ----------------------------------------------------------------------------------
2
- #
3
- # Copyright Microsoft Corporation
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- # See the License for the specific language governing permissions and
12
- # limitations under the License.
2
+ ${$project.pwshCommentHeader}
13
3
  # ----------------------------------------------------------------------------------
14
- param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback)
4
+ param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName)
15
5
  $ErrorActionPreference = 'Stop'
16
6
 
17
- if(-not $Isolated) {
7
+ if(-not $Isolated)
8
+ {
18
9
  Write-Host -ForegroundColor Green 'Creating isolated process...'
10
+ if ($PSBoundParameters.ContainsKey("TestName")) {
11
+ $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join ","
12
+ }
19
13
  $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
20
14
  & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
21
15
  return
22
16
  }
23
17
 
18
+ # This is a workaround, since for string array parameter, pwsh -File will only take the first element
19
+ if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and ($TestName[0].Contains(','))) {
20
+ $TestName = $TestName[0].Split(",")
21
+ }
22
+
24
23
  $ProgressPreference = 'SilentlyContinue'
25
24
  $baseName = $PSScriptRoot.BaseName
26
25
  $requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent))
27
- . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule
26
+ . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule
28
27
  . ("$PSScriptRoot\test\utils.ps1")
29
28
 
30
- if ($requireResourceModule) {
29
+ if ($requireResourceModule)
30
+ {
31
+ # Load the latest Az.Accounts installed
32
+ Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version
31
33
  $resourceModulePSD = Get-Item -Path (Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psd1')
32
34
  Import-Module -Name $resourceModulePSD.FullName
33
35
  }
34
36
 
35
37
  $localModulesPath = Join-Path $PSScriptRoot '${$lib.path.relative($project.baseFolder, $project.dependencyModuleFolder)}'
36
- if(Test-Path -Path $localModulesPath) {
38
+ if(Test-Path -Path $localModulesPath)
39
+ {
37
40
  $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
38
41
  }
39
42
 
@@ -45,22 +48,34 @@ Import-Module -Name Pester
45
48
  Import-Module -Name $modulePath
46
49
 
47
50
  $TestMode = 'playback'
48
- if($Live) {
51
+ $ExcludeTag = @("LiveOnly")
52
+ if($Live)
53
+ {
49
54
  $TestMode = 'live'
55
+ $ExcludeTag = @()
50
56
  }
51
- if($Record) {
57
+ if($Record)
58
+ {
52
59
  $TestMode = 'record'
53
60
  }
54
- try {
55
- if ($TestMode -ne 'playback') {
61
+ try
62
+ {
63
+ if ($TestMode -ne 'playback')
64
+ {
56
65
  setupEnv
57
66
  }
58
67
  $testFolder = Join-Path $PSScriptRoot '${$lib.path.relative($project.baseFolder, $project.testFolder)}'
59
- Invoke-Pester -Script @{ Path = $testFolder } -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml")
60
- }
61
- Finally
68
+ if ($null -ne $TestName)
69
+ {
70
+ Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml")
71
+ } else
72
+ {
73
+ Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml")
74
+ }
75
+ } Finally
62
76
  {
63
- if ($TestMode -ne 'playback') {
77
+ if ($TestMode -ne 'playback')
78
+ {
64
79
  cleanupEnv
65
80
  }
66
81
  }
@@ -17,7 +17,7 @@ This directory contains the PowerShell module for the Resources service.
17
17
  This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
18
18
 
19
19
  ## Module Requirements
20
- - [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.8.1 or greater
20
+ - [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
21
21
 
22
22
  ## Authentication
23
23
  AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
@@ -32,7 +32,7 @@ Use of the beta version of `autorest.powershell` generator requires the followin
32
32
  - [NodeJS LTS](https://nodejs.org) (10.15.x LTS preferred)
33
33
  - **Note**: It *will not work* with Node < 10.x. Using 11.x builds may cause issues as they may introduce instability or breaking changes.
34
34
  > If you want an easy way to install and update Node, [NVS - Node Version Switcher](../nodejs/installing-via-nvs.md) or [NVM - Node Version Manager](../nodejs/installing-via-nvm.md) is recommended.
35
- - [AutoRest](https://aka.ms/autorest) v3 beta <br>`npm install -g @autorest/autorest`<br>&nbsp;
35
+ - [AutoRest](https://aka.ms/autorest) v3 <br>`npm install -g autorest`<br>&nbsp;
36
36
  - PowerShell 6.0 or greater
37
37
  - If you don't have it installed, you can use the cross-platform npm package <br>`npm install -g pwsh`<br>&nbsp;
38
38
  - .NET Core SDK 2.0 or greater
@@ -83,6 +83,7 @@ module-version: 0.0.1
83
83
  title: Resources
84
84
 
85
85
  directive:
86
+ - remove-operation: Deployments_CreateOrUpdateAtSubscriptionScope
86
87
  - where:
87
88
  subject: Operation
88
89
  hide: true
@@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.Resources`
8
8
  - Packaged: yes
9
9
 
10
10
  ## Details
11
- The process of documentation generation loads `Az.Resources` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder.
11
+ The process of documentation generation loads `Az.Resources` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder.
@@ -2,19 +2,19 @@
2
2
  This document describes how to develop for `Az.Resources`.
3
3
 
4
4
  ## Building `Az.Resources`
5
- To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [readme.md](exports/readme.md) in the `exports` folder.
5
+ To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [README.md](exports/README.md) in the `exports` folder.
6
6
 
7
7
  ## Creating custom cmdlets
8
- To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [readme.md](custom/readme.md) in the `custom` folder.
8
+ To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [README.md](custom/README.md) in the `custom` folder.
9
9
 
10
10
  ## Generating documentation
11
- To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [readme.md](examples/readme.md) in the `examples` folder. To read more about documentation, look at the [readme.md](docs/readme.md) in the `docs` folder.
11
+ To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [README.md](examples/README.md) in the `examples` folder. To read more about documentation, look at the [README.md](docs/README.md) in the `docs` folder.
12
12
 
13
13
  ## Testing `Az.Resources`
14
- To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [readme.md](examples/readme.md) in the `examples` folder.
14
+ To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder.
15
15
 
16
16
  ## Packing `Az.Resources`
17
- To pack `Az.Resources` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/en-us/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team.
17
+ To pack `Az.Resources` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team.
18
18
 
19
19
  ## Module Script Details
20
20
  There are multiple scripts created for performing different actions for developing `Az.Resources`.