Skip to content

Commit 8e6d7f5

Browse files
author
jsmyth
committed
fixed synced folders to work with WinRM communicator
1 parent d25b672 commit 8e6d7f5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/vSphere/action/sync_folders.rb

+7-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ def call(env)
4747
:guestpath => guestpath))
4848

4949
# Create the guest path
50-
env[:machine].communicate.sudo("mkdir -p '#{guestpath}'")
51-
env[:machine].communicate.sudo("chown #{ssh_info[:username]} '#{guestpath}'")
50+
if env[:machine].communicate.class.to_s =~ /WinRM/
51+
env[:machine].communicate.execute("New-Item '#{guestpath}' -type directory -force")
52+
53+
else
54+
env[:machine].communicate.sudo("mkdir -p '#{guestpath}'")
55+
env[:machine].communicate.sudo("chown #{ssh_info[:username]} '#{guestpath}'")
56+
end
5257

5358
# Rsync over to the guest path using the SSH info
5459
command = [

0 commit comments

Comments
 (0)