-
-
Save Diom/79e7f27aa0ee32ae7aa146d26968487f to your computer and use it in GitHub Desktop.
Powershell VBoxManage List USBHost Covert To Object Array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$allUsbDevs = vboxmanage list usbhost | Out-String | %{$_ -replace ':','=' } | %{$_ -split '(?=UUID)'} | ConvertFrom-StringData | where{ $_.UUID -ne $null } | |
$uuidToUse = vboxmanage list usbhost | Out-String | %{$_ -replace ':','=' } | %{$_ -split '(?=UUID)'} | ConvertFrom-StringData | where{ $_.Product -eq "USB DISK 2.0"} | %{$_.UUID} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to automate USB device attachments to a VirtualBox machine? Need to find the correct UUID for a device?
This gist converts the output of
vboxmanage list usbhost
into an array of objects. These can then be filtered by their properties, to exclude items which are already "captured" and to pick a device by name or manufacturer.