vagrant-unbundled 2.1.4.0 → 2.2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +58 -1
- data/Gemfile.lock +9 -5
- data/contrib/bash/completion.sh +16 -2
- data/contrib/sudoers/osx +1 -1
- data/lib/vagrant/environment.rb +16 -21
- data/lib/vagrant/errors.rb +28 -0
- data/lib/vagrant/machine.rb +1 -1
- data/lib/vagrant/plugin/manager.rb +35 -1
- data/lib/vagrant/plugin/v2/trigger.rb +23 -0
- data/lib/vagrant/util/curl_helper.rb +96 -0
- data/lib/vagrant/util/downloader.rb +2 -79
- data/lib/vagrant/util/guest_inspection.rb +18 -5
- data/lib/vagrant/util/platform.rb +33 -8
- data/lib/vagrant/util/uploader.rb +103 -0
- data/lib/vagrant/vagrantfile.rb +5 -1
- data/lib/vagrant.rb +39 -13
- data/plugins/commands/cloud/auth/login.rb +90 -0
- data/plugins/commands/cloud/auth/logout.rb +42 -0
- data/plugins/commands/cloud/auth/plugin.rb +20 -0
- data/plugins/commands/cloud/auth/root.rb +73 -0
- data/plugins/commands/cloud/auth/whoami.rb +62 -0
- data/plugins/commands/cloud/box/create.rb +75 -0
- data/plugins/commands/cloud/box/delete.rb +65 -0
- data/plugins/commands/cloud/box/plugin.rb +19 -0
- data/plugins/commands/cloud/box/root.rb +77 -0
- data/plugins/commands/cloud/box/show.rb +74 -0
- data/plugins/commands/cloud/box/update.rb +71 -0
- data/plugins/commands/cloud/client/client.rb +264 -0
- data/plugins/commands/cloud/errors.rb +28 -0
- data/plugins/commands/cloud/list.rb +52 -0
- data/plugins/commands/cloud/locales/en.yml +159 -0
- data/plugins/commands/cloud/plugin.rb +30 -0
- data/plugins/commands/cloud/provider/create.rb +73 -0
- data/plugins/commands/cloud/provider/delete.rb +70 -0
- data/plugins/commands/cloud/provider/plugin.rb +19 -0
- data/plugins/commands/cloud/provider/root.rb +77 -0
- data/plugins/commands/cloud/provider/update.rb +73 -0
- data/plugins/commands/cloud/provider/upload.rb +75 -0
- data/plugins/commands/cloud/publish.rb +165 -0
- data/plugins/commands/cloud/root.rb +104 -0
- data/plugins/commands/cloud/search.rb +83 -0
- data/plugins/commands/cloud/util.rb +206 -0
- data/plugins/commands/cloud/version/create.rb +69 -0
- data/plugins/commands/cloud/version/delete.rb +68 -0
- data/plugins/commands/cloud/version/plugin.rb +19 -0
- data/plugins/commands/cloud/version/release.rb +69 -0
- data/plugins/commands/cloud/version/revoke.rb +69 -0
- data/plugins/commands/cloud/version/root.rb +81 -0
- data/plugins/commands/cloud/version/update.rb +69 -0
- data/plugins/commands/init/command.rb +1 -1
- data/plugins/commands/login/plugin.rb +4 -3
- data/plugins/commands/powershell/command.rb +3 -0
- data/plugins/commands/powershell/plugin.rb +1 -0
- data/plugins/commands/upload/command.rb +236 -0
- data/plugins/commands/upload/plugin.rb +17 -0
- data/plugins/commands/winrm/command.rb +69 -0
- data/plugins/commands/winrm/plugin.rb +17 -0
- data/plugins/commands/winrm_config/command.rb +125 -0
- data/plugins/commands/winrm_config/plugin.rb +17 -0
- data/plugins/guests/bsd/cap/file_system.rb +77 -0
- data/plugins/guests/bsd/plugin.rb +15 -0
- data/plugins/guests/linux/cap/file_system.rb +79 -0
- data/plugins/guests/linux/cap/network_interfaces.rb +13 -2
- data/plugins/guests/linux/plugin.rb +15 -0
- data/plugins/guests/redhat/cap/change_host_name.rb +21 -13
- data/plugins/guests/solaris/cap/file_system.rb +77 -0
- data/plugins/guests/solaris/plugin.rb +15 -0
- data/plugins/guests/windows/cap/file_system.rb +65 -0
- data/plugins/guests/windows/cap/mount_shared_folder.rb +1 -1
- data/plugins/guests/windows/plugin.rb +10 -0
- data/plugins/kernel_v2/config/vm.rb +3 -0
- data/plugins/kernel_v2/config/vm_trigger.rb +49 -1
- data/plugins/providers/docker/action/build.rb +23 -8
- data/plugins/providers/docker/action/is_build.rb +1 -1
- data/plugins/providers/docker/config.rb +50 -10
- data/plugins/providers/hyperv/scripts/configure_vm.ps1 +16 -2
- data/plugins/providers/virtualbox/action/match_mac_address.rb +8 -5
- data/plugins/providers/virtualbox/driver/version_5_0.rb +1 -0
- data/plugins/provisioners/ansible/provisioner/guest.rb +2 -8
- data/plugins/provisioners/puppet/provisioner/puppet.rb +4 -2
- data/plugins/provisioners/salt/bootstrap-salt.sh +1 -1
- data/plugins/provisioners/salt/provisioner.rb +19 -4
- data/plugins/synced_folders/rsync/helper.rb +2 -1
- data/templates/commands/ssh_config/config.erb +1 -1
- data/templates/commands/winrm_config/config.erb +11 -0
- data/templates/guests/openbsd/network_static6.erb +1 -0
- data/templates/locales/en.yml +60 -1
- data/templates/locales/providers_docker.yml +11 -3
- data/vagrant.gemspec +3 -1
- data/vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-spec-94a9d31ba18b/vagrant-spec.gemspec +1 -1
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/LICENSE +22 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/README.md +67 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/bin/vagrant_cloud +5 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/account.rb +190 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/box.rb +185 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/client.rb +73 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/errors.rb +25 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/provider.rb +149 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/search.rb +31 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/version.rb +188 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud.rb +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/.gitignore +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/.rubocop.yml +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/.travis.yml +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/Gemfile +2 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/LICENSE +202 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/README.md +276 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/Rakefile +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/Vagrantfile +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/WinrmAppveyor.psm1 +32 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/appveyor.yml +50 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/bin/rwinrm +90 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/changelog.md +133 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/connection.rb +84 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/connection_opts.rb +90 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/exceptions.rb +88 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/http/response_handler.rb +127 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/http/transport.rb +462 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/http/transport_factory.rb +64 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/output.rb +58 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/create_pipeline.xml.erb +167 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/fragment.rb +68 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/init_runspace_pool.xml.erb +224 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message.rb +128 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/base.rb +47 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/error_record.rb +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/pipeline_host_call.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/pipeline_output.rb +48 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/pipeline_state.rb +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/runspacepool_host_call.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/runspacepool_state.rb +37 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/session_capability.rb +34 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data.rb +40 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_defragmenter.rb +62 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_factory.rb +74 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_fragmenter.rb +58 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/powershell_output_decoder.rb +142 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/receive_response_reader.rb +95 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/session_capability.xml.erb +7 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/uuid.rb +39 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/shells/base.rb +187 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/shells/cmd.rb +63 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/shells/power_shell.rb +207 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/shells/retryable.rb +44 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/shells/shell_factory.rb +56 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/version.rb +5 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/base.rb +57 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/cleanup_command.rb +60 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/close_shell.rb +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/command.rb +100 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/command_output.rb +75 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/command_output_decoder.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/configuration.rb +44 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/create_pipeline.rb +64 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/create_shell.rb +115 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/header.rb +213 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/init_runspace_pool.rb +96 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/iso8601_duration.rb +58 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/keep_alive.rb +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/receive_response_reader.rb +128 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/send_data.rb +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/soap.rb +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/wql_pull.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/wql_query.rb +98 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/write_stdin.rb +86 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm.rb +37 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/preamble +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/auth_timeout_spec.rb +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/cmd_spec.rb +130 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/config-example.yml +16 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/issue_59_spec.rb +25 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/powershell_spec.rb +164 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/spec_helper.rb +62 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/transport_spec.rb +98 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/wql_spec.rb +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/matchers.rb +59 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/configuration_spec.rb +183 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/connection_spec.rb +37 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/exception_spec.rb +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/http/transport_factory_spec.rb +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/http/transport_spec.rb +43 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/output_spec.rb +128 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/fragment_spec.rb +60 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/base_spec.rb +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/error_record_spec.rb +39 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/pipeline_host_call_spec.rb +23 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/pipeline_output_spec.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/pipeline_state_spec.rb +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/runspace_pool_host_call_spec.rb +23 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/runspacepool_state_spec.rb +14 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/session_capability_spec.rb +28 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data_spec.rb +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_defragmenter_spec.rb +45 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_fragmenter_spec.rb +103 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/powershell_output_decoder_spec.rb +98 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/psrp_message_spec.rb +73 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/recieve_response_reader_spec.rb +170 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/uuid_spec.rb +28 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/response_handler_spec.rb +69 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/shells/base_spec.rb +227 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/shells/cmd_spec.rb +75 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/shells/powershell_spec.rb +221 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/spec_helper.rb +46 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/clixml/error_record.xml.erb +84 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/clixml/pipeline_state.xml.erb +88 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_command_output_response.xml.erb +13 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_command_output_response_not_done.xml.erb +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_omi_command_output_response.xml.erb +23 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_omi_command_output_response_not_done.xml.erb +24 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_omi_config_response.xml +45 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_omi_powershell_keepalive_response.xml.erb +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_powershell_keepalive_response.xml.erb +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_powershell_output_response.xml.erb +12 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_powershell_output_response_not_done.xml.erb +9 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/open_shell_omi.xml +43 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/open_shell_v1.xml +19 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/open_shell_v2.xml +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/soap_fault_omi.xml +31 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/soap_fault_v1.xml +36 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/soap_fault_v2.xml +42 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/wmi_error_v2.xml +41 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/cleanup_command_spec.rb +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/close_shell_spec.rb +15 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/command_output_decoder_spec.rb +35 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/command_output_spec.rb +43 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/command_spec.rb +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/configuration_spec.rb +15 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/create_pipeline_spec.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/create_shell_spec.rb +39 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/init_runspace_pool_spec.rb +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/keep_alive_spec.rb +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/receive_response_reader_spec.rb +124 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/send_data_spec.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/wql_query_spec.rb +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/write_stdin_spec.rb +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/winrm.gemspec +46 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/.gitignore +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/.rspec +2 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/.rubocop.yml +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/.rubocop_todo.yml +65 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/.travis.yml +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/Gemfile +4 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/LICENSE +202 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/README.md +82 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/Rakefile +27 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/VERSION +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/Vagrantfile +8 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/appveyor.yml +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/bin/rwinrmcp +85 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/changelog.md +74 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/core/file_transporter.rb +566 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/core/tmp_zip.rb +176 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/exceptions.rb +27 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/file_manager.rb +156 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/check_files.ps1.erb +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/checksum.ps1.erb +13 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/create_dir.ps1.erb +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/delete.ps1.erb +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/download.ps1.erb +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/exists.ps1.erb +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/extract_files.ps1.erb +52 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/scripts.rb +31 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs.rb +27 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/config-example.yml +3 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/integration/file_manager_spec.rb +303 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/integration/tmp_zip_spec.rb +26 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/matchers.rb +57 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/spec_helper.rb +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/unit/tmp_zip_spec.rb +78 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/winrm-fs.gemspec +36 -0
- data/vendor/bundle/ruby/2.5.0/specifications/vagrant_cloud-2.0.1.gemspec +45 -0
- data/vendor/bundle/ruby/2.5.0/specifications/winrm-2.3.0.gemspec +73 -0
- data/vendor/bundle/ruby/2.5.0/specifications/winrm-fs-1.3.1.gemspec +57 -0
- data/version.txt +1 -1
- metadata +268 -4
@@ -0,0 +1,167 @@
|
|
1
|
+
<Obj RefId="0">
|
2
|
+
<MS>
|
3
|
+
<Obj N="PowerShell" RefId="1">
|
4
|
+
<MS>
|
5
|
+
<Obj N="Cmds" RefId="2">
|
6
|
+
<TN RefId="0">
|
7
|
+
<T>System.Collections.Generic.List`1[[System.Management.Automation.PSObject, System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]</T>
|
8
|
+
<T>System.Object</T>
|
9
|
+
</TN>
|
10
|
+
<LST>
|
11
|
+
<Obj RefId="3">
|
12
|
+
<MS>
|
13
|
+
<S N="Cmd">Invoke-expression</S>
|
14
|
+
<B N="IsScript">false</B>
|
15
|
+
<Nil N="UseLocalScope" />
|
16
|
+
<Obj N="MergeMyResult" RefId="4">
|
17
|
+
<TN RefId="1">
|
18
|
+
<T>System.Management.Automation.Runspaces.PipelineResultTypes</T>
|
19
|
+
<T>System.Enum</T>
|
20
|
+
<T>System.ValueType</T>
|
21
|
+
<T>System.Object</T>
|
22
|
+
</TN>
|
23
|
+
<ToString>None</ToString>
|
24
|
+
<I32>0</I32>
|
25
|
+
</Obj>
|
26
|
+
<Obj N="MergeToResult" RefId="5">
|
27
|
+
<TNRef RefId="1" />
|
28
|
+
<ToString>None</ToString>
|
29
|
+
<I32>0</I32>
|
30
|
+
</Obj>
|
31
|
+
<Obj N="MergePreviousResults" RefId="6">
|
32
|
+
<TNRef RefId="1" />
|
33
|
+
<ToString>None</ToString>
|
34
|
+
<I32>0</I32>
|
35
|
+
</Obj>
|
36
|
+
<Obj N="MergeError" RefId="7">
|
37
|
+
<TNRef RefId="1" />
|
38
|
+
<ToString>None</ToString>
|
39
|
+
<I32>0</I32>
|
40
|
+
</Obj>
|
41
|
+
<Obj N="MergeWarning" RefId="8">
|
42
|
+
<TNRef RefId="1" />
|
43
|
+
<ToString>None</ToString>
|
44
|
+
<I32>0</I32>
|
45
|
+
</Obj>
|
46
|
+
<Obj N="MergeVerbose" RefId="9">
|
47
|
+
<TNRef RefId="1" />
|
48
|
+
<ToString>None</ToString>
|
49
|
+
<I32>0</I32>
|
50
|
+
</Obj>
|
51
|
+
<Obj N="MergeDebug" RefId="10">
|
52
|
+
<TNRef RefId="1" />
|
53
|
+
<ToString>None</ToString>
|
54
|
+
<I32>0</I32>
|
55
|
+
</Obj>
|
56
|
+
<Obj N="Args" RefId="11">
|
57
|
+
<TNRef RefId="0" />
|
58
|
+
<LST>
|
59
|
+
<Obj RefId="12">
|
60
|
+
<MS>
|
61
|
+
<S N="N">-Command</S>
|
62
|
+
<Nil N="V" />
|
63
|
+
</MS>
|
64
|
+
</Obj>
|
65
|
+
<Obj RefId="13">
|
66
|
+
<MS>
|
67
|
+
<Nil N="N" />
|
68
|
+
<S N="V"><%= command %></S>
|
69
|
+
</MS>
|
70
|
+
</Obj>
|
71
|
+
</LST>
|
72
|
+
</Obj>
|
73
|
+
</MS>
|
74
|
+
</Obj>
|
75
|
+
<Obj RefId="14">
|
76
|
+
<MS>
|
77
|
+
<S N="Cmd">Out-string</S>
|
78
|
+
<B N="IsScript">false</B>
|
79
|
+
<Nil N="UseLocalScope" />
|
80
|
+
<Obj N="MergeMyResult" RefId="15">
|
81
|
+
<TNRef RefId="1" />
|
82
|
+
<ToString>None</ToString>
|
83
|
+
<I32>0</I32>
|
84
|
+
</Obj>
|
85
|
+
<Obj N="MergeToResult" RefId="16">
|
86
|
+
<TNRef RefId="1" />
|
87
|
+
<ToString>None</ToString>
|
88
|
+
<I32>0</I32>
|
89
|
+
</Obj>
|
90
|
+
<Obj N="MergePreviousResults" RefId="17">
|
91
|
+
<TNRef RefId="1" />
|
92
|
+
<ToString>None</ToString>
|
93
|
+
<I32>0</I32>
|
94
|
+
</Obj>
|
95
|
+
<Obj N="MergeError" RefId="18">
|
96
|
+
<TNRef RefId="1" />
|
97
|
+
<ToString>None</ToString>
|
98
|
+
<I32>0</I32>
|
99
|
+
</Obj>
|
100
|
+
<Obj N="MergeWarning" RefId="19">
|
101
|
+
<TNRef RefId="1" />
|
102
|
+
<ToString>None</ToString>
|
103
|
+
<I32>0</I32>
|
104
|
+
</Obj>
|
105
|
+
<Obj N="MergeVerbose" RefId="20">
|
106
|
+
<TNRef RefId="1" />
|
107
|
+
<ToString>None</ToString>
|
108
|
+
<I32>0</I32>
|
109
|
+
</Obj>
|
110
|
+
<Obj N="MergeDebug" RefId="21">
|
111
|
+
<TNRef RefId="1" />
|
112
|
+
<ToString>None</ToString>
|
113
|
+
<I32>0</I32>
|
114
|
+
</Obj>
|
115
|
+
<Obj N="Args" RefId="22">
|
116
|
+
<TNRef RefId="0" />
|
117
|
+
<LST>
|
118
|
+
<Obj RefId="22">
|
119
|
+
<MS>
|
120
|
+
<S N="N">-Stream</S>
|
121
|
+
<Nil N="V" />
|
122
|
+
</MS>
|
123
|
+
</Obj>
|
124
|
+
</LST>
|
125
|
+
</Obj>
|
126
|
+
</MS>
|
127
|
+
</Obj>
|
128
|
+
</LST>
|
129
|
+
</Obj>
|
130
|
+
<B N="IsNested">false</B>
|
131
|
+
<Nil N="History" />
|
132
|
+
<B N="RedirectShellErrorOutputPipe">true</B>
|
133
|
+
</MS>
|
134
|
+
</Obj>
|
135
|
+
<B N="NoInput">true</B>
|
136
|
+
<Obj N="ApartmentState" RefId="23">
|
137
|
+
<TN RefId="2">
|
138
|
+
<T>System.Threading.ApartmentState</T>
|
139
|
+
<T>System.Enum</T>
|
140
|
+
<T>System.ValueType</T>
|
141
|
+
<T>System.Object</T>
|
142
|
+
</TN>
|
143
|
+
<ToString>Unknown</ToString>
|
144
|
+
<I32>2</I32>
|
145
|
+
</Obj>
|
146
|
+
<Obj N="RemoteStreamOptions" RefId="24">
|
147
|
+
<TN RefId="3">
|
148
|
+
<T>System.Management.Automation.RemoteStreamOptions</T>
|
149
|
+
<T>System.Enum</T>
|
150
|
+
<T>System.ValueType</T>
|
151
|
+
<T>System.Object</T>
|
152
|
+
</TN>
|
153
|
+
<ToString>0</ToString>
|
154
|
+
<I32>0</I32>
|
155
|
+
</Obj>
|
156
|
+
<B N="AddToHistory">true</B>
|
157
|
+
<Obj N="HostInfo" RefId="25">
|
158
|
+
<MS>
|
159
|
+
<B N="_isHostNull">true</B>
|
160
|
+
<B N="_isHostUINull">true</B>
|
161
|
+
<B N="_isHostRawUINull">true</B>
|
162
|
+
<B N="_useRunspaceHost">true</B>
|
163
|
+
</MS>
|
164
|
+
</Obj>
|
165
|
+
<B N="IsNested">false</B>
|
166
|
+
</MS>
|
167
|
+
</Obj>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# Copyright 2016 Matt Wrock <matt@mattwrock.com>
|
2
|
+
# Copyright 2016 Shawn Neal <sneal@sneal.net>
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the 'License');
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an 'AS IS' BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
module WinRM
|
17
|
+
# PowerShell Remoting Protcol module
|
18
|
+
module PSRP
|
19
|
+
# PowerShell Remoting Protocol message fragment.
|
20
|
+
class Fragment
|
21
|
+
# Creates a new PSRP message fragment
|
22
|
+
# @param object_id [Integer] The id of the fragmented message.
|
23
|
+
# @param blob [Array] Array of fragmented bytes.
|
24
|
+
# @param fragment_id [Integer] The id of this fragment
|
25
|
+
# @param start_fragment [Boolean] If the fragment is the first fragment
|
26
|
+
# @param end_fragment [Boolean] If the fragment is the last fragment
|
27
|
+
def initialize(object_id, blob, fragment_id = 0, start_fragment = true, end_fragment = true)
|
28
|
+
@object_id = object_id
|
29
|
+
@blob = blob
|
30
|
+
@fragment_id = fragment_id
|
31
|
+
@start_fragment = start_fragment
|
32
|
+
@end_fragment = end_fragment
|
33
|
+
end
|
34
|
+
|
35
|
+
attr_reader :object_id, :fragment_id, :end_fragment, :start_fragment, :blob
|
36
|
+
|
37
|
+
# Returns the raw PSRP message bytes ready for transfer to Windows inside a
|
38
|
+
# WinRM message.
|
39
|
+
# @return [Array<Byte>] Unencoded raw byte array of the PSRP message.
|
40
|
+
def bytes
|
41
|
+
[
|
42
|
+
int64be(object_id),
|
43
|
+
int64be(fragment_id),
|
44
|
+
end_start_fragment,
|
45
|
+
int16be(blob.length),
|
46
|
+
blob
|
47
|
+
].flatten
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def end_start_fragment
|
53
|
+
end_start = 0
|
54
|
+
end_start += 0b10 if end_fragment
|
55
|
+
end_start += 0b1 if start_fragment
|
56
|
+
[end_start]
|
57
|
+
end
|
58
|
+
|
59
|
+
def int64be(int64)
|
60
|
+
[int64 >> 32, int64 & 0x00000000ffffffff].pack('N2').unpack('C8')
|
61
|
+
end
|
62
|
+
|
63
|
+
def int16be(int16)
|
64
|
+
[int16].pack('N').unpack('C4')
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,224 @@
|
|
1
|
+
<Obj RefId="0">
|
2
|
+
<MS>
|
3
|
+
<I32 N="MinRunspaces">1</I32>
|
4
|
+
<I32 N="MaxRunspaces">1</I32>
|
5
|
+
<Obj N="PSThreadOptions" RefId="1">
|
6
|
+
<TN RefId="0">
|
7
|
+
<T>System.Management.Automation.Runspaces.PSThreadOptions</T>
|
8
|
+
<T>System.Enum</T>
|
9
|
+
<T>System.ValueType</T>
|
10
|
+
<T>System.Object</T>
|
11
|
+
</TN>
|
12
|
+
<ToString>Default</ToString>
|
13
|
+
<I32>0</I32>
|
14
|
+
</Obj>
|
15
|
+
<Obj N="ApartmentState" RefId="2">
|
16
|
+
<TN RefId="1">
|
17
|
+
<T>System.Threading.ApartmentState</T>
|
18
|
+
<T>System.Enum</T>
|
19
|
+
<T>System.ValueType</T>
|
20
|
+
<T>System.Object</T>
|
21
|
+
</TN>
|
22
|
+
<ToString>Unknown</ToString>
|
23
|
+
<I32>2</I32>
|
24
|
+
</Obj>
|
25
|
+
<Obj N="ApplicationArguments" RefId="3">
|
26
|
+
<TN RefId="2">
|
27
|
+
<T>System.Management.Automation.PSPrimitiveDictionary</T>
|
28
|
+
<T>System.Collections.Hashtable</T>
|
29
|
+
<T>System.Object</T>
|
30
|
+
</TN>
|
31
|
+
<DCT>
|
32
|
+
<En>
|
33
|
+
<S N="Key">PSVersionTable</S>
|
34
|
+
<Obj N="Value" RefId="4">
|
35
|
+
<TNRef RefId="2" />
|
36
|
+
<DCT>
|
37
|
+
<En>
|
38
|
+
<S N="Key">PSVersion</S>
|
39
|
+
<Version N="Value">5.0.11082.1000</Version>
|
40
|
+
</En>
|
41
|
+
<En>
|
42
|
+
<S N="Key">PSCompatibleVersions</S>
|
43
|
+
<Obj N="Value" RefId="5">
|
44
|
+
<TN RefId="3">
|
45
|
+
<T>System.Version[]</T>
|
46
|
+
<T>System.Array</T>
|
47
|
+
<T>System.Object</T>
|
48
|
+
</TN>
|
49
|
+
<LST>
|
50
|
+
<Version>1.0</Version>
|
51
|
+
<Version>2.0</Version>
|
52
|
+
<Version>3.0</Version>
|
53
|
+
<Version>4.0</Version>
|
54
|
+
<Version>5.0.11082.1000</Version>
|
55
|
+
</LST>
|
56
|
+
</Obj>
|
57
|
+
</En>
|
58
|
+
<En>
|
59
|
+
<S N="Key">CLRVersion</S>
|
60
|
+
<Version N="Value">4.0.30319.42000</Version>
|
61
|
+
</En>
|
62
|
+
<En>
|
63
|
+
<S N="Key">BuildVersion</S>
|
64
|
+
<Version N="Value">10.0.11082.1000</Version>
|
65
|
+
</En>
|
66
|
+
<En>
|
67
|
+
<S N="Key">WSManStackVersion</S>
|
68
|
+
<Version N="Value">3.0</Version>
|
69
|
+
</En>
|
70
|
+
<En>
|
71
|
+
<S N="Key">PSRemotingProtocolVersion</S>
|
72
|
+
<Version N="Value">2.3</Version>
|
73
|
+
</En>
|
74
|
+
<En>
|
75
|
+
<S N="Key">SerializationVersion</S>
|
76
|
+
<Version N="Value">1.1.0.1</Version>
|
77
|
+
</En>
|
78
|
+
</DCT>
|
79
|
+
</Obj>
|
80
|
+
</En>
|
81
|
+
</DCT>
|
82
|
+
</Obj>
|
83
|
+
<Obj N="HostInfo" RefId="6">
|
84
|
+
<MS>
|
85
|
+
<Obj N="_hostDefaultData" RefId="7">
|
86
|
+
<MS>
|
87
|
+
<Obj N="data" RefId="8">
|
88
|
+
<TN RefId="4">
|
89
|
+
<T>System.Collections.Hashtable</T>
|
90
|
+
<T>System.Object</T>
|
91
|
+
</TN>
|
92
|
+
<DCT>
|
93
|
+
<En>
|
94
|
+
<I32 N="Key">9</I32>
|
95
|
+
<Obj N="Value" RefId="9">
|
96
|
+
<MS>
|
97
|
+
<S N="T">System.String</S>
|
98
|
+
<S N="V">C:\dev\kitchen-vagrant</S>
|
99
|
+
</MS>
|
100
|
+
</Obj>
|
101
|
+
</En>
|
102
|
+
<En>
|
103
|
+
<I32 N="Key">8</I32>
|
104
|
+
<Obj N="Value" RefId="10">
|
105
|
+
<MS>
|
106
|
+
<S N="T">System.Management.Automation.Host.Size</S>
|
107
|
+
<Obj N="V" RefId="11">
|
108
|
+
<MS>
|
109
|
+
<I32 N="width">199</I32>
|
110
|
+
<I32 N="height">52</I32>
|
111
|
+
</MS>
|
112
|
+
</Obj>
|
113
|
+
</MS>
|
114
|
+
</Obj>
|
115
|
+
</En>
|
116
|
+
<En>
|
117
|
+
<I32 N="Key">7</I32>
|
118
|
+
<Obj N="Value" RefId="12">
|
119
|
+
<MS>
|
120
|
+
<S N="T">System.Management.Automation.Host.Size</S>
|
121
|
+
<Obj N="V" RefId="13">
|
122
|
+
<MS>
|
123
|
+
<I32 N="width">80</I32>
|
124
|
+
<I32 N="height">52</I32>
|
125
|
+
</MS>
|
126
|
+
</Obj>
|
127
|
+
</MS>
|
128
|
+
</Obj>
|
129
|
+
</En>
|
130
|
+
<En>
|
131
|
+
<I32 N="Key">6</I32>
|
132
|
+
<Obj N="Value" RefId="14">
|
133
|
+
<MS>
|
134
|
+
<S N="T">System.Management.Automation.Host.Size</S>
|
135
|
+
<Obj N="V" RefId="15">
|
136
|
+
<MS>
|
137
|
+
<I32 N="width">80</I32>
|
138
|
+
<I32 N="height">25</I32>
|
139
|
+
</MS>
|
140
|
+
</Obj>
|
141
|
+
</MS>
|
142
|
+
</Obj>
|
143
|
+
</En>
|
144
|
+
<En>
|
145
|
+
<I32 N="Key">5</I32>
|
146
|
+
<Obj N="Value" RefId="16">
|
147
|
+
<MS>
|
148
|
+
<S N="T">System.Management.Automation.Host.Size</S>
|
149
|
+
<Obj N="V" RefId="17">
|
150
|
+
<MS>
|
151
|
+
<I32 N="width">250</I32>
|
152
|
+
<I32 N="height">9999</I32>
|
153
|
+
</MS>
|
154
|
+
</Obj>
|
155
|
+
</MS>
|
156
|
+
</Obj>
|
157
|
+
</En>
|
158
|
+
<En>
|
159
|
+
<I32 N="Key">4</I32>
|
160
|
+
<Obj N="Value" RefId="18">
|
161
|
+
<MS>
|
162
|
+
<S N="T">System.Int32</S>
|
163
|
+
<I32 N="V">25</I32>
|
164
|
+
</MS>
|
165
|
+
</Obj>
|
166
|
+
</En>
|
167
|
+
<En>
|
168
|
+
<I32 N="Key">3</I32>
|
169
|
+
<Obj N="Value" RefId="19">
|
170
|
+
<MS>
|
171
|
+
<S N="T">System.Management.Automation.Host.Coordinates</S>
|
172
|
+
<Obj N="V" RefId="20">
|
173
|
+
<MS>
|
174
|
+
<I32 N="x">0</I32>
|
175
|
+
<I32 N="y">9974</I32>
|
176
|
+
</MS>
|
177
|
+
</Obj>
|
178
|
+
</MS>
|
179
|
+
</Obj>
|
180
|
+
</En>
|
181
|
+
<En>
|
182
|
+
<I32 N="Key">2</I32>
|
183
|
+
<Obj N="Value" RefId="21">
|
184
|
+
<MS>
|
185
|
+
<S N="T">System.Management.Automation.Host.Coordinates</S>
|
186
|
+
<Obj N="V" RefId="22">
|
187
|
+
<MS>
|
188
|
+
<I32 N="x">0</I32>
|
189
|
+
<I32 N="y">9998</I32>
|
190
|
+
</MS>
|
191
|
+
</Obj>
|
192
|
+
</MS>
|
193
|
+
</Obj>
|
194
|
+
</En>
|
195
|
+
<En>
|
196
|
+
<I32 N="Key">1</I32>
|
197
|
+
<Obj N="Value" RefId="23">
|
198
|
+
<MS>
|
199
|
+
<S N="T">System.ConsoleColor</S>
|
200
|
+
<I32 N="V">0</I32>
|
201
|
+
</MS>
|
202
|
+
</Obj>
|
203
|
+
</En>
|
204
|
+
<En>
|
205
|
+
<I32 N="Key">0</I32>
|
206
|
+
<Obj N="Value" RefId="24">
|
207
|
+
<MS>
|
208
|
+
<S N="T">System.ConsoleColor</S>
|
209
|
+
<I32 N="V">7</I32>
|
210
|
+
</MS>
|
211
|
+
</Obj>
|
212
|
+
</En>
|
213
|
+
</DCT>
|
214
|
+
</Obj>
|
215
|
+
</MS>
|
216
|
+
</Obj>
|
217
|
+
<B N="_isHostNull">false</B>
|
218
|
+
<B N="_isHostUINull">false</B>
|
219
|
+
<B N="_isHostRawUINull">false</B>
|
220
|
+
<B N="_useRunspaceHost">false</B>
|
221
|
+
</MS>
|
222
|
+
</Obj>
|
223
|
+
</MS>
|
224
|
+
</Obj>
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# Copyright 2015 Matt Wrock <matt@mattwrock.com>
|
2
|
+
# Copyright 2016 Shawn Neal <sneal@sneal.net>
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the 'License');
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an 'AS IS' BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
require_relative 'uuid'
|
17
|
+
require_relative 'message_data'
|
18
|
+
|
19
|
+
module WinRM
|
20
|
+
# PowerShell Remoting Protcol module
|
21
|
+
module PSRP
|
22
|
+
# PowerShell Remoting Protocol base message.
|
23
|
+
# http://download.microsoft.com/download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/%5BMS-PSRP%5D.pdf
|
24
|
+
class Message
|
25
|
+
include UUID
|
26
|
+
|
27
|
+
# Value of message destination when sent to a client
|
28
|
+
CLIENT_DESTINATION = 1
|
29
|
+
|
30
|
+
# Value of message destination when sent to a server
|
31
|
+
SERVER_DESTINATION = 2
|
32
|
+
|
33
|
+
# All known PSRP message types
|
34
|
+
MESSAGE_TYPES = {
|
35
|
+
session_capability: 0x00010002,
|
36
|
+
init_runspacepool: 0x00010004,
|
37
|
+
public_key: 0x00010005,
|
38
|
+
encrypted_session_key: 0x00010006,
|
39
|
+
public_key_request: 0x00010007,
|
40
|
+
connect_runspacepool: 0x00010008,
|
41
|
+
runspace_init_data: 0x0002100b,
|
42
|
+
reset_runspace_state: 0x0002100c,
|
43
|
+
set_max_runspaces: 0x00021002,
|
44
|
+
set_min_runspaces: 0x00021003,
|
45
|
+
runspace_availability: 0x00021004,
|
46
|
+
runspacepool_state: 0x00021005,
|
47
|
+
create_pipeline: 0x00021006,
|
48
|
+
get_available_runspaces: 0x00021007,
|
49
|
+
user_event: 0x00021008,
|
50
|
+
application_private_data: 0x00021009,
|
51
|
+
get_command_metadata: 0x0002100a,
|
52
|
+
runspacepool_host_call: 0x00021100,
|
53
|
+
runspacepool_host_response: 0x00021101,
|
54
|
+
pipeline_input: 0x00041002,
|
55
|
+
end_of_pipeline_input: 0x00041003,
|
56
|
+
pipeline_output: 0x00041004,
|
57
|
+
error_record: 0x00041005,
|
58
|
+
pipeline_state: 0x00041006,
|
59
|
+
debug_record: 0x00041007,
|
60
|
+
verbose_record: 0x00041008,
|
61
|
+
warning_record: 0x00041009,
|
62
|
+
progress_record: 0x00041010,
|
63
|
+
information_record: 0x00041011,
|
64
|
+
pipeline_host_call: 0x00041100,
|
65
|
+
pipeline_host_response: 0x00041101
|
66
|
+
}.freeze
|
67
|
+
|
68
|
+
# Creates a new PSRP message instance
|
69
|
+
# @param runspace_pool_id [String] The UUID of the remote shell/runspace pool.
|
70
|
+
# @param pipeline_id [String] The UUID to correlate the command/pipeline response
|
71
|
+
# @param type [Integer] The PSRP MessageType. This is most commonly
|
72
|
+
# specified in hex, e.g. 0x00010002.
|
73
|
+
# @param data [String] The PSRP payload as serialized XML
|
74
|
+
# @param destination [Integer] The destination for this message - client or server
|
75
|
+
def initialize(
|
76
|
+
runspace_pool_id,
|
77
|
+
type,
|
78
|
+
data,
|
79
|
+
pipeline_id = nil,
|
80
|
+
destination = SERVER_DESTINATION
|
81
|
+
)
|
82
|
+
raise 'invalid message type' unless MESSAGE_TYPES.value?(type)
|
83
|
+
|
84
|
+
@data = data
|
85
|
+
@destination = destination
|
86
|
+
@type = type
|
87
|
+
@pipeline_id = pipeline_id
|
88
|
+
@runspace_pool_id = runspace_pool_id
|
89
|
+
end
|
90
|
+
|
91
|
+
attr_reader :destination, :type, :runspace_pool_id, :pipeline_id, :data
|
92
|
+
|
93
|
+
# Returns the raw PSRP message bytes ready for transfer to Windows inside a
|
94
|
+
# WinRM message.
|
95
|
+
# @return [Array<Byte>] Unencoded raw byte array of the PSRP message.
|
96
|
+
def bytes
|
97
|
+
[
|
98
|
+
int16le(destination),
|
99
|
+
int16le(type),
|
100
|
+
uuid_to_windows_guid_bytes(runspace_pool_id),
|
101
|
+
uuid_to_windows_guid_bytes(pipeline_id),
|
102
|
+
byte_order_mark,
|
103
|
+
data_bytes
|
104
|
+
].flatten
|
105
|
+
end
|
106
|
+
|
107
|
+
# Parses the raw data to a MessageData class
|
108
|
+
# @return [MessageData::Base] MessageData corresponding to this message type
|
109
|
+
def parsed_data
|
110
|
+
@parsed_data ||= MessageData.parse(self)
|
111
|
+
end
|
112
|
+
|
113
|
+
private
|
114
|
+
|
115
|
+
def byte_order_mark
|
116
|
+
[239, 187, 191]
|
117
|
+
end
|
118
|
+
|
119
|
+
def data_bytes
|
120
|
+
@data_bytes ||= data.force_encoding('utf-8').bytes
|
121
|
+
end
|
122
|
+
|
123
|
+
def int16le(int16)
|
124
|
+
[int16].pack('N').unpack('C4').reverse
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# Copyright 2016 Matt Wrock <matt@mattwrock.com>
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the 'License');
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an 'AS IS' BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'nori'
|
16
|
+
|
17
|
+
module WinRM
|
18
|
+
# PowerShell Remoting Protcol module
|
19
|
+
module PSRP
|
20
|
+
# PowerShell Remoting Protocol message data.
|
21
|
+
module MessageData
|
22
|
+
# base class for message data
|
23
|
+
class Base
|
24
|
+
def initialize(data)
|
25
|
+
@raw = data
|
26
|
+
end
|
27
|
+
|
28
|
+
# @return [String] raw message data
|
29
|
+
attr_reader :raw
|
30
|
+
|
31
|
+
protected
|
32
|
+
|
33
|
+
def clixml
|
34
|
+
@clixml ||= begin
|
35
|
+
parser = Nori.new(
|
36
|
+
parser: :rexml,
|
37
|
+
advanced_typecasting: false,
|
38
|
+
convert_tags_to: ->(tag) { tag.snakecase.to_sym },
|
39
|
+
strip_namespaces: true
|
40
|
+
)
|
41
|
+
parser.parse(raw)[:obj][:ms]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|