Hi,
I have read some post to retrieve a vmx.
After analyse the thread I write the powershell script bellow to restrieve the esxhostname automatically with get-vmhost cmdlet :
But the tar archieve is corrupted. I think I've a bad command line.
But if I launch without powershell (for example in MS-DOS cmd windows) :
It's work fine : the tar archive is good !
Could you Help me ?
Thanks in advance for your reply.
Regards.
I have read some post to retrieve a vmx.
After analyse the thread I write the powershell script bellow to restrieve the esxhostname automatically with get-vmhost cmdlet :
| get-vmhost | sort-object -unique | ForEach-Object -process { & "C:\Program Files\Putty\plink.exe" -ssh -pw mypassword myaccount@$_ "find /vmfs/volumes/ -name "*.vmx" -print0 | xargs -0 tar -cf-" > c:\$_-vmxbackups.tar } |
But the tar archieve is corrupted. I think I've a bad command line.
But if I launch without powershell (for example in MS-DOS cmd windows) :
| C:\Program Files\PuTTY>plink -ssh -pw xxx myaccount@myesxhostname "find /vmfs/volumes/ -name *.vmx -print0 | xargs -0 tar -cf -" > c:\myservername_vmxbackups.tar |
It's work fine : the tar archive is good !
Could you Help me ?
Thanks in advance for your reply.
Regards.