Comments and icon

This commit is contained in:
Zachary Gorman 2025-02-21 13:44:53 -08:00
parent 78f7abf82a
commit 0b8fdea45a
4 changed files with 4 additions and 9 deletions

View file

@ -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]

View file

@ -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 = @()

View file

@ -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'

BIN
Get-PC/get-pc_logo_512.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB