Create Windows bootable USB with macOS

If you need to create a Windows 10 installation USB key using a macOS, you can use these commands to do it simply.
This procedure deletes all data from the USB stick, so be careful 🙂

Open Terminal and use the following commands

diskutil list
diskutil eraseDisk MS-DOS "WIN10" GPT <USB disk>
hdiutil mount <path to the Windows 10 ISO file>
cp -rp /Volumes/<ISO mounting point> /Volumes/WIN10
hdiutil unmount /Volumes/<ISO mounting point>
hdiutil unmount /Volumes/WIN10