function Get-DatastoresWithStartSector ($StartSector) {
    
    $customResults = @()
    $datastores = @()
    
    #search through all hosts for datastores with a start sector value of $StartSector
    Get-VMHost | % {
        
        try {
            $esxcli = Get-EsxCli -VMHost $_ -ErrorAction Stop
        
            $foundDevices = $esxcli.storage.core.device.partition.list() | ?{ $_.StartSector -eq $StartSector }
            
            foreach ($device in $foundDevices) {
                $customResults += New-Object PSObject -Property @{
                    NAA = $device.Device
                    VMHost = $_
                }
            }
        }
        catch {
            Write-Host "Get-EsxCli error on host" -ForegroundColor Magenta
            Write-Host "$_" -ForegroundColor Magenta
        }
    }
    
    #remove duplicates from the list gathered above and match the datastore name to device number
    foreach ( $custom in ($customResults | Sort NAA -Unique) ) {
        $datastores += Get-Datastore -VMHost $custom.VMHost | ?{$_.ExtensionData.Info.Vmfs.Extent.diskname -eq $custom.NAA}
    }
    
    return $datastores | Sort Name
}

#EXAMPLE: get all datastores with old start sector that are at VMFS version 5
#Get-DatastoresWithStartSector 128 | ?{$_.ExtensionData.Info.vmfs.MajorVersion -ne 5}