@autorest/powershell 2.1.400 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/package-deps_build.json +350 -0
- package/.rush/temp/shrinkwrap-deps.json +433 -0
- 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,360 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
namespace Microsoft.Message.ClientRuntime
|
|
6
|
+
{
|
|
7
|
+
using Microsoft.generated.runtime.Properties;
|
|
8
|
+
using System;
|
|
9
|
+
using System.Collections.Generic;
|
|
10
|
+
using System.Globalization;
|
|
11
|
+
using System.Linq;
|
|
12
|
+
using System.Management.Automation;
|
|
13
|
+
using System.Text;
|
|
14
|
+
|
|
15
|
+
[AttributeUsage(AttributeTargets.All)]
|
|
16
|
+
public class GenericBreakingChangeAttribute : Attribute
|
|
17
|
+
{
|
|
18
|
+
private string _message;
|
|
19
|
+
//A dexcription of what the change is about, non mandatory
|
|
20
|
+
public string ChangeDescription { get; set; } = null;
|
|
21
|
+
|
|
22
|
+
//The version the change is effective from, non mandatory
|
|
23
|
+
public string DeprecateByVersion { get; }
|
|
24
|
+
public bool DeprecateByVersionSet { get; } = false;
|
|
25
|
+
|
|
26
|
+
//The date on which the change comes in effect
|
|
27
|
+
public DateTime ChangeInEfectByDate { get; }
|
|
28
|
+
public bool ChangeInEfectByDateSet { get; } = false;
|
|
29
|
+
|
|
30
|
+
//Old way of calling the cmdlet
|
|
31
|
+
public string OldWay { get; set; }
|
|
32
|
+
//New way fo calling the cmdlet
|
|
33
|
+
public string NewWay { get; set; }
|
|
34
|
+
|
|
35
|
+
public GenericBreakingChangeAttribute(string message)
|
|
36
|
+
{
|
|
37
|
+
_message = message;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public GenericBreakingChangeAttribute(string message, string deprecateByVersion)
|
|
41
|
+
{
|
|
42
|
+
_message = message;
|
|
43
|
+
this.DeprecateByVersion = deprecateByVersion;
|
|
44
|
+
this.DeprecateByVersionSet = true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public GenericBreakingChangeAttribute(string message, string deprecateByVersion, string changeInEfectByDate)
|
|
48
|
+
{
|
|
49
|
+
_message = message;
|
|
50
|
+
this.DeprecateByVersion = deprecateByVersion;
|
|
51
|
+
this.DeprecateByVersionSet = true;
|
|
52
|
+
|
|
53
|
+
if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result))
|
|
54
|
+
{
|
|
55
|
+
this.ChangeInEfectByDate = result;
|
|
56
|
+
this.ChangeInEfectByDateSet = true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public DateTime getInEffectByDate()
|
|
61
|
+
{
|
|
62
|
+
return this.ChangeInEfectByDate.Date;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* This function prints out the breaking change message for the attribute on the cmdline
|
|
68
|
+
* */
|
|
69
|
+
public void PrintCustomAttributeInfo(Action<string> writeOutput)
|
|
70
|
+
{
|
|
71
|
+
|
|
72
|
+
if (!GetAttributeSpecificMessage().StartsWith(Environment.NewLine))
|
|
73
|
+
{
|
|
74
|
+
writeOutput(Environment.NewLine);
|
|
75
|
+
}
|
|
76
|
+
writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage()));
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
if (!string.IsNullOrWhiteSpace(ChangeDescription))
|
|
80
|
+
{
|
|
81
|
+
writeOutput(string.Format(Resources.BreakingChangesAttributesChangeDescriptionMessage, this.ChangeDescription));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (ChangeInEfectByDateSet)
|
|
85
|
+
{
|
|
86
|
+
writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d")));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (DeprecateByVersionSet)
|
|
90
|
+
{
|
|
91
|
+
writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (OldWay != null && NewWay != null)
|
|
95
|
+
{
|
|
96
|
+
writeOutput(string.Format(Resources.BreakingChangesAttributesUsageChangeMessageConsole, OldWay, NewWay));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
public virtual bool IsApplicableToInvocation(InvocationInfo invocation)
|
|
101
|
+
{
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
protected virtual string GetAttributeSpecificMessage()
|
|
106
|
+
{
|
|
107
|
+
return _message;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
[AttributeUsage(AttributeTargets.All)]
|
|
112
|
+
public class CmdletBreakingChangeAttribute : GenericBreakingChangeAttribute
|
|
113
|
+
{
|
|
114
|
+
|
|
115
|
+
public string ReplacementCmdletName { get; set; }
|
|
116
|
+
|
|
117
|
+
public CmdletBreakingChangeAttribute() :
|
|
118
|
+
base(string.Empty)
|
|
119
|
+
{
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
public CmdletBreakingChangeAttribute(string deprecateByVersione) :
|
|
123
|
+
base(string.Empty, deprecateByVersione)
|
|
124
|
+
{
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
public CmdletBreakingChangeAttribute(string deprecateByVersion, string changeInEfectByDate) :
|
|
128
|
+
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
129
|
+
{
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
protected override string GetAttributeSpecificMessage()
|
|
133
|
+
{
|
|
134
|
+
if (string.IsNullOrWhiteSpace(ReplacementCmdletName))
|
|
135
|
+
{
|
|
136
|
+
return Resources.BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement;
|
|
137
|
+
}
|
|
138
|
+
else
|
|
139
|
+
{
|
|
140
|
+
return string.Format(Resources.BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement, ReplacementCmdletName);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
[AttributeUsage(AttributeTargets.All)]
|
|
146
|
+
public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute
|
|
147
|
+
{
|
|
148
|
+
public string[] ChangedParameterSet { set; get; }
|
|
149
|
+
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet) :
|
|
150
|
+
base(string.Empty)
|
|
151
|
+
{
|
|
152
|
+
ChangedParameterSet = changedParameterSet;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersione) :
|
|
156
|
+
base(string.Empty, deprecateByVersione)
|
|
157
|
+
{
|
|
158
|
+
ChangedParameterSet = changedParameterSet;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersion, string changeInEfectByDate) :
|
|
162
|
+
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
163
|
+
{
|
|
164
|
+
ChangedParameterSet = changedParameterSet;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
protected override string GetAttributeSpecificMessage()
|
|
168
|
+
{
|
|
169
|
+
|
|
170
|
+
return Resources.BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement;
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
public bool IsApplicableToInvocation(InvocationInfo invocation, string parameterSetName)
|
|
175
|
+
{
|
|
176
|
+
if (ChangedParameterSet != null)
|
|
177
|
+
return ChangedParameterSet.Contains(parameterSetName);
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
[AttributeUsage(AttributeTargets.All)]
|
|
184
|
+
public class PreviewMessageAttribute : Attribute
|
|
185
|
+
{
|
|
186
|
+
public string _message;
|
|
187
|
+
|
|
188
|
+
public PreviewMessageAttribute()
|
|
189
|
+
{
|
|
190
|
+
this._message = Resources.PreviewCmdletMessage;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
public PreviewMessageAttribute(string message)
|
|
194
|
+
{
|
|
195
|
+
this._message = message;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
public void PrintCustomAttributeInfo(System.Management.Automation.PSCmdlet psCmdlet)
|
|
199
|
+
{
|
|
200
|
+
psCmdlet.WriteWarning(this._message);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
public virtual bool IsApplicableToInvocation(InvocationInfo invocation)
|
|
204
|
+
{
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
|
|
210
|
+
public class ParameterBreakingChangeAttribute : GenericBreakingChangeAttribute
|
|
211
|
+
{
|
|
212
|
+
public string NameOfParameterChanging { get; }
|
|
213
|
+
|
|
214
|
+
public string ReplaceMentCmdletParameterName { get; set; } = null;
|
|
215
|
+
|
|
216
|
+
public bool IsBecomingMandatory { get; set; } = false;
|
|
217
|
+
|
|
218
|
+
public String OldParamaterType { get; set; }
|
|
219
|
+
|
|
220
|
+
public String NewParameterType { get; set; }
|
|
221
|
+
|
|
222
|
+
public ParameterBreakingChangeAttribute(string nameOfParameterChanging) :
|
|
223
|
+
base(string.Empty)
|
|
224
|
+
{
|
|
225
|
+
this.NameOfParameterChanging = nameOfParameterChanging;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion) :
|
|
229
|
+
base(string.Empty, deprecateByVersion)
|
|
230
|
+
{
|
|
231
|
+
this.NameOfParameterChanging = nameOfParameterChanging;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion, string changeInEfectByDate) :
|
|
235
|
+
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
236
|
+
{
|
|
237
|
+
this.NameOfParameterChanging = nameOfParameterChanging;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
protected override string GetAttributeSpecificMessage()
|
|
241
|
+
{
|
|
242
|
+
StringBuilder message = new StringBuilder();
|
|
243
|
+
if (!string.IsNullOrWhiteSpace(ReplaceMentCmdletParameterName))
|
|
244
|
+
{
|
|
245
|
+
if (IsBecomingMandatory)
|
|
246
|
+
{
|
|
247
|
+
message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplacedMandatory, NameOfParameterChanging, ReplaceMentCmdletParameterName));
|
|
248
|
+
}
|
|
249
|
+
else
|
|
250
|
+
{
|
|
251
|
+
message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplaced, NameOfParameterChanging, ReplaceMentCmdletParameterName));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
else
|
|
255
|
+
{
|
|
256
|
+
if (IsBecomingMandatory)
|
|
257
|
+
{
|
|
258
|
+
message.Append(string.Format(Resources.BreakingChangeAttributeParameterMandatoryNow, NameOfParameterChanging));
|
|
259
|
+
}
|
|
260
|
+
else
|
|
261
|
+
{
|
|
262
|
+
message.Append(string.Format(Resources.BreakingChangeAttributeParameterChanging, NameOfParameterChanging));
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
//See if the type of the param is changing
|
|
267
|
+
if (OldParamaterType != null && !string.IsNullOrWhiteSpace(NewParameterType))
|
|
268
|
+
{
|
|
269
|
+
message.Append(string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType, NewParameterType));
|
|
270
|
+
}
|
|
271
|
+
return message.ToString();
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/// <summary>
|
|
275
|
+
/// See if the bound parameters contain the current parameter, if they do
|
|
276
|
+
/// then the attribbute is applicable
|
|
277
|
+
/// If the invocationInfo is null we return true
|
|
278
|
+
/// </summary>
|
|
279
|
+
/// <param name="invocationInfo"></param>
|
|
280
|
+
/// <returns>bool</returns>
|
|
281
|
+
public override bool IsApplicableToInvocation(InvocationInfo invocationInfo)
|
|
282
|
+
{
|
|
283
|
+
bool? applicable = invocationInfo == null ? true : invocationInfo.BoundParameters?.Keys?.Contains(this.NameOfParameterChanging);
|
|
284
|
+
return applicable.HasValue ? applicable.Value : false;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
[AttributeUsage(AttributeTargets.All)]
|
|
289
|
+
public class OutputBreakingChangeAttribute : GenericBreakingChangeAttribute
|
|
290
|
+
{
|
|
291
|
+
public string DeprecatedCmdLetOutputType { get; }
|
|
292
|
+
|
|
293
|
+
//This is still a String instead of a Type as this
|
|
294
|
+
//might be undefined at the time of adding the attribute
|
|
295
|
+
public string ReplacementCmdletOutputType { get; set; }
|
|
296
|
+
|
|
297
|
+
public string[] DeprecatedOutputProperties { get; set; }
|
|
298
|
+
|
|
299
|
+
public string[] NewOutputProperties { get; set; }
|
|
300
|
+
|
|
301
|
+
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType) :
|
|
302
|
+
base(string.Empty)
|
|
303
|
+
{
|
|
304
|
+
this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion) :
|
|
308
|
+
base(string.Empty, deprecateByVersion)
|
|
309
|
+
{
|
|
310
|
+
this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion, string changeInEfectByDate) :
|
|
314
|
+
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
315
|
+
{
|
|
316
|
+
this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
protected override string GetAttributeSpecificMessage()
|
|
320
|
+
{
|
|
321
|
+
StringBuilder message = new StringBuilder();
|
|
322
|
+
|
|
323
|
+
//check for the deprecation scenario
|
|
324
|
+
if (string.IsNullOrWhiteSpace(ReplacementCmdletOutputType) && NewOutputProperties == null && DeprecatedOutputProperties == null && string.IsNullOrWhiteSpace(ChangeDescription))
|
|
325
|
+
{
|
|
326
|
+
message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputTypeDeprecated, DeprecatedCmdLetOutputType));
|
|
327
|
+
}
|
|
328
|
+
else
|
|
329
|
+
{
|
|
330
|
+
if (!string.IsNullOrWhiteSpace(ReplacementCmdletOutputType))
|
|
331
|
+
{
|
|
332
|
+
message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange1, DeprecatedCmdLetOutputType, ReplacementCmdletOutputType));
|
|
333
|
+
}
|
|
334
|
+
else
|
|
335
|
+
{
|
|
336
|
+
message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange2, DeprecatedCmdLetOutputType));
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (DeprecatedOutputProperties != null && DeprecatedOutputProperties.Length > 0)
|
|
340
|
+
{
|
|
341
|
+
message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesRemoved);
|
|
342
|
+
foreach (string property in DeprecatedOutputProperties)
|
|
343
|
+
{
|
|
344
|
+
message.Append(" '" + property + "'");
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (NewOutputProperties != null && NewOutputProperties.Length > 0)
|
|
349
|
+
{
|
|
350
|
+
message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesAdded);
|
|
351
|
+
foreach (string property in NewOutputProperties)
|
|
352
|
+
{
|
|
353
|
+
message.Append(" '" + property + "'");
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return message.ToString();
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
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.
|
|
13
|
+
// ----------------------------------------------------------------------------------
|
|
14
|
+
namespace Microsoft.Message.ClientRuntime
|
|
15
|
+
{
|
|
16
|
+
using Microsoft.generated.runtime.Properties;
|
|
17
|
+
using System;
|
|
18
|
+
using System.Collections.Generic;
|
|
19
|
+
using System.Linq;
|
|
20
|
+
using System.Management.Automation;
|
|
21
|
+
using System.Reflection;
|
|
22
|
+
using System.Text;
|
|
23
|
+
using System.Threading.Tasks;
|
|
24
|
+
public class MessageAttributeHelper
|
|
25
|
+
{
|
|
26
|
+
public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings";
|
|
27
|
+
public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This function takes in a CommandInfo (CmdletInfo or FunctionInfo)
|
|
31
|
+
* And reads all the deprecation attributes attached to it
|
|
32
|
+
* Prints a message on the cmdline For each of the attribute found
|
|
33
|
+
*
|
|
34
|
+
* the boundParameterNames is a list of parameters bound to the cmdlet at runtime,
|
|
35
|
+
* We only process the Parameter beaking change attributes attached only params listed in this list (if present)
|
|
36
|
+
* */
|
|
37
|
+
public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet)
|
|
38
|
+
{
|
|
39
|
+
bool supressWarningOrError = false;
|
|
40
|
+
|
|
41
|
+
try
|
|
42
|
+
{
|
|
43
|
+
supressWarningOrError = bool.Parse(System.Environment.GetEnvironmentVariable(SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME));
|
|
44
|
+
}
|
|
45
|
+
catch (Exception)
|
|
46
|
+
{
|
|
47
|
+
//no action
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (supressWarningOrError)
|
|
51
|
+
{
|
|
52
|
+
//Do not process the attributes at runtime... The env variable to override the warning messages is set
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
List<GenericBreakingChangeAttribute> attributes = new List<GenericBreakingChangeAttribute>(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet));
|
|
57
|
+
StringBuilder sb = new StringBuilder();
|
|
58
|
+
Action<string> appendBreakingChangeInfo = (string s) => sb.Append(s);
|
|
59
|
+
|
|
60
|
+
if (attributes != null && attributes.Count > 0)
|
|
61
|
+
{
|
|
62
|
+
appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0]));
|
|
63
|
+
|
|
64
|
+
foreach (GenericBreakingChangeAttribute attribute in attributes)
|
|
65
|
+
{
|
|
66
|
+
attribute.PrintCustomAttributeInfo(appendBreakingChangeInfo);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK));
|
|
70
|
+
|
|
71
|
+
psCmdlet.WriteWarning(sb.ToString());
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
List<PreviewMessageAttribute> previewAttributes = new List<PreviewMessageAttribute>(GetAllPreviewAttributesInType(commandInfo, invocationInfo));
|
|
75
|
+
|
|
76
|
+
if (previewAttributes != null && previewAttributes.Count > 0)
|
|
77
|
+
{
|
|
78
|
+
foreach (PreviewMessageAttribute attribute in previewAttributes)
|
|
79
|
+
{
|
|
80
|
+
attribute.PrintCustomAttributeInfo(psCmdlet);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* This function takes in a CommandInfo (CmdletInfo or FunctionInfo)
|
|
88
|
+
* And returns all the deprecation attributes attached to it
|
|
89
|
+
*
|
|
90
|
+
* the boundParameterNames is a list of parameters bound to the cmdlet at runtime,
|
|
91
|
+
* We only process the Parameter beaking change attributes attached only params listed in this list (if present)
|
|
92
|
+
**/
|
|
93
|
+
private static IEnumerable<GenericBreakingChangeAttribute> GetAllBreakingChangeAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet)
|
|
94
|
+
{
|
|
95
|
+
List<GenericBreakingChangeAttribute> attributeList = new List<GenericBreakingChangeAttribute>();
|
|
96
|
+
|
|
97
|
+
if (commandInfo.GetType() == typeof(CmdletInfo))
|
|
98
|
+
{
|
|
99
|
+
var type = ((CmdletInfo)commandInfo).ImplementingType;
|
|
100
|
+
attributeList.AddRange(type.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast<GenericBreakingChangeAttribute>());
|
|
101
|
+
|
|
102
|
+
foreach (MethodInfo m in type.GetRuntimeMethods())
|
|
103
|
+
{
|
|
104
|
+
attributeList.AddRange((m.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast<GenericBreakingChangeAttribute>()));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
foreach (FieldInfo f in type.GetRuntimeFields())
|
|
108
|
+
{
|
|
109
|
+
attributeList.AddRange(f.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast<GenericBreakingChangeAttribute>());
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
foreach (PropertyInfo p in type.GetRuntimeProperties())
|
|
113
|
+
{
|
|
114
|
+
attributeList.AddRange(p.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast<GenericBreakingChangeAttribute>());
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else if (commandInfo.GetType() == typeof(FunctionInfo))
|
|
118
|
+
{
|
|
119
|
+
attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast<GenericBreakingChangeAttribute>());
|
|
120
|
+
foreach (var parameter in ((FunctionInfo)commandInfo).Parameters)
|
|
121
|
+
{
|
|
122
|
+
attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast<GenericBreakingChangeAttribute>());
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo));
|
|
126
|
+
}
|
|
127
|
+
private static IEnumerable<PreviewMessageAttribute> GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo)
|
|
128
|
+
{
|
|
129
|
+
List<PreviewMessageAttribute> attributeList = new List<PreviewMessageAttribute>();
|
|
130
|
+
if (commandInfo.GetType() == typeof(CmdletInfo))
|
|
131
|
+
{
|
|
132
|
+
var type = ((CmdletInfo)commandInfo).ImplementingType;
|
|
133
|
+
attributeList.AddRange(type.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast<PreviewMessageAttribute>());
|
|
134
|
+
|
|
135
|
+
foreach (MethodInfo m in type.GetRuntimeMethods())
|
|
136
|
+
{
|
|
137
|
+
attributeList.AddRange((m.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast<PreviewMessageAttribute>()));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
foreach (FieldInfo f in type.GetRuntimeFields())
|
|
141
|
+
{
|
|
142
|
+
attributeList.AddRange(f.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast<PreviewMessageAttribute>());
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
foreach (PropertyInfo p in type.GetRuntimeProperties())
|
|
146
|
+
{
|
|
147
|
+
attributeList.AddRange(p.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast<PreviewMessageAttribute>());
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else if (commandInfo.GetType() == typeof(FunctionInfo))
|
|
151
|
+
{
|
|
152
|
+
attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast<PreviewMessageAttribute>());
|
|
153
|
+
foreach (var parameter in ((FunctionInfo)commandInfo).Parameters)
|
|
154
|
+
{
|
|
155
|
+
attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast<PreviewMessageAttribute>());
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return invocationInfo == null ? attributeList : attributeList.Where(e => e.IsApplicableToInvocation(invocationInfo));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|