diff --git a/lib/winrm/psrp/message_data/pipeline_output.rb b/lib/winrm/psrp/message_data/pipeline_output.rb index fbb7a7aa..5b8713b3 100644 --- a/lib/winrm/psrp/message_data/pipeline_output.rb +++ b/lib/winrm/psrp/message_data/pipeline_output.rb @@ -33,7 +33,8 @@ def extract_out_string(text) text = '' if node.text text << node.text.gsub(/(_x\h\h\h\h_)+/) do |match| - match.scan(/_x(\h\h\h\h)_/).flatten.map { |utf16| utf16.hex }.pack('S*').force_encoding('utf-16le').encode('utf-8') + match.scan(/_x(\h\h\h\h)_/).flatten.map(&:hex) + .pack('S*').force_encoding('utf-16le').encode('utf-8') end.chomp end text << "\r\n"