VMware Cloud Community
AllanChristians
Enthusiast
Enthusiast

Get-datatastore refresh

Hi,

If i do a get datastore and check $_.freespacemb. then i move a vm from datastore1 to datastore2 and then check $_.frespacemb again nothing changed.

How can i get the updated information?

/Allan

/Allan http://doitsmarter.blogspot.com
0 Kudos
1 Reply
harkamal
Expert
Expert

You can use UpdateViewData() method to refresh view of a managed entity. Post refresh re-calculate your values.

Example

$myDS = Get-DataStore "DS1" | Get-View

$myDS.UpdateViewData()

Hope that answers the question.

0 Kudos