Skip to content

Use winrm v2 implementation #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 4, 2016
Merged

Use winrm v2 implementation #122

merged 1 commit into from
Sep 4, 2016

Conversation

mwrock
Copy link
Contributor

@mwrock mwrock commented Jul 4, 2016

Test-Kitchen using winrm v2 has just been released. I'll be removing the WIP from kitchen-inspec momentarily as well.

# Encodes the script so that it can be passed to the PowerShell
# --EncodedCommand argument.
# @return [String] The UTF-16LE base64 encoded script
def encoded(script)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, I like the approach to make this more explicit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Also, there is no PowershellScript class in winrm v2 so we cant leverage that.

@chris-rock
Copy link
Contributor

This looks awesome @mwrock Is this also addressing the issue, where we are only able to transfer scripts with a limited size?

@mwrock
Copy link
Contributor Author

mwrock commented Jul 4, 2016

Thats right. There will be no script length limitation and according to local benchmarking, file uploads will be 15-30x faster. You can also run scripts within the same scope. So you could do:

shell.run("$blah = 'val'")
shell.run("write-host $blah")

Previously the second run call would have an entirely different $blah.

And winrmV2 can talk to and transfer files to Windows Nano server.

@mwrock
Copy link
Contributor Author

mwrock commented Jul 4, 2016

Created a separate PR for the travis/appveyor changes #123

@mwrock mwrock changed the title WIP: initial pass at winrm v2 implementation Use winrm v2 implementation Sep 2, 2016
@mwrock
Copy link
Contributor Author

mwrock commented Sep 2, 2016

No longer WIP :)

@chris-rock
Copy link
Contributor

💯 @mwrock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants