VMware Cloud Community
jdvcp
Enthusiast
Enthusiast

How to query a VM working directory

I am trying to determine the working directory for all of my VMs. I have been experiencing issues where if the working directory is not "." (same path as vmx), we experience snapshot issues. Then, I'd like to update the workingdir value to "." for such vmx's. I can set this value by retrofitting some other scripts I have seen here which work with other vmx file settings, so this is not as important. thx!

Reply
0 Kudos
3 Replies
SCampbell1
Enthusiast
Enthusiast

This returns all the files and directories associated with a VM (vmx, snapshot, suspend and log)

$VMPaths=(Get-VM -name "Server1" | Get-View).Config.Files $VMPaths.SnapshotDirectory

Reply
0 Kudos
jdvcp
Enthusiast
Enthusiast

I'm trying to find the working directory from the vmx (listed as workingDir in the vmx). this gets only snapshot and suspend directory.

thx

Reply
0 Kudos
SCampbell1
Enthusiast
Enthusiast

Check out Carter Shanklin's http://www.codeplex.com/vitoolkitextensions for some cmdlets to download and change settings in vmx files.

Reply
0 Kudos