You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
conn = WinRM::Connection.new(opts)
conn.shell(:powershell) do |shell|
output = shell.run("$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'") do |stdout, stderr|
STDOUT.print stdout
STDERR.print stderr
end
puts "The script exited with exit code #{output.exitcode}"
end
And error:
/Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm.rb:166:in upcase': invalid byte sequence in UTF-8 (ArgumentError) from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm.rb:166:in ntlmv2_hash'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client/session.rb:192:in ntlmv2_hash' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client/session.rb:196:in calculate_user_session_key!'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client/session.rb:27:in authenticate!' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client.rb:36:in init_context'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/http/transport.rb:229:in init_auth' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/http/transport.rb:168:in send_request'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/cmd.rb:56:in open_shell' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:168:in block in open'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/retryable.rb:37:in retryable' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:166:in open'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:129:in with_command_shell' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:81:in run'
from winrm_https.rb:24:in block in <main>' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/connection.rb:44:in shell'
from winrm_https.rb:23:in `
'
The text was updated successfully, but these errors were encountered:
I have a issue when I try to use non ascii characters, like for example Japanese characters.
Script that I used to test:
require 'winrm'
opts = {
endpoint: "http://???:5985/wsman",
user: "ア ウェブ",
password: "?????",
overall_timeout: 15,
retry_limit: 3,
retry_delay: 10
}
conn = WinRM::Connection.new(opts)
conn.shell(:powershell) do |shell|
output = shell.run("$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'") do |stdout, stderr|
STDOUT.print stdout
STDERR.print stderr
end
puts "The script exited with exit code #{output.exitcode}"
end
And error:
'/Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm.rb:166:in
upcase': invalid byte sequence in UTF-8 (ArgumentError) from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm.rb:166:in
ntlmv2_hash'from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client/session.rb:192:in
ntlmv2_hash' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client/session.rb:196:in
calculate_user_session_key!'from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client/session.rb:27:in
authenticate!' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client.rb:36:in
init_context'from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/http/transport.rb:229:in
init_auth' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/http/transport.rb:168:in
send_request'from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/cmd.rb:56:in
open_shell' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:168:in
block in open'from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/retryable.rb:37:in
retryable' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:166:in
open'from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:129:in
with_command_shell' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:81:in
run'from winrm_https.rb:24:in
block in <main>' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/connection.rb:44:in
shell'from winrm_https.rb:23:in `
The text was updated successfully, but these errors were encountered: