packer-community / winrmcp

Copy files to a remote host using WinRM
MIT License
58 stars 31 forks source link

Can't create shell when using IPv6 address as host argument #22

Closed mgoldsmi closed 7 years ago

mgoldsmi commented 7 years ago

When executing winrmcp using an IPv6 address as the hostname argument, the copy will fail with an error stating"there are too many colons in the address"

Expected Behaviour

Here is an example of a file upload being done using a hostname that is aliased to an IPv6 address:

[mgoldsmi@build01 winrmcp]$ bin/winrmcp -addr win01 -user Administrator -pass "****" readme.md readme.md

winrmcp also executes correctly using IPv4 addresses:

[mgoldsmi@build01 winrmcp]$ bin/winrmcp -addr 192.168.255.7 -user Administrator -pass "****" readme.md readme.md

Actual Behaviour

And this is the result if you replace the hostname alias with the actual IPv6 address:

[mgoldsmi@build01 winrmcp]$ bin/winrmcp -addr [2402:9900:111:1373:62d0:501c:4cb8:dae0]:5985 -user Administrator -pass "****" readme.md readme.md
Error uploading file to $env:TEMP\winrmcp-5800d2e0-efb8-49e7-4a89-92f519f38459.tmp: Couldn't create shell: unknown error Post http://2402:9900:111:1373:62d0:501c:4cb8:dae0:5985/wsman: dial tcp: too many colons in address 2402:9900:111:1373:62d0:501c:4cb8:dae0:5985