plugins/guests/windows/guest_network.rb in vagrant-unbundled-2.0.0.1 vs plugins/guests/windows/guest_network.rb in vagrant-unbundled-2.0.1.0
- old
+ new
@@ -62,11 +62,11 @@
# to allow guest access from the host via a private IP on Win7
# https://github.com/WinRb/vagrant-windows/issues/63
def set_all_networks_to_work
@logger.info("Setting all networks to 'Work Network'")
command = File.read(File.expand_path("../scripts/set_work_network.ps1", __FILE__))
- @communicator.execute(command)
+ @communicator.execute(command, { shell: :powershell })
end
protected
# Checks the WinRS version on the guest. Usually 2 on Windows 7/2008
@@ -74,11 +74,11 @@
#
# @return [Integer]
def wsman_version
@logger.debug("querying WSMan version")
version = ''
- @communicator.execute(PS_GET_WSMAN_VER) do |type, line|
+ @communicator.execute(PS_GET_WSMAN_VER, { shell: :powershell }) do |type, line|
version = version + "#{line}" if type == :stdout && !line.nil?
end
@logger.debug("wsman version: #{version}")
Integer(version)
end
@@ -106,10 +106,10 @@
#
# @return [Array]
def network_adapters_v3_winrm
command = File.read(File.expand_path("../scripts/winrs_v3_get_adapters.ps1", __FILE__))
output = ""
- @communicator.execute(command) do |type, line|
+ @communicator.execute(command, { shell: :powershell }) do |type, line|
output = output + "#{line}" if type == :stdout && !line.nil?
end
adapters = []
JSON.parse(output).each do |nic|