Get the maximum networking packet size on windows

Sometimes it is needed to find out the maximal packet size on a windows network.
ping (-4 or -6 to force ipv4 or ipv6) -f -l size

for example:
ping -4 -w 1000 -n 1 -f -l 1472
1472 was the biggest for my connection, before it had to fragment the packet.
This depends on network settings and networking technology and should be tested down from 1500 – 0 until one ping reaches the target.