Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 232319

Re: PowerCLI script for delete vmware-*.logs file

$
0
0

Try like this

 

foreach($vminGet-VM){

    $vmxPath=$vm.ExtensionData.Config.Files.VmPathName

    $ds=Get-Datastore-Name$vmxPath.Split(']')[0].TrimStart('[')

    New-PSDrive-NameDS-PSProviderVimDatastore-Root'\'-Location$ds>$null

    Get-ChildItem-Path"DS:/$($vm.Name)/vmware*.log"|Remove-Item-Confirm:$false

    Remove-PSDrive-NameDS-Confirm:$false

}


Viewing all articles
Browse latest Browse all 232319

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>