Created
November 9, 2020 05:22
-
-
Save NathanTheGr8/d63f5409210bf83c6d6b589c4b1687e3 to your computer and use it in GitHub Desktop.
This script will download and extract the latest Dell Driver Cab to use it to determine the release dates of all dell models
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
<# | |
.SYNOPSIS | |
Export CSV of Dell Models and their release dates | |
.DESCRIPTION | |
This script will download and extract the latest Dell Driver Cab to use it to determine the release dates of all dell models | |
.NOTES | |
#> | |
[CmdletBinding()] | |
Param | |
( | |
[string]$DriverCatalog = "http://downloads.dell.com/catalog/DriverPackCatalog.cab", | |
[string]$LocalDriverCache = "$env:SystemDrive\DellDrivers", | |
[string]$outCSV = "$($Home)\Documents\Work\PowerBI\Dell_Model_Release_Dates.csv" | |
) | |
function new-DirectorySafe( [string] $Path ) | |
{ | |
if ( ! ( test-path $Path ) ) { new-item -Type Directory -Path $Path | out-string | write-verbose } | |
} | |
#Download Latest Dell Driver Cab | |
Write-Verbose "Download and extract Dell Driver Cab" | |
New-DirectorySafe -Path $LocalDriverCache | |
(New-Object System.Net.WebClient).DownloadFile($DriverCatalog, "$LocalDriverCache\DriverPackCatalog.cab") | |
expand "$LocalDriverCache\DriverPackCatalog.cab" "$LocalDriverCache\DriverPackCatalog.xml" | out-string | write-verbose | |
#import xml files | |
[xml]$DellDriverCab = Get-Content -Path "$LocalDriverCache\DriverPackCatalog.xml" | |
$AllDrivers = $DellDriverCab.DriverPackManifest.DriverPackage | |
$OutputArray = @() | |
$count = 0 | |
Foreach ($Driver in $AllDrivers){ | |
Write-Progress -Activity "Processing Dell Driver Catalog XML" -Status "On $count of $($AllDrivers.count)" -PercentComplete (($count/$($AllDrivers.count))*100) | |
$Cur_Model = $Driver.SupportedSystems.Brand.Model.name | |
$ReleaseDate = $Driver.SupportedSystems.Brand.Model.rtsDate | |
$obj = [PSCustomObject]@{ | |
model = $Cur_Model | |
"Release Date" = $ReleaseDate | |
#"EOL Date" = TODO | |
} | |
$OutputArray += $obj | |
$count++ | |
} | |
#$OutputArray | Format-Table | |
$OutputArray | Export-CSV -Path $outCSV -NoTypeInformation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment