Check 4k partition alignment

(imported topic written by SystemAdmin)

4k partition alignment is important for maximizing performance & life of an SSD. It can also benefit some new very large disks that use 4k sectors. I am using the following to check 4k alignment of all partitions of a machine, but the issue is, that I may not care about all partitions if a computer has both an SSD and a traditional Hard Drive, or perhaps a USB disk attached. I only care about 4k alignment of internal SSD disks. Anyone have any ideas on how to achieve this?

Are Partitions 4k aligned?

not disjunction of ((following text of first 
"=" of (property 
"StartingOffset" of it as string) as integer mod 4096) != 0) of select objects 
"* from Win32_DiskPartition" of wmi