File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Commands Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -96,18 +96,22 @@ protected override void ProcessRecord()
96
96
{
97
97
case string jsonString :
98
98
WriteObject ( _serializer . Deserialize ( jsonString ) ) ;
99
- return ;
99
+ continue ;
100
100
101
101
case FileInfo jsonFile :
102
102
WriteObject ( _serializer . Deserialize ( jsonFile ) ) ;
103
- return ;
103
+ continue ;
104
104
105
105
case TextReader jsonReader :
106
106
WriteObject ( _serializer . Deserialize ( jsonReader ) ) ;
107
- return ;
107
+ continue ;
108
108
109
109
default :
110
- throw new ArgumentException ( $ "Unsupported type for { nameof ( JsonSource ) } parameter. Should be a string, FileInfo or TextReader object.") ;
110
+ this . WriteExceptionAsError (
111
+ new ArgumentException ( $ "Unsupported type for { nameof ( JsonSource ) } parameter. Should be a string, FileInfo or TextReader object.") ,
112
+ errorId : "InvalidArgument" ,
113
+ errorCategory : ErrorCategory . InvalidArgument ) ;
114
+ continue ;
111
115
}
112
116
}
113
117
}
You can’t perform that action at this time.
0 commit comments