This script works for formatting drives so that they are recognized in windows.
You need exfat-utils for this to work.
Exfat-utils can be installed with
On Arch based distros
yay -S exfat-utils
On Debian based distros
sudo apt install exfatprogs