@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
|
@@ -52,6 +52,17 @@ schema: {HelpInfo.Schema.ToString(3)}
|
|
|
52
52
|
|
|
53
53
|
internal class HelpExampleOutput
|
|
54
54
|
{
|
|
55
|
+
private string ExampleTemplate =
|
|
56
|
+
"{0}{1}" + Environment.NewLine +
|
|
57
|
+
"{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine +
|
|
58
|
+
"{5}" + Environment.NewLine + Environment.NewLine;
|
|
59
|
+
|
|
60
|
+
private string ExampleTemplateWithOutput =
|
|
61
|
+
"{0}{1}" + Environment.NewLine +
|
|
62
|
+
"{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine +
|
|
63
|
+
"{5}" + Environment.NewLine + "{6}" + Environment.NewLine + "{7}" + Environment.NewLine + Environment.NewLine +
|
|
64
|
+
"{8}" + Environment.NewLine + Environment.NewLine;
|
|
65
|
+
|
|
55
66
|
public MarkdownExampleHelpInfo ExampleInfo { get; }
|
|
56
67
|
|
|
57
68
|
public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo)
|
|
@@ -59,17 +70,26 @@ schema: {HelpInfo.Schema.ToString(3)}
|
|
|
59
70
|
ExampleInfo = exampleInfo;
|
|
60
71
|
}
|
|
61
72
|
|
|
62
|
-
public override string ToString()
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
public override string ToString()
|
|
74
|
+
{
|
|
75
|
+
if (string.IsNullOrEmpty(ExampleInfo.Output))
|
|
76
|
+
{
|
|
77
|
+
return string.Format(ExampleTemplate,
|
|
78
|
+
ExampleNameHeader, ExampleInfo.Name,
|
|
79
|
+
ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter,
|
|
80
|
+
ExampleInfo.Description.ToDescriptionFormat());
|
|
81
|
+
}
|
|
82
|
+
else
|
|
83
|
+
{
|
|
84
|
+
return string.Format(ExampleTemplateWithOutput,
|
|
85
|
+
ExampleNameHeader, ExampleInfo.Name,
|
|
86
|
+
ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter,
|
|
87
|
+
ExampleOutputHeader, ExampleInfo.Output, ExampleOutputFooter,
|
|
88
|
+
ExampleInfo.Description.ToDescriptionFormat()); ;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
70
91
|
}
|
|
71
|
-
|
|
72
|
-
|
|
92
|
+
|
|
73
93
|
internal class HelpParameterOutput
|
|
74
94
|
{
|
|
75
95
|
public MarkdownParameterHelpInfo ParameterInfo { get; }
|
|
@@ -141,7 +161,7 @@ Locale: en-US
|
|
|
141
161
|
}
|
|
142
162
|
|
|
143
163
|
public override string ToString() => $@"### [{HelpInfo.CmdletName}]({HelpInfo.CmdletName}.md)
|
|
144
|
-
{HelpInfo.
|
|
164
|
+
{HelpInfo.Synopsis.ToDescriptionFormat()}
|
|
145
165
|
|
|
146
166
|
";
|
|
147
167
|
}
|
|
@@ -161,6 +181,8 @@ Locale: en-US
|
|
|
161
181
|
public const string ExampleNameHeader = "### ";
|
|
162
182
|
public const string ExampleCodeHeader = "```powershell";
|
|
163
183
|
public const string ExampleCodeFooter = "```";
|
|
184
|
+
public const string ExampleOutputHeader = "```output";
|
|
185
|
+
public const string ExampleOutputFooter = "```";
|
|
164
186
|
|
|
165
187
|
public static HelpMetadataOutput ToHelpMetadataOutput(this MarkdownHelpInfo helpInfo) => new HelpMetadataOutput(helpInfo);
|
|
166
188
|
|
|
@@ -109,18 +109,21 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
109
109
|
{
|
|
110
110
|
public string Title { get; }
|
|
111
111
|
public string Code { get; }
|
|
112
|
+
public string Output { get; }
|
|
112
113
|
public string Remarks { get; }
|
|
113
114
|
|
|
114
115
|
public PsHelpExampleInfo(PSObject exampleObject)
|
|
115
116
|
{
|
|
116
117
|
Title = exampleObject.GetProperty<string>("title");
|
|
117
118
|
Code = exampleObject.GetProperty<string>("code");
|
|
119
|
+
Output = exampleObject.GetProperty<string>("output");
|
|
118
120
|
Remarks = exampleObject.GetProperty<PSObject[]>("remarks").EmptyIfNull().ToDescriptionText();
|
|
119
121
|
}
|
|
120
122
|
public PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample)
|
|
121
123
|
{
|
|
122
124
|
Title = markdownExample.Name;
|
|
123
125
|
Code = markdownExample.Code;
|
|
126
|
+
Output = markdownExample.Output;
|
|
124
127
|
Remarks = markdownExample.Description;
|
|
125
128
|
}
|
|
126
129
|
|
|
@@ -39,7 +39,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
39
39
|
public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string externalHelpFilename = "")
|
|
40
40
|
{
|
|
41
41
|
ExternalHelpFilename = externalHelpFilename;
|
|
42
|
-
ModuleName = variantGroup.ModuleName;
|
|
42
|
+
ModuleName = variantGroup.RootModuleName != "" ? variantGroup.RootModuleName : variantGroup.ModuleName;
|
|
43
43
|
var helpInfo = variantGroup.HelpInfo;
|
|
44
44
|
var commentInfo = variantGroup.CommentInfo;
|
|
45
45
|
Schema = Version.Parse("2.0.0");
|
|
@@ -52,12 +52,12 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
52
52
|
SyntaxInfos = variantGroup.Variants
|
|
53
53
|
.Select(v => new MarkdownSyntaxHelpInfo(v, variantGroup.ParameterGroups, v.VariantName == variantGroup.DefaultParameterSetName))
|
|
54
54
|
.OrderByDescending(v => v.IsDefault).ThenBy(v => v.ParameterSetName).ToArray();
|
|
55
|
-
Examples = GetExamplesFromMarkdown(examplesFolder).NullIfEmpty()
|
|
55
|
+
Examples = GetExamplesFromMarkdown(examplesFolder).NullIfEmpty()
|
|
56
56
|
?? helpInfo.Examples.Select(e => e.ToExampleHelpInfo()).ToArray().NullIfEmpty()
|
|
57
57
|
?? DefaultExampleHelpInfos;
|
|
58
58
|
|
|
59
59
|
Parameters = variantGroup.ParameterGroups
|
|
60
|
-
.Where(pg => !pg.DontShow)
|
|
60
|
+
.Where(pg => !pg.DontShow && !pg.Parameters.All(p => p.IsHidden()))
|
|
61
61
|
.Select(pg => new MarkdownParameterHelpInfo(
|
|
62
62
|
variantGroup.Variants.SelectMany(v => v.HelpInfo.Parameters).Where(phi => phi.Name == pg.ParameterName).ToArray(), pg))
|
|
63
63
|
.OrderBy(phi => phi.Name).ToArray();
|
|
@@ -91,12 +91,17 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
91
91
|
var code = codeStartIndex.HasValue && codeEndIndex.HasValue
|
|
92
92
|
? String.Join(Environment.NewLine, eg.Skip(codeStartIndex.Value + 1).Take(codeEndIndex.Value - (codeStartIndex.Value + 1)))
|
|
93
93
|
: String.Empty;
|
|
94
|
-
var
|
|
94
|
+
var outputStartIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue);
|
|
95
|
+
var outputEndIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i > outputStartIndex);
|
|
96
|
+
var output = outputStartIndex.HasValue && outputEndIndex.HasValue
|
|
97
|
+
? String.Join(Environment.NewLine, eg.Skip(outputStartIndex.Value + 1).Take(outputEndIndex.Value - (outputStartIndex.Value + 1)))
|
|
98
|
+
: String.Empty;
|
|
99
|
+
var descriptionStartIndex = (outputEndIndex ?? (codeEndIndex ?? 0)) + 1;
|
|
95
100
|
descriptionStartIndex = String.IsNullOrWhiteSpace(eg[descriptionStartIndex]) ? descriptionStartIndex + 1 : descriptionStartIndex;
|
|
96
101
|
var descriptionEndIndex = eg.Length - 1;
|
|
97
102
|
descriptionEndIndex = String.IsNullOrWhiteSpace(eg[descriptionEndIndex]) ? descriptionEndIndex - 1 : descriptionEndIndex;
|
|
98
103
|
var description = String.Join(Environment.NewLine, eg.Skip(descriptionStartIndex).Take((descriptionEndIndex + 1) - descriptionStartIndex));
|
|
99
|
-
return new MarkdownExampleHelpInfo(name, code, description);
|
|
104
|
+
return new MarkdownExampleHelpInfo(name, code, output, description);
|
|
100
105
|
}).ToArray();
|
|
101
106
|
}
|
|
102
107
|
}
|
|
@@ -115,7 +120,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
115
120
|
IsDefault = isDefault;
|
|
116
121
|
ParameterSetName = Variant.VariantName;
|
|
117
122
|
Parameters = Variant.Parameters
|
|
118
|
-
.Where(p => !p.DontShow).OrderByDescending(p => p.IsMandatory)
|
|
123
|
+
.Where(p => !p.DontShow && !p.IsHidden()).OrderByDescending(p => p.IsMandatory)
|
|
119
124
|
//https://stackoverflow.com/a/6461526/294804
|
|
120
125
|
.ThenByDescending(p => p.Position.HasValue).ThenBy(p => p.Position)
|
|
121
126
|
// Use the OrderCategory of the parameter group because the final order category is the highest of the group, and not the order category of the individual parameters from the variants.
|
|
@@ -132,10 +137,6 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
132
137
|
{
|
|
133
138
|
parameterStrings = parameterStrings.Append(" [-Confirm]").Append(" [-WhatIf]");
|
|
134
139
|
}
|
|
135
|
-
if (Variant.SupportsPaging)
|
|
136
|
-
{
|
|
137
|
-
parameterStrings = parameterStrings.Append(" [-First <UInt64>]").Append(" [-IncludeTotalCount]").Append(" [-Skip <UInt64>]");
|
|
138
|
-
}
|
|
139
140
|
parameterStrings = parameterStrings.Append(" [<CommonParameters>]");
|
|
140
141
|
|
|
141
142
|
var lines = new List<string>(20);
|
|
@@ -158,12 +159,14 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
158
159
|
{
|
|
159
160
|
public string Name { get; }
|
|
160
161
|
public string Code { get; }
|
|
162
|
+
public string Output { get; }
|
|
161
163
|
public string Description { get; }
|
|
162
164
|
|
|
163
|
-
public MarkdownExampleHelpInfo(string name, string code, string description)
|
|
165
|
+
public MarkdownExampleHelpInfo(string name, string code, string output, string description)
|
|
164
166
|
{
|
|
165
167
|
Name = name;
|
|
166
168
|
Code = code;
|
|
169
|
+
Output = output;
|
|
167
170
|
Description = description;
|
|
168
171
|
}
|
|
169
172
|
}
|
|
@@ -217,12 +220,12 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
217
220
|
|
|
218
221
|
internal static class MarkdownTypesExtensions
|
|
219
222
|
{
|
|
220
|
-
public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Remarks);
|
|
223
|
+
public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks);
|
|
221
224
|
|
|
222
225
|
public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos =
|
|
223
226
|
{
|
|
224
|
-
new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"
|
|
225
|
-
new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"
|
|
227
|
+
new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"),
|
|
228
|
+
new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"),
|
|
226
229
|
};
|
|
227
230
|
|
|
228
231
|
public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters =
|
|
@@ -96,6 +96,17 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
96
96
|
public override string ToString() => HasValidateNotNull ? $"{Indent}[ValidateNotNull()]{Environment.NewLine}" : String.Empty;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
internal class AllowEmptyArrayOutput
|
|
100
|
+
{
|
|
101
|
+
public bool HasAllowEmptyArray { get; }
|
|
102
|
+
|
|
103
|
+
public AllowEmptyArrayOutput(bool hasAllowEmptyArray)
|
|
104
|
+
{
|
|
105
|
+
HasAllowEmptyArray = hasAllowEmptyArray;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
public override string ToString() => HasAllowEmptyArray ? $"{Indent}[AllowEmptyCollection()]{Environment.NewLine}" : String.Empty;
|
|
109
|
+
}
|
|
99
110
|
internal class ArgumentCompleterOutput
|
|
100
111
|
{
|
|
101
112
|
public CompleterInfo CompleterInfo { get; }
|
|
@@ -157,15 +168,56 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
157
168
|
public override string ToString() => $"{Indent}${{{ParameterName}}}{(IsLast ? String.Empty : $",{Environment.NewLine}")}{Environment.NewLine}";
|
|
158
169
|
}
|
|
159
170
|
|
|
160
|
-
internal class
|
|
171
|
+
internal class BaseOutput
|
|
161
172
|
{
|
|
162
173
|
public VariantGroup VariantGroup { get; }
|
|
163
174
|
|
|
164
|
-
|
|
175
|
+
protected static readonly bool IsAzure = Convert.ToBoolean(@"${$project.azure}");
|
|
176
|
+
public BaseOutput(VariantGroup variantGroup)
|
|
165
177
|
{
|
|
166
178
|
VariantGroup = variantGroup;
|
|
167
179
|
}
|
|
180
|
+
public string ClearTelemetryContext()
|
|
181
|
+
{
|
|
182
|
+
return (!VariantGroup.IsInternal && IsAzure) ? $@"{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()" : "";
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
internal class BeginOutput : BaseOutput
|
|
187
|
+
{
|
|
188
|
+
public BeginOutput(VariantGroup variantGroup) : base(variantGroup)
|
|
189
|
+
{
|
|
190
|
+
}
|
|
168
191
|
|
|
192
|
+
public string GetProcessCustomAttributesAtRuntime()
|
|
193
|
+
{
|
|
194
|
+
return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Message.ClientRuntime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)";
|
|
195
|
+
}
|
|
196
|
+
private string GetTelemetry()
|
|
197
|
+
{
|
|
198
|
+
if (!VariantGroup.IsInternal && IsAzure)
|
|
199
|
+
{
|
|
200
|
+
return $@"
|
|
201
|
+
{Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{
|
|
202
|
+
{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
|
|
203
|
+
{Indent}{Indent}}}
|
|
204
|
+
{Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
|
|
205
|
+
{Indent}{Indent}if ($preTelemetryId -eq '') {{
|
|
206
|
+
{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
|
|
207
|
+
{Indent}{Indent}{Indent}[Microsoft.Rest.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
|
|
208
|
+
{Indent}{Indent}}} else {{
|
|
209
|
+
{Indent}{Indent}{Indent}$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
|
|
210
|
+
{Indent}{Indent}{Indent}if ($internalCalledCmdlets -eq '') {{
|
|
211
|
+
{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
|
|
212
|
+
{Indent}{Indent}{Indent}}} else {{
|
|
213
|
+
{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
|
|
214
|
+
{Indent}{Indent}{Indent}}}
|
|
215
|
+
{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
|
|
216
|
+
{Indent}{Indent}}}
|
|
217
|
+
";
|
|
218
|
+
}
|
|
219
|
+
return "";
|
|
220
|
+
}
|
|
169
221
|
public override string ToString() => $@"begin {{
|
|
170
222
|
{Indent}try {{
|
|
171
223
|
{Indent}{Indent}$outBuffer = $null
|
|
@@ -173,12 +225,15 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
173
225
|
{Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1
|
|
174
226
|
{Indent}{Indent}}}
|
|
175
227
|
{Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName
|
|
228
|
+
{GetTelemetry()}
|
|
176
229
|
{GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()}
|
|
230
|
+
{GetProcessCustomAttributesAtRuntime()}
|
|
177
231
|
{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
|
|
178
232
|
{Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}}
|
|
179
233
|
{Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
|
|
180
234
|
{Indent}{Indent}$steppablePipeline.Begin($PSCmdlet)
|
|
181
235
|
{Indent}}} catch {{
|
|
236
|
+
{ClearTelemetryContext()}
|
|
182
237
|
{Indent}{Indent}throw
|
|
183
238
|
{Indent}}}
|
|
184
239
|
}}
|
|
@@ -215,28 +270,69 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
215
270
|
}
|
|
216
271
|
}
|
|
217
272
|
|
|
218
|
-
internal class ProcessOutput
|
|
273
|
+
internal class ProcessOutput : BaseOutput
|
|
219
274
|
{
|
|
275
|
+
public ProcessOutput(VariantGroup variantGroup) : base(variantGroup)
|
|
276
|
+
{
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
private string GetFinally()
|
|
280
|
+
{
|
|
281
|
+
if (IsAzure && !VariantGroup.IsInternal)
|
|
282
|
+
{
|
|
283
|
+
return $@"
|
|
284
|
+
{Indent}finally {{
|
|
285
|
+
{Indent}{Indent}$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
|
|
286
|
+
{Indent}{Indent}$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
|
|
287
|
+
{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
|
|
288
|
+
{Indent}}}
|
|
289
|
+
";
|
|
290
|
+
}
|
|
291
|
+
return "";
|
|
292
|
+
}
|
|
220
293
|
public override string ToString() => $@"process {{
|
|
221
294
|
{Indent}try {{
|
|
222
295
|
{Indent}{Indent}$steppablePipeline.Process($_)
|
|
223
296
|
{Indent}}} catch {{
|
|
297
|
+
{ClearTelemetryContext()}
|
|
224
298
|
{Indent}{Indent}throw
|
|
225
299
|
{Indent}}}
|
|
300
|
+
{GetFinally()}
|
|
226
301
|
}}
|
|
227
|
-
|
|
228
302
|
";
|
|
229
303
|
}
|
|
230
304
|
|
|
231
|
-
internal class EndOutput
|
|
305
|
+
internal class EndOutput : BaseOutput
|
|
232
306
|
{
|
|
307
|
+
public EndOutput(VariantGroup variantGroup) : base(variantGroup)
|
|
308
|
+
{
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
private string GetTelemetry()
|
|
312
|
+
{
|
|
313
|
+
if (!VariantGroup.IsInternal && IsAzure)
|
|
314
|
+
{
|
|
315
|
+
return $@"
|
|
316
|
+
{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
|
|
317
|
+
{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
|
|
318
|
+
{Indent}{Indent}if ($preTelemetryId -eq '') {{
|
|
319
|
+
{Indent}{Indent}{Indent}[Microsoft.Rest.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
|
|
320
|
+
{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
|
|
321
|
+
{Indent}{Indent}}}
|
|
322
|
+
{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
|
|
323
|
+
";
|
|
324
|
+
}
|
|
325
|
+
return "";
|
|
326
|
+
}
|
|
233
327
|
public override string ToString() => $@"end {{
|
|
234
328
|
{Indent}try {{
|
|
235
329
|
{Indent}{Indent}$steppablePipeline.End()
|
|
330
|
+
{GetTelemetry()}
|
|
236
331
|
{Indent}}} catch {{
|
|
332
|
+
{ClearTelemetryContext()}
|
|
237
333
|
{Indent}{Indent}throw
|
|
238
334
|
{Indent}}}
|
|
239
|
-
}}
|
|
335
|
+
}}
|
|
240
336
|
";
|
|
241
337
|
}
|
|
242
338
|
|
|
@@ -290,7 +386,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
290
386
|
|
|
291
387
|
public override string ToString() => !String.IsNullOrEmpty(Description)
|
|
292
388
|
? Description.ToDescriptionFormat(false).NormalizeNewLines()
|
|
293
|
-
.Split(new
|
|
389
|
+
.Split(new[] { Environment.NewLine }, StringSplitOptions.None)
|
|
294
390
|
.Aggregate(String.Empty, (c, n) => c + $"{Indent}# {n}{Environment.NewLine}")
|
|
295
391
|
: String.Empty;
|
|
296
392
|
}
|
|
@@ -366,7 +462,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
366
462
|
public Type ParameterType { get; }
|
|
367
463
|
public bool IsMandatory { get; }
|
|
368
464
|
public int? Position { get; }
|
|
369
|
-
|
|
465
|
+
|
|
370
466
|
public bool IncludeSpace { get; }
|
|
371
467
|
public bool IncludeDash { get; }
|
|
372
468
|
|
|
@@ -432,7 +528,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
432
528
|
// https://stackoverflow.com/a/5284606/294804
|
|
433
529
|
private static string RemoveEnd(this string text, string suffix) => text.EndsWith(suffix) ? text.Substring(0, text.Length - suffix.Length) : text;
|
|
434
530
|
|
|
435
|
-
public static string ToPsSingleLine(this string value, string replacer = " ") => value.ReplaceNewLines(replacer, new
|
|
531
|
+
public static string ToPsSingleLine(this string value, string replacer = " ") => value.ReplaceNewLines(replacer, new[] { "<br>", "\r\n", "\n" });
|
|
436
532
|
|
|
437
533
|
public static string ToPsStringLiteral(this string value) => value?.Replace("'", "''").Replace("‘", "''").Replace("’", "''").ToPsSingleLine().Trim() ?? String.Empty;
|
|
438
534
|
|
|
@@ -465,6 +561,8 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
465
561
|
|
|
466
562
|
public static ValidateNotNullOutput ToValidateNotNullOutput(this bool hasValidateNotNull) => new ValidateNotNullOutput(hasValidateNotNull);
|
|
467
563
|
|
|
564
|
+
public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray);
|
|
565
|
+
|
|
468
566
|
public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo);
|
|
469
567
|
|
|
470
568
|
public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup);
|
|
@@ -475,9 +573,9 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
475
573
|
|
|
476
574
|
public static BeginOutput ToBeginOutput(this VariantGroup variantGroup) => new BeginOutput(variantGroup);
|
|
477
575
|
|
|
478
|
-
public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput();
|
|
576
|
+
public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(variantGroup);
|
|
479
577
|
|
|
480
|
-
public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput();
|
|
578
|
+
public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(variantGroup);
|
|
481
579
|
|
|
482
580
|
public static HelpCommentOutput ToHelpCommentOutput(this VariantGroup variantGroup) => new HelpCommentOutput(variantGroup);
|
|
483
581
|
|
|
@@ -497,7 +595,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
497
595
|
|
|
498
596
|
public static string ToNoteOutput(this ComplexInterfaceInfo complexInterfaceInfo, string currentIndent = "", bool includeDashes = false, bool includeBackticks = false, bool isFirst = true)
|
|
499
597
|
{
|
|
500
|
-
string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) =>
|
|
598
|
+
string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) =>
|
|
501
599
|
$"{indent}{(dash ? "- " : String.Empty)}{(backtick ? "`" : String.Empty)}{info.ToPropertySyntaxOutput()}{(backtick ? "`" : String.Empty)}: {info.Description}";
|
|
502
600
|
|
|
503
601
|
var nested = complexInterfaceInfo.NestedInfos.Select(ni =>
|
|
@@ -506,7 +604,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
506
604
|
return ni.IsComplexInterface
|
|
507
605
|
? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false)
|
|
508
606
|
: RenderProperty(ni, nestedIndent, includeDashes, includeBackticks);
|
|
509
|
-
}).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes,
|
|
607
|
+
}).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, includeBackticks));
|
|
510
608
|
return String.Join(Environment.NewLine, nested);
|
|
511
609
|
}
|
|
512
610
|
}
|
|
@@ -30,6 +30,8 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
30
30
|
internal class VariantGroup
|
|
31
31
|
{
|
|
32
32
|
public string ModuleName { get; }
|
|
33
|
+
|
|
34
|
+
public string RootModuleName {get => @"${$project.rootModuleName}";}
|
|
33
35
|
public string CmdletName { get; }
|
|
34
36
|
public string CmdletVerb { get; }
|
|
35
37
|
public string CmdletNoun { get; }
|
|
@@ -171,6 +173,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
171
173
|
|
|
172
174
|
public string[] Aliases { get; }
|
|
173
175
|
public bool HasValidateNotNull { get; }
|
|
176
|
+
public bool HasAllowEmptyArray { get; }
|
|
174
177
|
public CompleterInfo CompleterInfo { get; }
|
|
175
178
|
public DefaultInfo DefaultInfo { get; }
|
|
176
179
|
public bool HasDefaultInfo { get; }
|
|
@@ -205,6 +208,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
205
208
|
|
|
206
209
|
Aliases = Parameters.SelectMany(p => p.Attributes).ToAliasNames().ToArray();
|
|
207
210
|
HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType<ValidateNotNullAttribute>()).Any();
|
|
211
|
+
HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType<AllowEmptyCollectionAttribute>()).Any();
|
|
208
212
|
CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo()
|
|
209
213
|
?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo();
|
|
210
214
|
DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this)
|
|
@@ -383,7 +387,9 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
383
387
|
helpInfo.OutputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(ot => ot.Name).ToArray())
|
|
384
388
|
.Where(o => o != "None").Distinct().OrderBy(o => o).ToArray();
|
|
385
389
|
|
|
386
|
-
|
|
390
|
+
// Use root module name in the help link
|
|
391
|
+
var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant();
|
|
392
|
+
OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}";
|
|
387
393
|
RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray();
|
|
388
394
|
}
|
|
389
395
|
}
|
|
@@ -466,12 +472,21 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
466
472
|
{
|
|
467
473
|
var parameters = variant.Metadata.Parameters.AsEnumerable();
|
|
468
474
|
var parameterHelp = variant.HelpInfo.Parameters.AsEnumerable();
|
|
475
|
+
|
|
469
476
|
if (variant.HasParameterSets)
|
|
470
477
|
{
|
|
471
478
|
parameters = parameters.Where(p => p.Value.ParameterSets.Keys.Any(k => k == variant.VariantName || k == AllParameterSets));
|
|
472
|
-
parameterHelp = parameterHelp.Where(ph => !ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets));
|
|
479
|
+
parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount");
|
|
480
|
+
}
|
|
481
|
+
var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key)));
|
|
482
|
+
if (variant.SupportsPaging) {
|
|
483
|
+
// If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters
|
|
484
|
+
variant.Info.Parameters["First"].Attributes.OfType<ParameterAttribute>().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects.";
|
|
485
|
+
variant.Info.Parameters["Skip"].Attributes.OfType<ParameterAttribute>().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects.";
|
|
486
|
+
result = result.Append(new Parameter(variant.VariantName, "First", variant.Info.Parameters["First"], parameterHelp.FirstOrDefault(ph => ph.Name == "First")));
|
|
487
|
+
result = result.Append(new Parameter(variant.VariantName, "Skip", variant.Info.Parameters["Skip"], parameterHelp.FirstOrDefault(ph => ph.Name == "Skip")));
|
|
473
488
|
}
|
|
474
|
-
return
|
|
489
|
+
return result.ToArray();
|
|
475
490
|
}
|
|
476
491
|
|
|
477
492
|
public static Attribute[] ToAttributes(this Variant variant) => variant.IsFunction
|
|
@@ -156,5 +156,14 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
156
156
|
|
|
157
157
|
public static void RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block)
|
|
158
158
|
=> engineIntrinsics.RunScript<PSObject>(block.ToString());
|
|
159
|
+
|
|
160
|
+
/// <summary>
|
|
161
|
+
/// Returns if a parameter should be hidden by checking for <see cref="DoNotExportAttribute" />.
|
|
162
|
+
/// </summary>
|
|
163
|
+
/// <param name="parameter">A PowerShell parameter.</param>
|
|
164
|
+
public static bool IsHidden(this Parameter parameter)
|
|
165
|
+
{
|
|
166
|
+
return parameter.Attributes.Any(attr => attr is DoNotExportAttribute);
|
|
167
|
+
}
|
|
159
168
|
}
|
|
160
169
|
}
|
|
@@ -39,9 +39,10 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
39
39
|
public static IEnumerable<FunctionInfo> GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder)
|
|
40
40
|
{
|
|
41
41
|
// https://stackoverflow.com/a/40969712/294804
|
|
42
|
+
var wrappedFolder = scriptFolder.Contains("'") ? $@"""{scriptFolder}""" : $@"'{scriptFolder}'";
|
|
42
43
|
var getCmdletsCommand = $@"
|
|
43
44
|
$currentFunctions = Get-ChildItem function:
|
|
44
|
-
Get-ChildItem -Path
|
|
45
|
+
Get-ChildItem -Path {wrappedFolder} -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }}
|
|
45
46
|
Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }}
|
|
46
47
|
";
|
|
47
48
|
return cmdlet?.RunScript<FunctionInfo>(getCmdletsCommand) ?? RunScript<FunctionInfo>(getCmdletsCommand);
|
|
@@ -8,26 +8,23 @@ namespace Microsoft.Rest.ClientRuntime
|
|
|
8
8
|
{
|
|
9
9
|
internal static void HashTableToDictionary<V>(System.Collections.Hashtable hashtable, System.Collections.Generic.IDictionary<string, V> dictionary)
|
|
10
10
|
{
|
|
11
|
+
if (null == hashtable)
|
|
12
|
+
{
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
11
15
|
foreach (var each in hashtable.Keys)
|
|
12
16
|
{
|
|
13
17
|
var key = each.ToString();
|
|
14
18
|
var value = hashtable[key];
|
|
15
19
|
if (null != value)
|
|
16
20
|
{
|
|
17
|
-
|
|
21
|
+
try
|
|
18
22
|
{
|
|
19
|
-
|
|
23
|
+
dictionary[key] = (V)value;
|
|
20
24
|
}
|
|
21
|
-
|
|
25
|
+
catch
|
|
22
26
|
{
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
dictionary[key] = (V)value;
|
|
26
|
-
}
|
|
27
|
-
catch
|
|
28
|
-
{
|
|
29
|
-
// Values getting dropped; not compatible with target dictionary. Not sure what to do here.
|
|
30
|
-
}
|
|
27
|
+
// Values getting dropped; not compatible with target dictionary. Not sure what to do here.
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
30
|
}
|
|
@@ -7,7 +7,6 @@ namespace Microsoft.Rest.ClientRuntime
|
|
|
7
7
|
{
|
|
8
8
|
using System;
|
|
9
9
|
|
|
10
|
-
[System.ComponentModel.TypeConverter(typeof(EventDataConverter))]
|
|
11
10
|
/// <summary>
|
|
12
11
|
/// PowerShell-specific data on top of the llc# EventData
|
|
13
12
|
/// </summary>
|
|
@@ -16,6 +15,7 @@ namespace Microsoft.Rest.ClientRuntime
|
|
|
16
15
|
/// Obviously, this code would need to be duplcated on both modules.
|
|
17
16
|
/// This is preferable to sharing a common library, as versioning makes that problematic.
|
|
18
17
|
/// </remarks>
|
|
18
|
+
[System.ComponentModel.TypeConverter(typeof(EventDataConverter))]
|
|
19
19
|
public partial class EventData : EventArgs
|
|
20
20
|
{
|
|
21
21
|
}
|