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()
9696 {
9797 case string jsonString :
9898 WriteObject ( _serializer . Deserialize ( jsonString ) ) ;
99- return ;
99+ continue ;
100100
101101 case FileInfo jsonFile :
102102 WriteObject ( _serializer . Deserialize ( jsonFile ) ) ;
103- return ;
103+ continue ;
104104
105105 case TextReader jsonReader :
106106 WriteObject ( _serializer . Deserialize ( jsonReader ) ) ;
107- return ;
107+ continue ;
108108
109109 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 ;
111115 }
112116 }
113117 }
You can’t perform that action at this time.
0 commit comments