As a bit of a challenge i was looking for the correct powershell code to eject a USB device.
Well this is it assuming your volume label is UUI
Powershell
$vol=get-wmiobject-ClassWin32_Volume|where{$_.label-eq'UUI'}$Eject=New-Object-comObjectShell.Application$Eject.NameSpace(17).ParseName($vol.driveletter).InvokeVerb(“Eject”)
If you google "eject usb device from powershell" you get to a topic on Spiceworks that talks about this but all that code actually do is to unassign the drive letter from the USB device so it doesn't really eject the device. This code does it. Just posted it here as i haven't yet figured out how to post a "How-To"