Skip to content

Commit

Permalink
Fix ConvertFrom-PSCompatibilityJson for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmholt committed Apr 26, 2019
1 parent 0bbf54f commit db6cd7b
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,22 @@ protected override void ProcessRecord()
{
case string jsonString:
WriteObject(_serializer.Deserialize(jsonString));
return;
continue;

case FileInfo jsonFile:
WriteObject(_serializer.Deserialize(jsonFile));
return;
continue;

case TextReader jsonReader:
WriteObject(_serializer.Deserialize(jsonReader));
return;
continue;

default:
throw new ArgumentException($"Unsupported type for {nameof(JsonSource)} parameter. Should be a string, FileInfo or TextReader object.");
this.WriteExceptionAsError(
new ArgumentException($"Unsupported type for {nameof(JsonSource)} parameter. Should be a string, FileInfo or TextReader object."),
errorId: "InvalidArgument",
errorCategory: ErrorCategory.InvalidArgument);
continue;
}
}
}
Expand Down

0 comments on commit db6cd7b

Please sign in to comment.