Hi,
I've written the script below to format any USB drives attached to a system.
Get-Disk |
Where bustype -eq 'usb' |
Clear-Disk -RemoveData -PassThru -Confirm:$false |
New-Partition -AssignDriveLetter -Alignment 4194304 -UseMaximumSize |
Format-Volume -FileSystem exFAT -NewFileSystemLabel myUSB
When I ran this on a Windows 10 Pro system, it caused the USB port that the drive was connected to to become unresponsive to any device. The drive was also not formatted.
The port became operational again after a reboot.
I then ran the script with the same drive in the same port successfully.
Any ideas what might be happening?