@autorest/powershell 4.0.0-dev.9 → 4.0.617
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/operation/build/state.json +3 -0
- package/.rush/temp/package-deps_build.json +98 -98
- package/.rush/temp/shrinkwrap-deps.json +182 -234
- package/dist/cmdlets/class.d.ts +9 -2
- package/dist/cmdlets/class.d.ts.map +1 -1
- package/dist/cmdlets/class.js +663 -581
- package/dist/cmdlets/class.js.map +1 -1
- package/dist/cmdlets/namespace.d.ts.map +1 -1
- package/dist/cmdlets/namespace.js +38 -5
- package/dist/cmdlets/namespace.js.map +1 -1
- package/dist/enums/namespace.js +5 -5
- package/dist/enums/namespace.js.map +1 -1
- package/dist/generators/psm1.custom.js +2 -2
- package/dist/generators/psm1.custom.js.map +1 -1
- package/dist/generators/psm1.internal.js +2 -2
- package/dist/generators/psm1.internal.js.map +1 -1
- package/dist/generators/psm1.js +1 -1
- package/dist/generators/psm1.js.map +1 -1
- package/dist/generators/script-cmdlet.js +18 -18
- package/dist/generators/script-cmdlet.js.map +1 -1
- package/dist/internal/name-inferrer.d.ts +1 -1
- package/dist/internal/name-inferrer.d.ts.map +1 -1
- package/dist/internal/name-inferrer.js +12 -12
- package/dist/internal/name-inferrer.js.map +1 -1
- package/dist/internal/powershell-declarations.d.ts +1 -0
- package/dist/internal/powershell-declarations.d.ts.map +1 -1
- package/dist/internal/powershell-declarations.js +3 -2
- package/dist/internal/powershell-declarations.js.map +1 -1
- package/dist/internal/project.d.ts +3 -3
- package/dist/internal/project.d.ts.map +1 -1
- package/dist/internal/project.js +11 -11
- package/dist/internal/project.js.map +1 -1
- package/dist/internal/state.d.ts +1 -1
- package/dist/internal/state.d.ts.map +1 -1
- package/dist/llcsharp/clientruntime.d.ts +1 -0
- package/dist/llcsharp/clientruntime.d.ts.map +1 -1
- package/dist/llcsharp/clientruntime.js +12 -11
- package/dist/llcsharp/clientruntime.js.map +1 -1
- package/dist/llcsharp/code-model.d.ts +7 -7
- package/dist/llcsharp/code-model.d.ts.map +1 -1
- package/dist/llcsharp/enums/enum.d.ts +1 -1
- package/dist/llcsharp/enums/enum.d.ts.map +1 -1
- package/dist/llcsharp/enums/enum.js +42 -42
- package/dist/llcsharp/enums/enum.js.map +1 -1
- package/dist/llcsharp/exports.js +5 -1
- package/dist/llcsharp/exports.js.map +1 -1
- package/dist/llcsharp/generator.d.ts +1 -1
- package/dist/llcsharp/generator.d.ts.map +1 -1
- package/dist/llcsharp/model/idictionary.js +16 -16
- package/dist/llcsharp/model/idictionary.js.map +1 -1
- package/dist/llcsharp/model/interface.d.ts +1 -1
- package/dist/llcsharp/model/interface.d.ts.map +1 -1
- package/dist/llcsharp/model/interface.js +19 -19
- package/dist/llcsharp/model/interface.js.map +1 -1
- package/dist/llcsharp/model/model-class-dictionary.js +18 -18
- package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
- package/dist/llcsharp/model/model-class-json.js +19 -19
- package/dist/llcsharp/model/model-class-json.js.map +1 -1
- package/dist/llcsharp/model/model-class-serializer.d.ts +1 -1
- package/dist/llcsharp/model/model-class-serializer.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class-serializer.js +6 -6
- package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
- package/dist/llcsharp/model/model-class.d.ts +1 -1
- package/dist/llcsharp/model/model-class.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class.js +97 -89
- package/dist/llcsharp/model/model-class.js.map +1 -1
- package/dist/llcsharp/model/namespace.d.ts +1 -1
- package/dist/llcsharp/model/namespace.d.ts.map +1 -1
- package/dist/llcsharp/model/namespace.js +2 -2
- package/dist/llcsharp/model/namespace.js.map +1 -1
- package/dist/llcsharp/model/property.d.ts +1 -1
- package/dist/llcsharp/model/property.d.ts.map +1 -1
- package/dist/llcsharp/model/property.js +20 -20
- 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 +26 -1
- package/dist/llcsharp/operation/api-class.js.map +1 -1
- package/dist/llcsharp/operation/method.d.ts +10 -5
- package/dist/llcsharp/operation/method.d.ts.map +1 -1
- package/dist/llcsharp/operation/method.js +276 -134
- package/dist/llcsharp/operation/method.js.map +1 -1
- package/dist/llcsharp/operation/parameter.d.ts +1 -1
- package/dist/llcsharp/operation/parameter.d.ts.map +1 -1
- package/dist/llcsharp/operation/parameter.js +10 -10
- package/dist/llcsharp/operation/parameter.js.map +1 -1
- package/dist/llcsharp/project.d.ts +2 -1
- package/dist/llcsharp/project.d.ts.map +1 -1
- package/dist/llcsharp/project.js +6 -0
- package/dist/llcsharp/project.js.map +1 -1
- package/dist/llcsharp/schema/Uuid.d.ts +1 -1
- package/dist/llcsharp/schema/Uuid.d.ts.map +1 -1
- package/dist/llcsharp/schema/Uuid.js +2 -2
- package/dist/llcsharp/schema/Uuid.js.map +1 -1
- package/dist/llcsharp/schema/array.d.ts +1 -1
- package/dist/llcsharp/schema/array.d.ts.map +1 -1
- package/dist/llcsharp/schema/array.js +45 -43
- package/dist/llcsharp/schema/array.js.map +1 -1
- package/dist/llcsharp/schema/binary.d.ts +1 -1
- package/dist/llcsharp/schema/binary.d.ts.map +1 -1
- package/dist/llcsharp/schema/binary.js +9 -9
- package/dist/llcsharp/schema/binary.js.map +1 -1
- package/dist/llcsharp/schema/boolean.d.ts +1 -1
- package/dist/llcsharp/schema/boolean.d.ts.map +1 -1
- package/dist/llcsharp/schema/byte-array.d.ts +1 -1
- package/dist/llcsharp/schema/byte-array.d.ts.map +1 -1
- package/dist/llcsharp/schema/byte-array.js +24 -24
- package/dist/llcsharp/schema/byte-array.js.map +1 -1
- package/dist/llcsharp/schema/char.d.ts +1 -1
- package/dist/llcsharp/schema/char.d.ts.map +1 -1
- package/dist/llcsharp/schema/char.js +1 -1
- package/dist/llcsharp/schema/char.js.map +1 -1
- package/dist/llcsharp/schema/date-time.d.ts +1 -1
- package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
- package/dist/llcsharp/schema/date-time.js +45 -41
- package/dist/llcsharp/schema/date-time.js.map +1 -1
- package/dist/llcsharp/schema/date.d.ts +1 -1
- package/dist/llcsharp/schema/date.d.ts.map +1 -1
- package/dist/llcsharp/schema/duration.d.ts +1 -1
- package/dist/llcsharp/schema/duration.d.ts.map +1 -1
- package/dist/llcsharp/schema/duration.js +9 -7
- package/dist/llcsharp/schema/duration.js.map +1 -1
- package/dist/llcsharp/schema/enum.d.ts +6 -2
- package/dist/llcsharp/schema/enum.d.ts.map +1 -1
- package/dist/llcsharp/schema/enum.js +13 -4
- package/dist/llcsharp/schema/enum.js.map +1 -1
- package/dist/llcsharp/schema/extended-type-declaration.d.ts +1 -1
- package/dist/llcsharp/schema/extended-type-declaration.d.ts.map +1 -1
- package/dist/llcsharp/schema/fixed-array.d.ts +1 -1
- package/dist/llcsharp/schema/fixed-array.d.ts.map +1 -1
- package/dist/llcsharp/schema/fixed-array.js +44 -42
- package/dist/llcsharp/schema/fixed-array.js.map +1 -1
- package/dist/llcsharp/schema/integer.d.ts +1 -1
- package/dist/llcsharp/schema/integer.d.ts.map +1 -1
- package/dist/llcsharp/schema/integer.js +5 -5
- package/dist/llcsharp/schema/integer.js.map +1 -1
- package/dist/llcsharp/schema/object.d.ts +1 -1
- package/dist/llcsharp/schema/object.d.ts.map +1 -1
- package/dist/llcsharp/schema/object.js +28 -28
- package/dist/llcsharp/schema/object.js.map +1 -1
- package/dist/llcsharp/schema/password.d.ts +1 -1
- package/dist/llcsharp/schema/password.d.ts.map +1 -1
- package/dist/llcsharp/schema/password.js +13 -13
- package/dist/llcsharp/schema/password.js.map +1 -1
- package/dist/llcsharp/schema/primitive.d.ts +1 -1
- package/dist/llcsharp/schema/primitive.d.ts.map +1 -1
- package/dist/llcsharp/schema/primitive.js +40 -37
- package/dist/llcsharp/schema/primitive.js.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.d.ts +1 -1
- package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.js +1 -1
- package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
- package/dist/llcsharp/schema/string.d.ts +1 -1
- package/dist/llcsharp/schema/string.d.ts.map +1 -1
- package/dist/llcsharp/schema/string.js +48 -44
- package/dist/llcsharp/schema/string.js.map +1 -1
- package/dist/llcsharp/schema/uri.d.ts +1 -1
- package/dist/llcsharp/schema/uri.d.ts.map +1 -1
- package/dist/llcsharp/schema/uri.js +2 -2
- package/dist/llcsharp/schema/uri.js.map +1 -1
- package/dist/llcsharp/validations.js +2 -2
- package/dist/llcsharp/validations.js.map +1 -1
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/models/model-extensions.d.ts +1 -1
- package/dist/models/model-extensions.d.ts.map +1 -1
- package/dist/models/model-extensions.js +39 -39
- package/dist/models/model-extensions.js.map +1 -1
- package/dist/module/module-class.js +8 -8
- package/dist/module/module-class.js.map +1 -1
- package/dist/module/module-namespace.js +3 -3
- package/dist/module/module-namespace.js.map +1 -1
- package/dist/plugins/add-azure-completers-v2.d.ts +1 -1
- package/dist/plugins/add-azure-completers-v2.d.ts.map +1 -1
- package/dist/plugins/add-azure-completers-v2.js +3 -3
- package/dist/plugins/add-azure-completers-v2.js.map +1 -1
- package/dist/plugins/create-commands-v2.d.ts +8 -7
- package/dist/plugins/create-commands-v2.d.ts.map +1 -1
- package/dist/plugins/create-commands-v2.js +199 -61
- package/dist/plugins/create-commands-v2.js.map +1 -1
- package/dist/plugins/cs-namer-v2.d.ts +1 -1
- package/dist/plugins/cs-namer-v2.d.ts.map +1 -1
- package/dist/plugins/cs-namer-v2.js +40 -40
- package/dist/plugins/cs-namer-v2.js.map +1 -1
- package/dist/plugins/llcsharp-v2.d.ts +1 -1
- package/dist/plugins/llcsharp-v2.d.ts.map +1 -1
- package/dist/plugins/llcsharp-v2.js +9 -7
- package/dist/plugins/llcsharp-v2.js.map +1 -1
- package/dist/plugins/modifiers-v2.d.ts +1 -1
- package/dist/plugins/modifiers-v2.d.ts.map +1 -1
- package/dist/plugins/modifiers-v2.js +94 -82
- package/dist/plugins/modifiers-v2.js.map +1 -1
- package/dist/plugins/plugin-create-inline-properties.d.ts +1 -1
- package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -1
- package/dist/plugins/plugin-create-inline-properties.js +42 -31
- package/dist/plugins/plugin-create-inline-properties.js.map +1 -1
- package/dist/plugins/plugin-tweak-m4-model.d.ts +1 -1
- package/dist/plugins/plugin-tweak-m4-model.d.ts.map +1 -1
- package/dist/plugins/plugin-tweak-m4-model.js +8 -8
- package/dist/plugins/plugin-tweak-m4-model.js.map +1 -1
- package/dist/plugins/plugin-tweak-model-azure-v2.d.ts +1 -1
- package/dist/plugins/plugin-tweak-model-azure-v2.d.ts.map +1 -1
- package/dist/plugins/plugin-tweak-model-azure-v2.js +17 -17
- package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -1
- package/dist/plugins/plugin-tweak-model.d.ts +1 -1
- package/dist/plugins/plugin-tweak-model.d.ts.map +1 -1
- package/dist/plugins/plugin-tweak-model.js +31 -31
- package/dist/plugins/plugin-tweak-model.js.map +1 -1
- package/dist/plugins/powershell-v2.d.ts +1 -1
- package/dist/plugins/powershell-v2.d.ts.map +1 -1
- package/dist/plugins/powershell-v2.js +26 -26
- package/dist/plugins/powershell-v2.js.map +1 -1
- package/dist/plugins/ps-namer-v2.d.ts +1 -1
- package/dist/plugins/ps-namer-v2.d.ts.map +1 -1
- package/dist/plugins/ps-namer-v2.js +31 -31
- package/dist/plugins/ps-namer-v2.js.map +1 -1
- package/dist/plugins/sdk-create-inline-properties.d.ts +1 -1
- package/dist/plugins/sdk-create-inline-properties.d.ts.map +1 -1
- package/dist/plugins/sdk-create-inline-properties.js +37 -37
- package/dist/plugins/sdk-create-inline-properties.js.map +1 -1
- package/dist/plugins/sdk-cs-namer.d.ts +1 -1
- package/dist/plugins/sdk-cs-namer.d.ts.map +1 -1
- package/dist/plugins/sdk-cs-namer.js +21 -21
- package/dist/plugins/sdk-cs-namer.js.map +1 -1
- package/dist/plugins/sdk-cs-simplifier.d.ts +1 -1
- package/dist/plugins/sdk-cs-simplifier.d.ts.map +1 -1
- package/dist/plugins/sdk-cs-simplifier.js +3 -3
- package/dist/plugins/sdk-cs-simplifier.js.map +1 -1
- package/dist/plugins/sdk-generate.d.ts +1 -1
- package/dist/plugins/sdk-generate.d.ts.map +1 -1
- package/dist/plugins/sdk-generate.js +14 -14
- package/dist/plugins/sdk-generate.js.map +1 -1
- package/dist/plugins/sdk-tweak-model.d.ts +1 -1
- package/dist/plugins/sdk-tweak-model.d.ts.map +1 -1
- package/dist/plugins/sdk-tweak-model.js +23 -23
- package/dist/plugins/sdk-tweak-model.js.map +1 -1
- package/dist/sdk/project.d.ts +2 -2
- package/dist/sdk/project.d.ts.map +1 -1
- package/dist/sdk/project.js +8 -8
- package/dist/sdk/project.js.map +1 -1
- package/dist/sdk/state.d.ts +2 -2
- package/dist/sdk/state.d.ts.map +1 -1
- package/dist/sdk/utility.d.ts +1 -1
- package/dist/sdk/utility.d.ts.map +1 -1
- package/dist/sdk/utility.js +17 -16
- package/dist/sdk/utility.js.map +1 -1
- package/dist/utils/PwshModel.d.ts +1 -1
- package/dist/utils/PwshModel.d.ts.map +1 -1
- package/dist/utils/PwshModel.js +1 -1
- package/dist/utils/PwshModel.js.map +1 -1
- package/dist/utils/SdkModel.d.ts +1 -1
- package/dist/utils/SdkModel.d.ts.map +1 -1
- package/dist/utils/SdkModel.js +1 -1
- package/dist/utils/SdkModel.js.map +1 -1
- package/dist/utils/command-operation.d.ts +9 -3
- package/dist/utils/command-operation.d.ts.map +1 -1
- package/dist/utils/command-operation.js +24 -4
- package/dist/utils/command-operation.js.map +1 -1
- package/dist/utils/components.d.ts +1 -1
- package/dist/utils/components.d.ts.map +1 -1
- package/dist/utils/components.js +2 -2
- package/dist/utils/components.js.map +1 -1
- package/dist/utils/http-operation.d.ts +2 -0
- package/dist/utils/http-operation.d.ts.map +1 -1
- package/dist/utils/http-operation.js +16 -12
- package/dist/utils/http-operation.js.map +1 -1
- package/dist/utils/model-state.d.ts +1 -1
- package/dist/utils/model-state.d.ts.map +1 -1
- package/dist/utils/model-state.js +20 -20
- package/dist/utils/model-state.js.map +1 -1
- package/dist/utils/programatic-operation.d.ts +1 -1
- package/dist/utils/programatic-operation.d.ts.map +1 -1
- package/dist/utils/programatic-operation.js +1 -1
- package/dist/utils/programatic-operation.js.map +1 -1
- package/dist/utils/resolve-conflicts.js +8 -8
- package/dist/utils/resolve-conflicts.js.map +1 -1
- package/dist/utils/schema.d.ts +1 -1
- package/dist/utils/schema.d.ts.map +1 -1
- package/dist/utils/schema.js +11 -11
- package/dist/utils/schema.js.map +1 -1
- package/dist/utils/security-scheme.d.ts +2 -2
- package/dist/utils/security-scheme.d.ts.map +1 -1
- package/dist/utils/security-scheme.js +2 -2
- package/dist/utils/security-scheme.js.map +1 -1
- package/dist/utils/sort-parameters.d.ts +1 -1
- package/dist/utils/sort-parameters.d.ts.map +1 -1
- package/package.json +7 -7
- package/resources/assets/build-module.ps1 +6 -1
- package/resources/assets/generate-help.ps1 +2 -2
- package/resources/assets/test-module.ps1 +3 -3
- package/resources/assets/tools/Resources/custom/New-AzDeployment.ps1 +2 -2
- package/resources/psruntime/BuildTime/Cmdlets/ExportHelpMarkdown.cs +4 -1
- package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +4 -1
- package/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +6 -4
- package/resources/psruntime/BuildTime/MarkdownRenderer.cs +16 -8
- package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +2 -2
- package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +13 -0
- package/resources/psruntime/BuildTime/PsAttributes.cs +5 -0
- package/resources/psruntime/BuildTime/PsHelpers.cs +4 -3
- package/resources/psruntime/MessageAttribute.cs +23 -52
- package/resources/psruntime/MessageAttributeHelper.cs +5 -1
- package/resources/psruntime/Properties/Resources.Designer.cs +15 -2
- package/resources/psruntime/Properties/Resources.resx +4 -1
- package/resources/runtime/csharp/pipeline/PipelineMocking.cs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-scheme.js","sourceRoot":"","sources":["../../utils/security-scheme.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,6CAA0C;AAE1C,4CAA+C;AAG/C,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,2BAAiB,CAAA;AACnB,CAAC,EAFW,MAAM,
|
|
1
|
+
{"version":3,"file":"security-scheme.js","sourceRoot":"","sources":["../../utils/security-scheme.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Parameter } from '@
|
|
1
|
+
import { Parameter } from '@autorest/codemodel';
|
|
2
2
|
export declare function sortPathParameters(path: string | undefined, params: Array<Parameter> | undefined): Array<Parameter> | undefined;
|
|
3
3
|
//# sourceMappingURL=sort-parameters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort-parameters.d.ts","sourceRoot":"","sources":["../../utils/sort-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sort-parameters.d.ts","sourceRoot":"","sources":["../../utils/sort-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,SAAS,CAoB/H"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autorest/powershell",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.617",
|
|
4
4
|
"description": "AutoRest PowerShell Cmdlet Generator",
|
|
5
5
|
"main": "dist/exports.js",
|
|
6
6
|
"typings": "dist/exports.d.ts",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"@types/js-yaml": "3.12.1",
|
|
31
31
|
"@types/mocha": "5.2.5",
|
|
32
32
|
"@types/node": "12.7.2",
|
|
33
|
-
"mocha": "
|
|
34
|
-
"mocha
|
|
35
|
-
"typescript": "~
|
|
33
|
+
"mocha": "10.2.0",
|
|
34
|
+
"@testdeck/mocha": "0.3.3",
|
|
35
|
+
"typescript": "~5.1.3",
|
|
36
36
|
"@types/xmlbuilder": "0.0.34",
|
|
37
37
|
"@typescript-eslint/eslint-plugin": "~5.29.0",
|
|
38
38
|
"@typescript-eslint/parser": "~5.29.0",
|
|
39
39
|
"@microsoft.azure/autorest.testserver": "~2.9.3",
|
|
40
|
-
"autorest": "~3.
|
|
40
|
+
"autorest": "~3.6.3",
|
|
41
41
|
"eslint": "~8.12.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"@azure-tools/codegen": "~2.5.276",
|
|
46
46
|
"@azure-tools/codegen-csharp": "~3.0.0",
|
|
47
47
|
"@azure-tools/codemodel-v3": "~3.1.0",
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
48
|
+
"@autorest/extension-base": "~3.5.2",
|
|
49
|
+
"@autorest/codemodel": "~4.19.3",
|
|
50
50
|
"@azure-tools/linq": "~3.1.0",
|
|
51
51
|
"@azure-tools/tasks": "~3.0.0",
|
|
52
52
|
"@azure-tools/async-io": "~3.0.0",
|
|
@@ -120,6 +120,10 @@ $null = New-Item -ItemType Directory -Force -Path $examplesFolder
|
|
|
120
120
|
|
|
121
121
|
Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
|
|
122
122
|
$modelCmdlets = @(${$project.modelCmdletsInPS})
|
|
123
|
+
$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot '${$project.customFolder}') 'autogen-model-cmdlets'
|
|
124
|
+
if (Test-Path $modelCmdletFolder) {
|
|
125
|
+
$null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
|
|
126
|
+
}
|
|
123
127
|
if ($modelCmdlets.Count -gt 0) {
|
|
124
128
|
. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
|
|
125
129
|
CreateModelCmdlet($modelCmdlets)
|
|
@@ -136,7 +140,8 @@ if($NoDocs) {
|
|
|
136
140
|
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
|
|
137
141
|
}
|
|
138
142
|
$null = New-Item -ItemType Directory -Force -Path $docsFolder
|
|
139
|
-
|
|
143
|
+
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('${$project.azure}')
|
|
144
|
+
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
|
|
140
145
|
}
|
|
141
146
|
|
|
142
147
|
Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
|
|
@@ -55,8 +55,8 @@ foreach($directory in $directories)
|
|
|
55
55
|
$docsPath = Join-Path $docsFolder $directory.Name
|
|
56
56
|
$null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue
|
|
57
57
|
$examplesPath = Join-Path $examplesFolder $directory.Name
|
|
58
|
-
|
|
59
|
-
Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath
|
|
58
|
+
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('${$project.azure}')
|
|
59
|
+
Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath -AddComplexInterfaceInfo:$addComplexInterfaceInfo
|
|
60
60
|
Write-Host -ForegroundColor Green "Created documentation in '$docsPath'"
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -67,10 +67,10 @@ try
|
|
|
67
67
|
$testFolder = Join-Path $PSScriptRoot '${$lib.path.relative($project.baseFolder, $project.testFolder)}'
|
|
68
68
|
if ($null -ne $TestName)
|
|
69
69
|
{
|
|
70
|
-
Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit
|
|
70
|
+
Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml")
|
|
71
71
|
} else
|
|
72
72
|
{
|
|
73
|
-
Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit
|
|
73
|
+
Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml")
|
|
74
74
|
}
|
|
75
75
|
} Finally
|
|
76
76
|
{
|
|
@@ -80,4 +80,4 @@ try
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
Write-Host -ForegroundColor Green '-------------Done-------------'
|
|
83
|
+
Write-Host -ForegroundColor Green '-------------Done-------------'
|
|
@@ -116,12 +116,12 @@ function New-AzDeployment {
|
|
|
116
116
|
# The location to store the deployment data.
|
|
117
117
|
${Location},
|
|
118
118
|
|
|
119
|
-
[Parameter(HelpMessage='The
|
|
119
|
+
[Parameter(HelpMessage='The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.')]
|
|
120
120
|
[Alias('AzureRMContext', 'AzureCredential')]
|
|
121
121
|
[ValidateNotNull()]
|
|
122
122
|
[Microsoft.Azure.PowerShell.Cmdlets.Resources.Category('Azure')]
|
|
123
123
|
[System.Management.Automation.PSObject]
|
|
124
|
-
# The
|
|
124
|
+
# The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
|
|
125
125
|
${DefaultProfile},
|
|
126
126
|
|
|
127
127
|
[Parameter(HelpMessage='Run the command as a job')]
|
|
@@ -33,6 +33,9 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
33
33
|
[ValidateNotNullOrEmpty]
|
|
34
34
|
public string ExamplesFolder { get; set; }
|
|
35
35
|
|
|
36
|
+
[Parameter()]
|
|
37
|
+
public SwitchParameter AddComplexInterfaceInfo { get; set; }
|
|
38
|
+
|
|
36
39
|
protected override void ProcessRecord()
|
|
37
40
|
{
|
|
38
41
|
try
|
|
@@ -41,7 +44,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
41
44
|
var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast<FunctionInfo>()
|
|
42
45
|
.Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi))
|
|
43
46
|
.Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty));
|
|
44
|
-
WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder);
|
|
47
|
+
WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder, AddComplexInterfaceInfo.IsPresent);
|
|
45
48
|
}
|
|
46
49
|
catch (Exception ee)
|
|
47
50
|
{
|
|
@@ -52,6 +52,9 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
52
52
|
[Parameter(Mandatory = true, ParameterSetName = "NoDocs")]
|
|
53
53
|
public SwitchParameter ExcludeDocs { get; set; }
|
|
54
54
|
|
|
55
|
+
[Parameter(ParameterSetName = "Docs")]
|
|
56
|
+
public SwitchParameter AddComplexInterfaceInfo { get; set; }
|
|
57
|
+
|
|
55
58
|
protected override void ProcessRecord()
|
|
56
59
|
{
|
|
57
60
|
try
|
|
@@ -152,7 +155,7 @@ ${$project.pwshCommentHeaderForCsharp}
|
|
|
152
155
|
var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles;
|
|
153
156
|
var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder;
|
|
154
157
|
var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder;
|
|
155
|
-
WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder);
|
|
158
|
+
WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder, AddComplexInterfaceInfo.IsPresent);
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
}
|
|
@@ -137,7 +137,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
137
137
|
}
|
|
138
138
|
else
|
|
139
139
|
{
|
|
140
|
-
var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().
|
|
140
|
+
var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().ToPsList();
|
|
141
141
|
sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}");
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -148,8 +148,10 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
148
148
|
}
|
|
149
149
|
else
|
|
150
150
|
{
|
|
151
|
-
var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().
|
|
152
|
-
|
|
151
|
+
var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().ToPsList();
|
|
152
|
+
if (!String.IsNullOrEmpty(aliasesList)) {
|
|
153
|
+
sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}");
|
|
154
|
+
}
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
// CmdletsToExport
|
|
@@ -163,7 +165,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
163
165
|
|
|
164
166
|
if (previewVersion != null)
|
|
165
167
|
{
|
|
166
|
-
sb.AppendLine($@"{Indent}{Indent}{Indent}Prerelease = {previewVersion}");
|
|
168
|
+
sb.AppendLine($@"{Indent}{Indent}{Indent}Prerelease = '{previewVersion}'");
|
|
167
169
|
}
|
|
168
170
|
sb.AppendLine($@"{Indent}{Indent}{Indent}Tags = {"${$project.metadata.tags}".Split(' ').ToPsList().NullIfEmpty() ?? "''"}");
|
|
169
171
|
sb.AppendLine($@"{Indent}{Indent}{Indent}LicenseUri = '{"${$project.metadata.licenseUri}"}'");
|
|
@@ -14,7 +14,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
14
14
|
{
|
|
15
15
|
internal static class MarkdownRenderer
|
|
16
16
|
{
|
|
17
|
-
public static void WriteMarkdowns(IEnumerable<VariantGroup> variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder)
|
|
17
|
+
public static void WriteMarkdowns(IEnumerable<VariantGroup> variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder, bool AddComplexInterfaceInfo = true)
|
|
18
18
|
{
|
|
19
19
|
Directory.CreateDirectory(docsFolder);
|
|
20
20
|
var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray();
|
|
@@ -69,18 +69,26 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}");
|
|
72
|
-
|
|
73
|
-
foreach (var alias in markdownInfo.Aliases)
|
|
72
|
+
if (markdownInfo.Aliases.Any())
|
|
74
73
|
{
|
|
75
|
-
sb.Append($"{
|
|
74
|
+
sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}");
|
|
76
75
|
}
|
|
77
|
-
|
|
76
|
+
foreach (var alias in markdownInfo.Aliases)
|
|
78
77
|
{
|
|
79
|
-
sb.Append($"{
|
|
78
|
+
sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}");
|
|
80
79
|
}
|
|
81
|
-
|
|
80
|
+
|
|
81
|
+
if (AddComplexInterfaceInfo)
|
|
82
82
|
{
|
|
83
|
-
|
|
83
|
+
if (markdownInfo.ComplexInterfaceInfos.Any())
|
|
84
|
+
{
|
|
85
|
+
sb.Append($"{ComplexParameterHeader}{Environment.NewLine}");
|
|
86
|
+
}
|
|
87
|
+
foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos)
|
|
88
|
+
{
|
|
89
|
+
sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}");
|
|
90
|
+
}
|
|
91
|
+
|
|
84
92
|
}
|
|
85
93
|
|
|
86
94
|
sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}");
|
|
@@ -214,7 +214,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
214
214
|
{
|
|
215
215
|
return $@"
|
|
216
216
|
{Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{
|
|
217
|
-
{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $
|
|
217
|
+
{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
|
|
218
218
|
{Indent}{Indent}}}
|
|
219
219
|
{Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
|
|
220
220
|
{Indent}{Indent}if ($preTelemetryId -eq '') {{
|
|
@@ -627,7 +627,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
627
627
|
return ni.IsComplexInterface
|
|
628
628
|
? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false)
|
|
629
629
|
: RenderProperty(ni, nestedIndent, includeDashes, includeBackticks);
|
|
630
|
-
}).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes,
|
|
630
|
+
}).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, includeBackticks));
|
|
631
631
|
return String.Join(Environment.NewLine, nested);
|
|
632
632
|
}
|
|
633
633
|
}
|
|
@@ -101,12 +101,23 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
101
101
|
if (String.IsNullOrEmpty(defaultParameterSet))
|
|
102
102
|
{
|
|
103
103
|
var variantParamCountGroups = Variants
|
|
104
|
+
.Where(v => !v.IsNotSuggestDefaultParameterSet)
|
|
104
105
|
.Select(v => (
|
|
105
106
|
variant: v.VariantName,
|
|
106
107
|
paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory),
|
|
107
108
|
isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple())))
|
|
108
109
|
.GroupBy(vpc => vpc.isSimple)
|
|
109
110
|
.ToArray();
|
|
111
|
+
if (variantParamCountGroups.Length == 0)
|
|
112
|
+
{
|
|
113
|
+
variantParamCountGroups = Variants
|
|
114
|
+
.Select(v => (
|
|
115
|
+
variant: v.VariantName,
|
|
116
|
+
paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory),
|
|
117
|
+
isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple())))
|
|
118
|
+
.GroupBy(vpc => vpc.isSimple)
|
|
119
|
+
.ToArray();
|
|
120
|
+
}
|
|
110
121
|
var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray();
|
|
111
122
|
var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount);
|
|
112
123
|
defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant;
|
|
@@ -135,6 +146,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
135
146
|
public Parameter[] CmdletOnlyParameters { get; }
|
|
136
147
|
public bool IsInternal { get; }
|
|
137
148
|
public bool IsDoNotExport { get; }
|
|
149
|
+
public bool IsNotSuggestDefaultParameterSet { get; }
|
|
138
150
|
public string[] Profiles { get; }
|
|
139
151
|
|
|
140
152
|
public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null)
|
|
@@ -155,6 +167,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
155
167
|
Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray();
|
|
156
168
|
IsInternal = Attributes.OfType<InternalExportAttribute>().Any();
|
|
157
169
|
IsDoNotExport = Attributes.OfType<DoNotExportAttribute>().Any();
|
|
170
|
+
IsNotSuggestDefaultParameterSet = Attributes.OfType<NotSuggestDefaultParameterSetAttribute>().Any();
|
|
158
171
|
CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray();
|
|
159
172
|
Profiles = Attributes.OfType<ProfileAttribute>().SelectMany(pa => pa.Profiles).ToArray();
|
|
160
173
|
}
|
|
@@ -55,6 +55,11 @@ namespace Microsoft.Rest
|
|
|
55
55
|
public string ApiVersion { get; set; }
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
[AttributeUsage(AttributeTargets.Class)]
|
|
59
|
+
public class NotSuggestDefaultParameterSetAttribute : Attribute
|
|
60
|
+
{
|
|
61
|
+
}
|
|
62
|
+
|
|
58
63
|
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
|
|
59
64
|
public class CategoryAttribute : Attribute
|
|
60
65
|
{
|
|
@@ -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);
|
|
@@ -66,7 +67,7 @@ Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -a
|
|
|
66
67
|
|
|
67
68
|
public static IEnumerable<CmdletAndHelpInfo> GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths)
|
|
68
69
|
{
|
|
69
|
-
var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp =>
|
|
70
|
+
var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp =>
|
|
70
71
|
$@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})"
|
|
71
72
|
));
|
|
72
73
|
return (cmdlet?.RunScript<Hashtable>(getCmdletAndHelp) ?? RunScript<Hashtable>(getCmdletAndHelp))
|
|
@@ -87,7 +88,7 @@ Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -a
|
|
|
87
88
|
if (File.Exists(psd1Path))
|
|
88
89
|
{
|
|
89
90
|
var currentGuid = File.ReadAllLines(psd1Path)
|
|
90
|
-
.FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries)
|
|
91
|
+
.FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries)
|
|
91
92
|
.LastOrDefault()?.Replace("'", String.Empty);
|
|
92
93
|
guid = currentGuid != null ? Guid.Parse(currentGuid) : guid;
|
|
93
94
|
}
|
|
@@ -21,7 +21,7 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
21
21
|
|
|
22
22
|
//The version the change is effective from, non mandatory
|
|
23
23
|
public string DeprecateByVersion { get; }
|
|
24
|
-
public
|
|
24
|
+
public string DeprecateByAzVersion { get; }
|
|
25
25
|
|
|
26
26
|
//The date on which the change comes in effect
|
|
27
27
|
public DateTime ChangeInEfectByDate { get; }
|
|
@@ -32,23 +32,18 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
32
32
|
//New way fo calling the cmdlet
|
|
33
33
|
public string NewWay { get; set; }
|
|
34
34
|
|
|
35
|
-
public GenericBreakingChangeAttribute(string message)
|
|
36
|
-
{
|
|
37
|
-
_message = message;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public GenericBreakingChangeAttribute(string message, string deprecateByVersion)
|
|
35
|
+
public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion)
|
|
41
36
|
{
|
|
42
37
|
_message = message;
|
|
38
|
+
this.DeprecateByAzVersion = deprecateByAzVersion;
|
|
43
39
|
this.DeprecateByVersion = deprecateByVersion;
|
|
44
|
-
this.DeprecateByVersionSet = true;
|
|
45
40
|
}
|
|
46
41
|
|
|
47
|
-
public GenericBreakingChangeAttribute(string message, string deprecateByVersion, string changeInEfectByDate)
|
|
42
|
+
public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate)
|
|
48
43
|
{
|
|
49
44
|
_message = message;
|
|
50
45
|
this.DeprecateByVersion = deprecateByVersion;
|
|
51
|
-
this.
|
|
46
|
+
this.DeprecateByAzVersion = deprecateByAzVersion;
|
|
52
47
|
|
|
53
48
|
if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result))
|
|
54
49
|
{
|
|
@@ -86,10 +81,8 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
86
81
|
writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d")));
|
|
87
82
|
}
|
|
88
83
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion));
|
|
92
|
-
}
|
|
84
|
+
writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion));
|
|
85
|
+
writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion));
|
|
93
86
|
|
|
94
87
|
if (OldWay != null && NewWay != null)
|
|
95
88
|
{
|
|
@@ -114,18 +107,13 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
114
107
|
|
|
115
108
|
public string ReplacementCmdletName { get; set; }
|
|
116
109
|
|
|
117
|
-
public CmdletBreakingChangeAttribute() :
|
|
118
|
-
|
|
110
|
+
public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion) :
|
|
111
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion)
|
|
119
112
|
{
|
|
120
113
|
}
|
|
121
114
|
|
|
122
|
-
public CmdletBreakingChangeAttribute(string
|
|
123
|
-
base(string.Empty,
|
|
124
|
-
{
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
public CmdletBreakingChangeAttribute(string deprecateByVersion, string changeInEfectByDate) :
|
|
128
|
-
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
115
|
+
public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) :
|
|
116
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate)
|
|
129
117
|
{
|
|
130
118
|
}
|
|
131
119
|
|
|
@@ -146,20 +134,15 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
146
134
|
public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute
|
|
147
135
|
{
|
|
148
136
|
public string[] ChangedParameterSet { set; get; }
|
|
149
|
-
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet) :
|
|
150
|
-
base(string.Empty)
|
|
151
|
-
{
|
|
152
|
-
ChangedParameterSet = changedParameterSet;
|
|
153
|
-
}
|
|
154
137
|
|
|
155
|
-
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string
|
|
156
|
-
base(string.Empty,
|
|
138
|
+
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion) :
|
|
139
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion)
|
|
157
140
|
{
|
|
158
141
|
ChangedParameterSet = changedParameterSet;
|
|
159
142
|
}
|
|
160
143
|
|
|
161
|
-
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersion, string changeInEfectByDate) :
|
|
162
|
-
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
144
|
+
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) :
|
|
145
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate)
|
|
163
146
|
{
|
|
164
147
|
ChangedParameterSet = changedParameterSet;
|
|
165
148
|
}
|
|
@@ -219,20 +202,14 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
219
202
|
|
|
220
203
|
public String NewParameterType { get; set; }
|
|
221
204
|
|
|
222
|
-
public ParameterBreakingChangeAttribute(string nameOfParameterChanging) :
|
|
223
|
-
|
|
224
|
-
{
|
|
225
|
-
this.NameOfParameterChanging = nameOfParameterChanging;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion) :
|
|
229
|
-
base(string.Empty, deprecateByVersion)
|
|
205
|
+
public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion) :
|
|
206
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion)
|
|
230
207
|
{
|
|
231
208
|
this.NameOfParameterChanging = nameOfParameterChanging;
|
|
232
209
|
}
|
|
233
210
|
|
|
234
|
-
public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion, string changeInEfectByDate) :
|
|
235
|
-
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
211
|
+
public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) :
|
|
212
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate)
|
|
236
213
|
{
|
|
237
214
|
this.NameOfParameterChanging = nameOfParameterChanging;
|
|
238
215
|
}
|
|
@@ -298,20 +275,14 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
298
275
|
|
|
299
276
|
public string[] NewOutputProperties { get; set; }
|
|
300
277
|
|
|
301
|
-
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType) :
|
|
302
|
-
|
|
303
|
-
{
|
|
304
|
-
this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion) :
|
|
308
|
-
base(string.Empty, deprecateByVersion)
|
|
278
|
+
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion) :
|
|
279
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion)
|
|
309
280
|
{
|
|
310
281
|
this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType;
|
|
311
282
|
}
|
|
312
283
|
|
|
313
|
-
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion, string changeInEfectByDate) :
|
|
314
|
-
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
284
|
+
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) :
|
|
285
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate)
|
|
315
286
|
{
|
|
316
287
|
this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType;
|
|
317
288
|
}
|
|
@@ -23,6 +23,7 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
23
23
|
using System.Threading.Tasks;
|
|
24
24
|
public class MessageAttributeHelper
|
|
25
25
|
{
|
|
26
|
+
private static readonly bool IsAzure = Convert.ToBoolean(@"${$project.azure}");
|
|
26
27
|
public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings";
|
|
27
28
|
public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings";
|
|
28
29
|
|
|
@@ -52,7 +53,10 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
52
53
|
//Do not process the attributes at runtime... The env variable to override the warning messages is set
|
|
53
54
|
return;
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
+
if (IsAzure && invocationInfo.BoundParameters.ContainsKey("DefaultProfile"))
|
|
57
|
+
{
|
|
58
|
+
psCmdlet.WriteWarning("The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.");
|
|
59
|
+
}
|
|
56
60
|
List<GenericBreakingChangeAttribute> attributes = new List<GenericBreakingChangeAttribute>(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet));
|
|
57
61
|
StringBuilder sb = new StringBuilder();
|
|
58
62
|
Action<string> appendBreakingChangeInfo = (string s) => sb.Append(s);
|
|
@@ -734,7 +734,7 @@ namespace Microsoft.generated.runtime.Properties
|
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
/// <summary>
|
|
737
|
-
/// Looks up a localized string similar to Note :The change is expected to take effect from
|
|
737
|
+
/// Looks up a localized string similar to Note :The change is expected to take effect from version : '{0}'
|
|
738
738
|
///
|
|
739
739
|
///.
|
|
740
740
|
/// </summary>
|
|
@@ -746,6 +746,19 @@ namespace Microsoft.generated.runtime.Properties
|
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
|
|
749
|
+
/// <summary>
|
|
750
|
+
/// Looks up a localized string similar to Note :The change is expected to take effect from az version : '{0}'
|
|
751
|
+
///
|
|
752
|
+
///.
|
|
753
|
+
/// </summary>
|
|
754
|
+
public static string BreakingChangesAttributesInEffectByAzVersion
|
|
755
|
+
{
|
|
756
|
+
get
|
|
757
|
+
{
|
|
758
|
+
return ResourceManager.GetString("BreakingChangesAttributesInEffectByAzVersion", resourceCulture);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
|
|
749
762
|
/// <summary>
|
|
750
763
|
/// Looks up a localized string similar to ```powershell
|
|
751
764
|
///# Old
|
|
@@ -5630,4 +5643,4 @@ namespace Microsoft.generated.runtime.Properties
|
|
|
5630
5643
|
}
|
|
5631
5644
|
}
|
|
5632
5645
|
}
|
|
5633
|
-
}
|
|
5646
|
+
}
|
|
@@ -1705,7 +1705,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can
|
|
|
1705
1705
|
</data>
|
|
1706
1706
|
<data name="BreakingChangesAttributesInEffectByVersion" xml:space="preserve">
|
|
1707
1707
|
<value>
|
|
1708
|
-
- The change is expected to take effect from
|
|
1708
|
+
- The change is expected to take effect from version : '{0}'</value>
|
|
1709
1709
|
</data>
|
|
1710
1710
|
<data name="BreakingChangesAttributesUsageChangeMessage" xml:space="preserve">
|
|
1711
1711
|
<value>```powershell
|
|
@@ -1738,4 +1738,7 @@ Note : Go to {0} for steps to suppress this breaking change warning, and other i
|
|
|
1738
1738
|
<data name="PreviewCmdletMessage" xml:space="preserve">
|
|
1739
1739
|
<value>This cmdlet is in preview. The functionality may not be available in the selected subscription.</value>
|
|
1740
1740
|
</data>
|
|
1741
|
+
<data name="BreakingChangesAttributesInEffectByAzVersion" xml:space="preserve">
|
|
1742
|
+
<value>- The change is expected to take effect from Az version : '{0}'</value>
|
|
1743
|
+
</data>
|
|
1741
1744
|
</root>
|