trying to get an automated way to patch linux guests
$cmd1 = get-vm testlinux | Mount-Tools
start-sleep 5
$script1 = "mkdir -p /mnt/cdrom && mount /dev/cdrom /mnt/cdrom && cp -f /mnt/cdrom/*.gz /tmp && tar -xzvf /tmp/*.gz -C /tmp/"
$script2 = "cd /tmp/vmware-tools-distrib && ./vmware-install-pl -d default"
$cmd2 = invoke-vmscript -VM testlinux -ScriptText $script1 -Guestuser "root" -GuestPassword "xxxxxxx"
start-sleep 10
$cmd3 = invoke-vmscript -VM testlinux -ScriptText $script2 -Guestuser "root" -GuestPassword "xxxxxxx"
I can get $script1 working but not $script2. I tried combining them and tools do not get installed.
however after $script1 runs. If I run $script2 manually. it works fine
even though i get this error
any idea?