VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Unable to get free space on Unix VMs

Hi,

Please help, I am unable to get free space on Unix VMs for "/" partition

Below is my script

$VmInfo | where{$_.'MountPoint' -Match '^C:\\|^/' -and $_.'FreeSpace(%)' -le 20 -and $_.'VM PowerState' -eq 'PoweredOn' -and $_.'Folder' -Match '^Corporate|^Management-Servers'} | sort-object 'FreeSpace(%)'

I am able to see C: but for / it is listing all the drives like /opt, /boot etc but I want only for / partition

Please help.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try to change that RegEx expression to

where{$_.MountPoint -Match "(^C:\\|^/$)"


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Try to change that RegEx expression to

where{$_.MountPoint -Match "(^C:\\|^/$)"


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Thank you very much Smiley Happy

0 Kudos