I have this script of power cli getting the required results of vmware.log file last modified time to know the last VM used date & time.
Script:
$dsName = 'datastore1 (1.105)'
$ds = Get-Datastore -Name $dsName
New-PSDrive -Location $ds -Name DS -PSProvider VimDatastore -Root '\' | Out-Null
Get-ChildItem -Path "DS:" -Filter vmware.log -Recurse | select -Property DatastoreFullPath,LastWriteTime | Export-Csv D:\Result1.csv -NoTypeInformation
Remove-PSDrive -Name DS -Confirm:$false
My Requirement:
Please help me out to get VM name also, I want to get also VMs detalis such as VM full name, Specs etc using Get-VM, any way to get results Get-VM and Get-ChildItem results combine and export in single CSV file such as VM name and details and respectively get vmware.log last modified date from internal data store as working in the above mentioned script.
As your post needs moving to the area for PowerCLI, I have reported it to the volunteer moderators.
Duplicate of Solved: Re: VM last Modified date - VMware Technology Network VMTN
Please don't cross-post
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference