Highlighted
Enthusiast
Enthusiast

VM last Modified date

Jump to solution

HI gurus

I have a old datastore that has a bunch of file in it, some of this file left behind are  no longer related to the vm , so I would like to run a PSCli script if possible that will go on this datastore and get the vmdk last modified date, is this possible ??

thanks a bunch gurus

0 Kudos
1 Solution

Accepted Solutions
Highlighted
User Moderator
User Moderator

You could do something like this

$dsName = 'datastore'

$ds = Get-Datastore -Name $dsName

New-PSDrive -Location $ds -Name DS -PSProvider VimDatastore -Root '\' | Out-Null

Get-ChildItem -Path "DS:" -Recurse | select -Property DatastoreFullPath,LastWriteTime

Remove-PSDrive -Name DS -Confirm:$false


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

View solution in original post

0 Kudos
1 Reply
Highlighted
User Moderator
User Moderator

You could do something like this

$dsName = 'datastore'

$ds = Get-Datastore -Name $dsName

New-PSDrive -Location $ds -Name DS -PSProvider VimDatastore -Root '\' | Out-Null

Get-ChildItem -Path "DS:" -Recurse | select -Property DatastoreFullPath,LastWriteTime

Remove-PSDrive -Name DS -Confirm:$false


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

View solution in original post

0 Kudos