@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.
- package/.rush/temp/package-deps_build.json +213 -186
- package/.rush/temp/shrinkwrap-deps.json +322 -326
- package/autorest-configuration.md +60 -47
- package/dist/cmdlets/class.d.ts +21 -8
- package/dist/cmdlets/class.d.ts.map +1 -1
- package/dist/cmdlets/class.js +475 -151
- package/dist/cmdlets/class.js.map +1 -1
- package/dist/cmdlets/namespace.d.ts.map +1 -1
- package/dist/cmdlets/namespace.js +1 -0
- package/dist/cmdlets/namespace.js.map +1 -1
- package/dist/enums/namespace.d.ts.map +1 -1
- package/dist/enums/namespace.js +17 -10
- package/dist/enums/namespace.js.map +1 -1
- package/dist/generators/csproj.d.ts.map +1 -1
- package/dist/generators/csproj.js +2 -1
- package/dist/generators/csproj.js.map +1 -1
- package/dist/generators/gitignore.d.ts.map +1 -1
- package/dist/generators/gitignore.js +1 -0
- package/dist/generators/gitignore.js.map +1 -1
- package/dist/generators/nuspec.d.ts.map +1 -1
- package/dist/generators/nuspec.js +4 -3
- package/dist/generators/nuspec.js.map +1 -1
- package/dist/generators/psm1.d.ts.map +1 -1
- package/dist/generators/psm1.js +24 -15
- package/dist/generators/psm1.js.map +1 -1
- package/dist/generators/script-cmdlet.d.ts.map +1 -1
- package/dist/generators/script-cmdlet.js +1 -1
- package/dist/generators/script-cmdlet.js.map +1 -1
- package/dist/internal/name-inferrer.d.ts.map +1 -1
- package/dist/internal/name-inferrer.js +2 -0
- package/dist/internal/name-inferrer.js.map +1 -1
- package/dist/internal/project.d.ts +46 -5
- package/dist/internal/project.d.ts.map +1 -1
- package/dist/internal/project.js +72 -13
- package/dist/internal/project.js.map +1 -1
- package/dist/internal/state.d.ts +3 -2
- package/dist/internal/state.d.ts.map +1 -1
- package/dist/internal/state.js +3 -3
- package/dist/internal/state.js.map +1 -1
- package/dist/llcsharp/clientruntime.d.ts +5 -0
- package/dist/llcsharp/clientruntime.d.ts.map +1 -1
- package/dist/llcsharp/clientruntime.js +5 -0
- package/dist/llcsharp/clientruntime.js.map +1 -1
- package/dist/llcsharp/enums/enum.d.ts +2 -2
- package/dist/llcsharp/enums/enum.d.ts.map +1 -1
- package/dist/llcsharp/enums/enum.js +11 -10
- package/dist/llcsharp/enums/enum.js.map +1 -1
- package/dist/llcsharp/generator.d.ts +3 -3
- package/dist/llcsharp/generator.d.ts.map +1 -1
- package/dist/llcsharp/generator.js +4 -2
- package/dist/llcsharp/generator.js.map +1 -1
- package/dist/llcsharp/model/interface.d.ts +3 -2
- package/dist/llcsharp/model/interface.d.ts.map +1 -1
- package/dist/llcsharp/model/interface.js +68 -17
- package/dist/llcsharp/model/interface.js.map +1 -1
- package/dist/llcsharp/model/model-class-dictionary.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class-dictionary.js +12 -6
- package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
- package/dist/llcsharp/model/model-class-json.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class-json.js +20 -12
- package/dist/llcsharp/model/model-class-json.js.map +1 -1
- package/dist/llcsharp/model/model-class-serializer.d.ts +9 -21
- package/dist/llcsharp/model/model-class-serializer.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class-serializer.js +21 -50
- package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
- package/dist/llcsharp/model/model-class.d.ts +7 -4
- package/dist/llcsharp/model/model-class.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class.js +147 -82
- package/dist/llcsharp/model/model-class.js.map +1 -1
- package/dist/llcsharp/model/namespace.d.ts +4 -4
- package/dist/llcsharp/model/namespace.d.ts.map +1 -1
- package/dist/llcsharp/model/namespace.js +40 -18
- package/dist/llcsharp/model/namespace.js.map +1 -1
- package/dist/llcsharp/model/property.d.ts +4 -4
- package/dist/llcsharp/model/property.d.ts.map +1 -1
- package/dist/llcsharp/model/property.js +9 -7
- package/dist/llcsharp/model/property.js.map +1 -1
- package/dist/llcsharp/operation/api-class.d.ts.map +1 -1
- package/dist/llcsharp/operation/api-class.js +24 -23
- package/dist/llcsharp/operation/api-class.js.map +1 -1
- package/dist/llcsharp/operation/method.d.ts +7 -5
- package/dist/llcsharp/operation/method.d.ts.map +1 -1
- package/dist/llcsharp/operation/method.js +157 -93
- package/dist/llcsharp/operation/method.js.map +1 -1
- package/dist/llcsharp/operation/namespace.js +2 -1
- package/dist/llcsharp/operation/namespace.js.map +1 -1
- package/dist/llcsharp/operation/parameter.d.ts +4 -4
- package/dist/llcsharp/operation/parameter.d.ts.map +1 -1
- package/dist/llcsharp/operation/parameter.js +7 -5
- package/dist/llcsharp/operation/parameter.js.map +1 -1
- package/dist/llcsharp/project.d.ts +4 -0
- package/dist/llcsharp/project.d.ts.map +1 -1
- package/dist/llcsharp/project.js +7 -2
- package/dist/llcsharp/project.js.map +1 -1
- package/dist/llcsharp/schema/Uuid.d.ts +2 -2
- package/dist/llcsharp/schema/Uuid.d.ts.map +1 -1
- package/dist/llcsharp/schema/Uuid.js.map +1 -1
- package/dist/llcsharp/schema/array.d.ts +3 -3
- package/dist/llcsharp/schema/array.d.ts.map +1 -1
- package/dist/llcsharp/schema/array.js +15 -8
- package/dist/llcsharp/schema/array.js.map +1 -1
- package/dist/llcsharp/schema/binary.d.ts +3 -3
- package/dist/llcsharp/schema/binary.d.ts.map +1 -1
- package/dist/llcsharp/schema/binary.js.map +1 -1
- package/dist/llcsharp/schema/boolean.d.ts +4 -4
- package/dist/llcsharp/schema/boolean.d.ts.map +1 -1
- package/dist/llcsharp/schema/boolean.js +1 -1
- package/dist/llcsharp/schema/boolean.js.map +1 -1
- package/dist/llcsharp/schema/byte-array.d.ts +3 -3
- package/dist/llcsharp/schema/byte-array.d.ts.map +1 -1
- package/dist/llcsharp/schema/byte-array.js +12 -2
- package/dist/llcsharp/schema/byte-array.js.map +1 -1
- package/dist/llcsharp/schema/char.d.ts +4 -4
- package/dist/llcsharp/schema/char.d.ts.map +1 -1
- package/dist/llcsharp/schema/char.js +3 -3
- package/dist/llcsharp/schema/char.js.map +1 -1
- package/dist/llcsharp/schema/date-time.d.ts +7 -7
- package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
- package/dist/llcsharp/schema/date-time.js +4 -4
- package/dist/llcsharp/schema/date-time.js.map +1 -1
- package/dist/llcsharp/schema/date.d.ts +2 -2
- package/dist/llcsharp/schema/date.d.ts.map +1 -1
- package/dist/llcsharp/schema/date.js.map +1 -1
- package/dist/llcsharp/schema/duration.d.ts +5 -5
- package/dist/llcsharp/schema/duration.d.ts.map +1 -1
- package/dist/llcsharp/schema/duration.js +2 -2
- package/dist/llcsharp/schema/duration.js.map +1 -1
- package/dist/llcsharp/schema/enum.d.ts +2 -2
- package/dist/llcsharp/schema/enum.d.ts.map +1 -1
- package/dist/llcsharp/schema/enum.js +5 -3
- package/dist/llcsharp/schema/enum.js.map +1 -1
- package/dist/llcsharp/schema/extended-type-declaration.d.ts +2 -2
- package/dist/llcsharp/schema/extended-type-declaration.d.ts.map +1 -1
- package/dist/llcsharp/schema/integer.d.ts +4 -4
- package/dist/llcsharp/schema/integer.d.ts.map +1 -1
- package/dist/llcsharp/schema/integer.js +1 -1
- package/dist/llcsharp/schema/integer.js.map +1 -1
- package/dist/llcsharp/schema/object.d.ts +3 -3
- package/dist/llcsharp/schema/object.d.ts.map +1 -1
- package/dist/llcsharp/schema/object.js +25 -21
- package/dist/llcsharp/schema/object.js.map +1 -1
- package/dist/llcsharp/schema/password.d.ts +23 -0
- package/dist/llcsharp/schema/password.d.ts.map +1 -0
- package/dist/llcsharp/schema/password.js +89 -0
- package/dist/llcsharp/schema/password.js.map +1 -0
- package/dist/llcsharp/schema/primitive.d.ts +4 -4
- package/dist/llcsharp/schema/primitive.d.ts.map +1 -1
- package/dist/llcsharp/schema/primitive.js +7 -3
- package/dist/llcsharp/schema/primitive.js.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.d.ts +4 -3
- package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.js +61 -64
- package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
- package/dist/llcsharp/schema/string.d.ts +3 -3
- package/dist/llcsharp/schema/string.d.ts.map +1 -1
- package/dist/llcsharp/schema/string.js +14 -10
- package/dist/llcsharp/schema/string.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +23 -14
- package/dist/main.js.map +1 -1
- package/dist/models/model-extensions.d.ts +3 -2
- package/dist/models/model-extensions.d.ts.map +1 -1
- package/dist/models/model-extensions.js +195 -168
- package/dist/models/model-extensions.js.map +1 -1
- package/dist/module/module-class.d.ts +4 -2
- package/dist/module/module-class.d.ts.map +1 -1
- package/dist/module/module-class.js +67 -13
- package/dist/module/module-class.js.map +1 -1
- package/dist/module/module-namespace.d.ts +2 -2
- package/dist/module/module-namespace.d.ts.map +1 -1
- package/dist/module/module-namespace.js +3 -2
- package/dist/module/module-namespace.js.map +1 -1
- package/dist/plugins/add-azure-completers-v2.d.ts +3 -0
- package/dist/plugins/add-azure-completers-v2.d.ts.map +1 -0
- package/dist/plugins/{add-azure-completers.js → add-azure-completers-v2.js} +7 -5
- package/dist/plugins/add-azure-completers-v2.js.map +1 -0
- package/dist/plugins/create-commands-v2.d.ts +40 -0
- package/dist/plugins/create-commands-v2.d.ts.map +1 -0
- package/dist/plugins/{create-commands.js → create-commands-v2.js} +128 -78
- package/dist/plugins/create-commands-v2.js.map +1 -0
- package/dist/plugins/cs-namer-v2.d.ts +3 -0
- package/dist/plugins/cs-namer-v2.d.ts.map +1 -0
- package/dist/plugins/cs-namer-v2.js +230 -0
- package/dist/plugins/cs-namer-v2.js.map +1 -0
- package/dist/plugins/llcsharp-v2.d.ts +3 -0
- package/dist/plugins/llcsharp-v2.d.ts.map +1 -0
- package/dist/plugins/{llcsharp.js → llcsharp-v2.js} +3 -3
- package/dist/plugins/llcsharp-v2.js.map +1 -0
- package/dist/plugins/modifiers-v2.d.ts +3 -0
- package/dist/plugins/modifiers-v2.d.ts.map +1 -0
- package/dist/plugins/{modifiers.js → modifiers-v2.js} +151 -32
- package/dist/plugins/modifiers-v2.js.map +1 -0
- package/dist/plugins/plugin-create-inline-properties.d.ts +4 -0
- package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -0
- package/dist/plugins/plugin-create-inline-properties.js +356 -0
- package/dist/plugins/plugin-create-inline-properties.js.map +1 -0
- package/dist/plugins/plugin-tweak-m4-model.d.ts +3 -0
- package/dist/plugins/plugin-tweak-m4-model.d.ts.map +1 -0
- package/dist/plugins/plugin-tweak-m4-model.js +166 -0
- package/dist/plugins/plugin-tweak-m4-model.js.map +1 -0
- package/dist/plugins/plugin-tweak-model-azure-v2.d.ts +3 -0
- package/dist/plugins/plugin-tweak-model-azure-v2.d.ts.map +1 -0
- package/dist/plugins/plugin-tweak-model-azure-v2.js +169 -0
- package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -0
- package/dist/plugins/plugin-tweak-model.d.ts +9 -0
- package/dist/plugins/plugin-tweak-model.d.ts.map +1 -0
- package/dist/plugins/plugin-tweak-model.js +572 -0
- package/dist/plugins/plugin-tweak-model.js.map +1 -0
- package/dist/plugins/powershell-v2.d.ts +3 -0
- package/dist/plugins/powershell-v2.d.ts.map +1 -0
- package/dist/plugins/{powershell.js → powershell-v2.js} +9 -4
- package/dist/plugins/powershell-v2.js.map +1 -0
- package/dist/plugins/{ps-namer.d.ts → ps-namer-v2.d.ts} +2 -2
- package/dist/plugins/ps-namer-v2.d.ts.map +1 -0
- package/dist/plugins/{ps-namer.js → ps-namer-v2.js} +64 -49
- package/dist/plugins/ps-namer-v2.js.map +1 -0
- package/dist/utils/PwshModel.d.ts +8 -0
- package/dist/utils/PwshModel.d.ts.map +1 -0
- package/dist/utils/PwshModel.js +17 -0
- package/dist/utils/PwshModel.js.map +1 -0
- package/dist/utils/command-operation.d.ts +51 -0
- package/dist/utils/command-operation.d.ts.map +1 -0
- package/dist/utils/command-operation.js +33 -0
- package/dist/utils/command-operation.js.map +1 -0
- package/dist/utils/components.d.ts +133 -0
- package/dist/utils/components.d.ts.map +1 -0
- package/dist/utils/components.js +100 -0
- package/dist/utils/components.js.map +1 -0
- package/dist/utils/extensions.d.ts +11 -0
- package/dist/utils/extensions.d.ts.map +1 -0
- package/dist/utils/extensions.js +16 -0
- package/dist/utils/extensions.js.map +1 -0
- package/dist/utils/http-definitions.d.ts +45 -0
- package/dist/utils/http-definitions.d.ts.map +1 -0
- package/dist/utils/http-definitions.js +47 -0
- package/dist/utils/http-definitions.js.map +1 -0
- package/dist/utils/http-operation.d.ts +8 -0
- package/dist/utils/http-operation.d.ts.map +1 -0
- package/dist/utils/http-operation.js +254 -0
- package/dist/utils/http-operation.js.map +1 -0
- package/dist/utils/info.d.ts +36 -0
- package/dist/utils/info.d.ts.map +1 -0
- package/dist/utils/info.js +36 -0
- package/dist/utils/info.js.map +1 -0
- package/dist/utils/model-state.d.ts +44 -0
- package/dist/utils/model-state.d.ts.map +1 -0
- package/dist/utils/model-state.js +206 -0
- package/dist/utils/model-state.js.map +1 -0
- package/dist/utils/powershell-comment.d.ts +2 -0
- package/dist/utils/powershell-comment.d.ts.map +1 -0
- package/dist/utils/powershell-comment.js +25 -0
- package/dist/utils/powershell-comment.js.map +1 -0
- package/dist/utils/programatic-operation.d.ts +20 -0
- package/dist/utils/programatic-operation.d.ts.map +1 -0
- package/dist/utils/programatic-operation.js +29 -0
- package/dist/utils/programatic-operation.js.map +1 -0
- package/dist/utils/resolve-conflicts.d.ts +7 -0
- package/dist/utils/resolve-conflicts.d.ts.map +1 -0
- package/dist/utils/resolve-conflicts.js +57 -0
- package/dist/utils/resolve-conflicts.js.map +1 -0
- package/dist/utils/schema.d.ts +116 -0
- package/dist/utils/schema.d.ts.map +1 -0
- package/dist/utils/schema.js +186 -0
- package/dist/utils/schema.js.map +1 -0
- package/dist/utils/security-scheme.d.ts +123 -0
- package/dist/utils/security-scheme.d.ts.map +1 -0
- package/dist/utils/security-scheme.js +119 -0
- package/dist/utils/security-scheme.js.map +1 -0
- package/dist/utils/uid.d.ts +2 -0
- package/dist/utils/uid.d.ts.map +1 -0
- package/dist/utils/uid.js +8 -0
- package/dist/utils/uid.js.map +1 -0
- package/package.json +22 -21
- package/resources/assets/build-module.ps1 +12 -15
- package/resources/assets/check-dependencies.ps1 +4 -14
- package/resources/assets/create-model-cmdlets.ps1 +157 -0
- package/resources/assets/custom/{readme.md → README.md} +7 -7
- package/resources/assets/docs/README.md +11 -0
- package/resources/assets/examples/{readme.md → README.md} +0 -0
- package/resources/assets/export-surface.ps1 +1 -11
- package/resources/assets/exports/{readme.md → README.md} +2 -2
- package/resources/assets/generate-help.ps1 +2 -12
- package/resources/assets/how-to.md +5 -5
- package/resources/assets/internal/{readme.md → README.md} +3 -3
- package/resources/assets/pack-module.ps1 +1 -11
- package/resources/assets/resources/{readme.md → README.md} +0 -0
- package/resources/assets/run-module.ps1 +3 -11
- package/resources/assets/test/{readme.md → README.md} +0 -0
- package/resources/assets/test/loadEnv.ps1 +1 -11
- package/resources/assets/test-module.ps1 +39 -24
- package/resources/assets/tools/Resources/{readme.md → README.md} +3 -2
- package/resources/assets/tools/Resources/docs/{readme.md → README.md} +1 -1
- package/resources/assets/tools/Resources/examples/{readme.md → README.md} +0 -0
- package/resources/assets/tools/Resources/how-to.md +5 -5
- package/resources/assets/tools/Resources/resources/{readme.md → README.md} +0 -0
- package/resources/assets/tools/Resources/test/{readme.md → README.md} +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml +496 -0
- package/resources/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml +468 -0
- package/resources/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml +303 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Az.Accounts.nuspec +5 -3
- package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 +387 -0
- package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 +375 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies → 2.7.5/AzSharedAlcAssemblies}/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Hyak.Common.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.Common.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json +945 -404
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
- 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
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
- 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
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Authorization.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Compute.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.KeyVault.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Monitor.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Network.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Websites.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json +2413 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml +3567 -1995
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Storage.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Strategies.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Rest.ClientRuntime.Azure.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.WindowsAzure.Storage.DataMovement.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.WindowsAzure.Storage.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 +219 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/Newtonsoft.Json.10.dll → 2.7.5/PreloadAssemblies/Newtonsoft.Json.dll} +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll +0 -0
- 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
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Memory.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Reflection.DispatchProxy.dll +0 -0
- 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
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.AccessControl.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.Permissions.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.Principal.Windows.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll +0 -0
- 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
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Xml.ReaderWriter.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 +278 -0
- package/resources/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 +234 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/[Content_Types].xml +1 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/_rels/.rels +2 -2
- package/resources/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt +50 -0
- 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
- package/resources/psruntime/AsyncCommandRuntime.cs +4 -0
- package/resources/psruntime/AsyncOperationResponse.cs +10 -11
- package/resources/psruntime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +3 -1
- package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +94 -87
- package/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +168 -102
- package/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs +22 -11
- package/resources/psruntime/BuildTime/Cmdlets/GetScriptCmdlet.cs +2 -1
- package/resources/psruntime/BuildTime/MarkdownRenderer.cs +1 -8
- package/resources/psruntime/BuildTime/Models/PsHelpMarkdownOutputs.cs +33 -11
- package/resources/psruntime/BuildTime/Models/PsHelpTypes.cs +3 -0
- package/resources/psruntime/BuildTime/Models/PsMarkdownTypes.cs +17 -14
- package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +111 -13
- package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +18 -3
- package/resources/psruntime/BuildTime/PsAttributes.cs +1 -1
- package/resources/psruntime/BuildTime/PsExtensions.cs +9 -0
- package/resources/psruntime/BuildTime/PsHelpers.cs +2 -1
- package/resources/psruntime/DictionaryExtensions.cs +8 -11
- package/resources/psruntime/EventDataExtensions.cs +1 -1
- package/resources/psruntime/MessageAttribute.cs +360 -0
- package/resources/psruntime/MessageAttributeHelper.cs +161 -0
- package/resources/psruntime/Properties/Resources.Designer.cs +5633 -0
- package/resources/psruntime/Properties/Resources.resx +1741 -0
- package/resources/psruntime/TypeConverterExtensions.cs +31 -10
- package/resources/runtime/csharp/client/Extensions.cs +7 -1
- package/resources/runtime/csharp/client/IAssociativeArray.cs +4 -1
- package/resources/runtime/csharp/client/UndeclaredResponseException.cs +10 -2
- package/resources/runtime/csharp/json/Customizations/IJsonSerializable.cs +21 -7
- package/resources/runtime/csharp/json/Nodes/JsonNumber.cs +5 -5
- package/resources/runtime/csharp/pipeline/ISendAsync.cs +7 -3
- package/resources/runtime/csharp/pipeline/PipelineMocking.cs +17 -9
- package/resources/utils/Unprotect-SecureString.ps1 +16 -0
- package/changelog.md +0 -4
- package/dist/llcsharp/enums/json-serializer.d.ts +0 -9
- package/dist/llcsharp/enums/json-serializer.d.ts.map +0 -1
- package/dist/llcsharp/enums/json-serializer.js +0 -41
- package/dist/llcsharp/enums/json-serializer.js.map +0 -1
- package/dist/llcsharp/model/model-class-xml.d.ts +0 -15
- package/dist/llcsharp/model/model-class-xml.d.ts.map +0 -1
- package/dist/llcsharp/model/model-class-xml.js +0 -145
- package/dist/llcsharp/model/model-class-xml.js.map +0 -1
- package/dist/plugins/add-azure-completers.d.ts +0 -3
- package/dist/plugins/add-azure-completers.d.ts.map +0 -1
- package/dist/plugins/add-azure-completers.js.map +0 -1
- package/dist/plugins/create-commands.d.ts +0 -38
- package/dist/plugins/create-commands.d.ts.map +0 -1
- package/dist/plugins/create-commands.js.map +0 -1
- package/dist/plugins/cs-namer.d.ts +0 -3
- package/dist/plugins/cs-namer.d.ts.map +0 -1
- package/dist/plugins/cs-namer.js +0 -203
- package/dist/plugins/cs-namer.js.map +0 -1
- package/dist/plugins/llcsharp.d.ts +0 -3
- package/dist/plugins/llcsharp.d.ts.map +0 -1
- package/dist/plugins/llcsharp.js.map +0 -1
- package/dist/plugins/modifiers.d.ts +0 -3
- package/dist/plugins/modifiers.d.ts.map +0 -1
- package/dist/plugins/modifiers.js.map +0 -1
- package/dist/plugins/powershell.d.ts +0 -3
- package/dist/plugins/powershell.d.ts.map +0 -1
- package/dist/plugins/powershell.js.map +0 -1
- package/dist/plugins/ps-namer.d.ts.map +0 -1
- package/dist/plugins/ps-namer.js.map +0 -1
- package/resources/assets/docs/readme.md +0 -11
- package/resources/modules/Az.Accounts/1.8.1/Accounts.format.ps1xml +0 -368
- package/resources/modules/Az.Accounts/1.8.1/Accounts.generated.format.ps1xml +0 -422
- package/resources/modules/Az.Accounts/1.8.1/Accounts.types.ps1xml +0 -281
- package/resources/modules/Az.Accounts/1.8.1/Az.Accounts.psd1 +0 -360
- package/resources/modules/Az.Accounts/1.8.1/Az.Accounts.psm1 +0 -339
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.ApplicationInsights.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Common.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Rest.ClientRuntime.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Numerics.Vectors.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Text.Encodings.Web.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Text.Json.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Threading.Tasks.Extensions.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PostImportScripts/LoadAuthenticators.ps1 +0 -197
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Buffers.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Numerics.Vectors.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Private.ServiceModel.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.4.0.4.0.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.4.0.4.1.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.ServiceModel.Primitives.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Text.Encodings.Web.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Text.Json.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Threading.Tasks.Extensions.4.3.1.0.dll +0 -0
- 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
|
|
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.
|
|
35
|
-
- Used in C# cmdlets to provide a high-level description of the cmdlet. This is
|
|
36
|
-
- `${$project.
|
|
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.
|
|
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 [
|
|
40
|
-
- `${$project.
|
|
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.
|
|
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
|
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/
|
|
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 [
|
|
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 '
|
|
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 [
|
|
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 [
|
|
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 [
|
|
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 [
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
|
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
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
|
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
|
|
35
|
+
- [AutoRest](https://aka.ms/autorest) v3 <br>`npm install -g autorest`<br>
|
|
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>
|
|
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/
|
|
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.
|
|
File without changes
|
|
@@ -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 [
|
|
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 [
|
|
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 [
|
|
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 [
|
|
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/
|
|
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`.
|
|
File without changes
|
|
File without changes
|