Skip to content

Instantly share code, notes, and snippets.

@JamesHabben
Last active February 8, 2019 15:47
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save JamesHabben/da47363ffa70a5b4bec07777dedc87da to your computer and use it in GitHub Desktop.
Save JamesHabben/da47363ffa70a5b4bec07777dedc87da to your computer and use it in GitHub Desktop.
"Written by James Habben (@JamesHabben)"
"Last Updated: 2016-10-18"
""
""
"Start with device not inserted. Remove it now if it is in already."
read-host "press enter to continue"
$devices1 = Get-WmiObject Win32_PNPEntity
" Total devices before: {0}" -f $devices1.count
read-host "Insert device now, wait for devices to be installed, and then press enter"
$devices2 = Get-WmiObject Win32_PNPEntity
" Total devices after: {0}" -f $devices2.count
$diff = compare-object $devices1 $devices2
"==== Diff List ===="
$diff | format-list
"==== /Diff List ===="
"==== Long List ===="
foreach ($dev in $diff) {
$dev.inputobject
"---- ---- ----"
}
"==== /Long List ===="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment