Comments and icon
This commit is contained in:
parent
78f7abf82a
commit
0b8fdea45a
|
|
@ -301,11 +301,13 @@ function FindUSBDevice {
|
||||||
foreach ($line in $usbIDs) {
|
foreach ($line in $usbIDs) {
|
||||||
# Skip comments
|
# Skip comments
|
||||||
if ($line -match "^#") { continue }
|
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+([^#]+)") {
|
if ($line -match "^[\t]([0-9a-f]{4})\s+([^#]+)") {
|
||||||
$usbIDTable[$vid]['Devices'][$Matches[1]] = $Matches[2]
|
$usbIDTable[$vid]['Devices'][$Matches[1]] = $Matches[2]
|
||||||
continue
|
continue
|
||||||
# If line doesn't match device id definition, see if it's a vendor definition
|
# If line doesn't match device id definition, see if it's a vendor definition
|
||||||
} else {
|
} 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 }
|
if (-not ($line -match "^([0-9a-f]{4})\s+([^#]+)")) { continue }
|
||||||
$usbIDTable[$Matches[1]] = @{
|
$usbIDTable[$Matches[1]] = @{
|
||||||
Name = $Matches[2]
|
Name = $Matches[2]
|
||||||
|
|
|
||||||
|
|
@ -33,14 +33,7 @@ function Get-DevicesUnplugged {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Write-Progress -Activity "Getting devices for $name" -Status 'Sorting out duplicate devices' -PercentComplete 90 -ParentId 1
|
Write-Progress -Activity "Getting devices for $name" -Status 'Sorting out duplicate devices' -PercentComplete 90 -ParentId 1
|
||||||
$usb = $usb | Sort-Object Manufacturer,Description
|
$usb = $usb | Sort-Object Manufacturer,Description -Unique | Sort-Object Type
|
||||||
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
|
|
||||||
|
|
||||||
$out = @()
|
$out = @()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ function Update-GetPC {
|
||||||
$desinationPath = ($env:PSModulePath -split ';')[0] + "\Get-PC"
|
$desinationPath = ($env:PSModulePath -split ';')[0] + "\Get-PC"
|
||||||
|
|
||||||
Write-Host "Updating Get-PC..."
|
Write-Host "Updating Get-PC..."
|
||||||
Robocopy.exe $GetPCSourcePath $desinationPath /mir | Out-Null
|
Robocopy.exe $GetPCSourcePath $desinationPath /mir
|
||||||
|
|
||||||
if($LASTEXITCODE -gt 7){
|
if($LASTEXITCODE -gt 7){
|
||||||
Write-Warning 'An error has occured during update. Please restart powershell and try again'
|
Write-Warning 'An error has occured during update. Please restart powershell and try again'
|
||||||
|
|
|
||||||
BIN
Get-PC/get-pc_logo_512.ico
Normal file
BIN
Get-PC/get-pc_logo_512.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 122 KiB |
Loading…
Reference in a new issue