diff --git a/Get-PC/Private/Get-Devices.ps1 b/Get-PC/Private/Get-Devices.ps1 index ff208ec..d02bd2d 100644 --- a/Get-PC/Private/Get-Devices.ps1 +++ b/Get-PC/Private/Get-Devices.ps1 @@ -301,11 +301,13 @@ function FindUSBDevice { foreach ($line in $usbIDs) { # Skip comments if ($line -match "^#") { continue } + # Tab followed by 4 hex characters identify a device, regex to match this if ($line -match "^[\t]([0-9a-f]{4})\s+([^#]+)") { $usbIDTable[$vid]['Devices'][$Matches[1]] = $Matches[2] continue # If line doesn't match device id definition, see if it's a vendor definition } else { + # Same regex as device id but no tab (or other whitespace) at the beginning of line if (-not ($line -match "^([0-9a-f]{4})\s+([^#]+)")) { continue } $usbIDTable[$Matches[1]] = @{ Name = $Matches[2] diff --git a/Get-PC/Private/Get-DevicesUnplugged.ps1 b/Get-PC/Private/Get-DevicesUnplugged.ps1 index 5f097d7..efe6850 100644 --- a/Get-PC/Private/Get-DevicesUnplugged.ps1 +++ b/Get-PC/Private/Get-DevicesUnplugged.ps1 @@ -33,14 +33,7 @@ function Get-DevicesUnplugged { } } Write-Progress -Activity "Getting devices for $name" -Status 'Sorting out duplicate devices' -PercentComplete 90 -ParentId 1 - $usb = $usb | Sort-Object Manufacturer,Description - for ($i = 0; $i -lt $usb.Count - 1; $i++) { - if($usb[$i].Manufacturer -eq $usb[$i+1].Manufacturer -and $usb[$i].Description -eq $usb[$i+1].Description){ - $usb[$i].Manufacturer = '__DUPE__' - } - } - $usb = $usb | Where-Object -Property Manufacturer -NE '__DUPE__' - $usb = $usb | Sort-Object Type + $usb = $usb | Sort-Object Manufacturer,Description -Unique | Sort-Object Type $out = @() diff --git a/Get-PC/Private/Update-GetPC.ps1 b/Get-PC/Private/Update-GetPC.ps1 index 4a06cf6..5431a76 100644 --- a/Get-PC/Private/Update-GetPC.ps1 +++ b/Get-PC/Private/Update-GetPC.ps1 @@ -11,7 +11,7 @@ function Update-GetPC { $desinationPath = ($env:PSModulePath -split ';')[0] + "\Get-PC" Write-Host "Updating Get-PC..." - Robocopy.exe $GetPCSourcePath $desinationPath /mir | Out-Null + Robocopy.exe $GetPCSourcePath $desinationPath /mir if($LASTEXITCODE -gt 7){ Write-Warning 'An error has occured during update. Please restart powershell and try again' diff --git a/Get-PC/get-pc_logo_512.ico b/Get-PC/get-pc_logo_512.ico new file mode 100644 index 0000000..e3f3253 Binary files /dev/null and b/Get-PC/get-pc_logo_512.ico differ