Skip to content

Commit 13280d8

Browse files
committed
Fix Enum Problems
1 parent 44baf45 commit 13280d8

File tree

4 files changed

+70
-156
lines changed

4 files changed

+70
-156
lines changed

src/ResourceManager/Compute/Commands.Compute/Generated/cli.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5704,8 +5704,8 @@ exports.init = function (cli) {
57045704
var parametersObj = null;
57055705
if (options.parameterFile) {
57065706
cli.output.info('Reading file content from: \"' + options.parameterFile + '\"');
5707-
var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
5708-
parametersObj = JSON.parse(fileContent);
5707+
var parametersFileContent = fs.readFileSync(options.parameterFile, 'utf8');
5708+
parametersObj = JSON.parse(parametersFileContent);
57095709
}
57105710
else {
57115711
parametersObj = {};
@@ -6257,8 +6257,8 @@ exports.init = function (cli) {
62576257
var parametersObj = null;
62586258
if (options.parameterFile) {
62596259
cli.output.info('Reading file content from: \"' + options.parameterFile + '\"');
6260-
var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
6261-
parametersObj = JSON.parse(fileContent);
6260+
var parametersFileContent = fs.readFileSync(options.parameterFile, 'utf8');
6261+
parametersObj = JSON.parse(parametersFileContent);
62626262
}
62636263
else {
62646264
parametersObj = {};

src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Automation/Generate-FunctionCommand.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ function Generate-CliFunctionCommandImpl
175175
$code += " var ${cli_param_name}Obj = null;" + $NEW_LINE;
176176
$code += " if (options.parameterFile) {" + $NEW_LINE;
177177
$code += " cli.output.info(`'Reading file content from: \`"`' + options.parameterFile + `'\`"`');" + $NEW_LINE;
178-
$code += " var fileContent = fs.readFileSync(options.parameterFile, 'utf8');" + $NEW_LINE;
179-
$code += " ${cli_param_name}Obj = JSON.parse(fileContent);" + $NEW_LINE;
178+
$code += " var ${cli_param_name}FileContent = fs.readFileSync(options.parameterFile, 'utf8');" + $NEW_LINE;
179+
$code += " ${cli_param_name}Obj = JSON.parse(${cli_param_name}FileContent);" + $NEW_LINE;
180180
$code += " }" + $NEW_LINE;
181181
$code += " else {" + $NEW_LINE;
182182
$code += " ${cli_param_name}Obj = {};" + $NEW_LINE;

src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Automation/ParameterTypeHelper.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ function Contains-OnlyStringFields
2424
return $false;
2525
}
2626

27+
if ($parameterType.BaseType.IsEquivalentTo([System.Enum]))
28+
{
29+
return $false;
30+
}
31+
2732
$result = $true;
2833

2934
foreach ($propItem in $parameterType.GetProperties())
@@ -49,6 +54,11 @@ function Contains-OnlyStringList
4954
return $false;
5055
}
5156

57+
if ($parameterType.BaseType.IsEquivalentTo([System.Enum]))
58+
{
59+
return $false;
60+
}
61+
5262
if ($parameterType.GetProperties().Count -ne 1)
5363
{
5464
return $false;

0 commit comments

Comments
 (0)