@autorest/powershell 3.0.501 → 3.0.502
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.
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"powershell/models/model-extensions.ts": "92f57419e2bb8aec5272d62742ad528caebb66f4",
|
|
73
73
|
"powershell/module/module-class.ts": "c792f01e3bfecb7c22efd953feb175f6b8394c78",
|
|
74
74
|
"powershell/module/module-namespace.ts": "f6afc90087e8d733f0323b0de8ba41d923955732",
|
|
75
|
-
"powershell/package.json": "
|
|
75
|
+
"powershell/package.json": "62c76124ee65c9f3868150bc64367359a508af31",
|
|
76
76
|
"powershell/plugins/add-azure-completers-v2.ts": "557ce4326318c82f91445490a162f20fa029fed3",
|
|
77
77
|
"powershell/plugins/create-commands-v2.ts": "0190353c046a386a6458d2394377da59ae271643",
|
|
78
78
|
"powershell/plugins/cs-namer-v2.ts": "e294a2f5ac3db421d030a3bba8343a3d4a9ea6ab",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"powershell/readme.md": "fe572b3ccddf3809363aff0d673c01c04509a757",
|
|
88
88
|
"powershell/resources/assets/build-module.ps1": "64761cf5324d6ccc32bbb908c53eecabe81acbd0",
|
|
89
89
|
"powershell/resources/assets/check-dependencies.ps1": "fdbc4bc30bde12fcdefe905acc55614e9d570a67",
|
|
90
|
-
"powershell/resources/assets/create-model-cmdlets.ps1": "
|
|
90
|
+
"powershell/resources/assets/create-model-cmdlets.ps1": "4034165ccc3c8e06fcc5b43f91733387c01011d5",
|
|
91
91
|
"powershell/resources/assets/custom/README.md": "8f35d9de2dd67e37c4135b2d91dc194b33c9cd3f",
|
|
92
92
|
"powershell/resources/assets/docs/README.md": "7ea7065e913f5792b57d826f5cf12c603c87421d",
|
|
93
93
|
"powershell/resources/assets/examples/README.md": "a0ad7c4631b6944a22edd0c2d23fe0bc66365ac7",
|
package/package.json
CHANGED
|
@@ -12,9 +12,13 @@ function CreateModelCmdlet {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot '${$lib.path.relative($project.baseFolder, $project.apiFolder)}') 'Models'
|
|
15
|
-
$ModuleName = '${$project.subjectPrefix}'
|
|
16
15
|
$OutputDir = Join-Path $PSScriptRoot '${$lib.path.relative($project.baseFolder, $project.modelCmdletFolder)}'
|
|
17
16
|
$null = New-Item -ItemType Directory -Force -Path $OutputDir
|
|
17
|
+
if ('${$project.rootModuleName}'.length -gt 0) {
|
|
18
|
+
$ModuleName = '${$project.rootModuleName}'
|
|
19
|
+
} else {
|
|
20
|
+
$ModuleName = '${$project.moduleName}'
|
|
21
|
+
}
|
|
18
22
|
|
|
19
23
|
$CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
|
|
20
24
|
$Content = ''
|
|
@@ -53,10 +57,10 @@ function CreateModelCmdlet {
|
|
|
53
57
|
$ObjectType = $Model
|
|
54
58
|
$ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
|
|
55
59
|
# remove duplicated module name
|
|
56
|
-
if ($ObjectType.StartsWith($
|
|
60
|
+
if ($ObjectType.StartsWith('${$project.subjectPrefix}')) {
|
|
57
61
|
$ModulePrefix = ''
|
|
58
62
|
} else {
|
|
59
|
-
$ModulePrefix = $
|
|
63
|
+
$ModulePrefix = '${$project.subjectPrefix}'
|
|
60
64
|
}
|
|
61
65
|
$OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
|
|
62
66
|
|
|
@@ -136,7 +140,7 @@ Create an in-memory object for ${ObjectType}.
|
|
|
136
140
|
.Outputs
|
|
137
141
|
${ObjectTypeWithNamespace}
|
|
138
142
|
.Link
|
|
139
|
-
${$project.helpLinkPrefix}
|
|
143
|
+
${$project.helpLinkPrefix}${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
|
|
140
144
|
#>
|
|
141
145
|
function New-Az${ModulePrefix}${ObjectType}Object {
|
|
142
146
|
[OutputType('${ObjectTypeWithNamespace}')]
|