Try like this.
It will disable stats collection for all shared datastores.
$si = Get-View ServiceInstance
$storMgr = Get-View -Id $si.Content.StorageResourceManager
$spec = New-Object VMware.Vim.StorageIORMConfigSpec
$spec.Enabled = $false
$spec.StatsAggregationDisabled = $true
$spec.StatsCollectionEnabled = $false
foreach($ds in (Get-View -ViewType Datastore -Filter @{'Summary.MultipleHostAccess'='True'})){
Write-Output "Configuring datastore $($ds.Name)"
$storMgr.ConfigureDatastoreIORM($ds.MoRef,$spec)
}