Skip to content

Instantly share code, notes, and snippets.

@Chirishman
Created April 18, 2018 02:59
Show Gist options
  • Save Chirishman/0c5dead067cd6b102ca5d266aaf8667c to your computer and use it in GitHub Desktop.
Save Chirishman/0c5dead067cd6b102ca5d266aaf8667c to your computer and use it in GitHub Desktop.
Really Really Rough Dell Spec Lookup
#REALLY rough, here be dragons. Still faster than doing it manually though.
$STList = @(
#Service Tags Go Here
'XXXXXXX',
'XXXXXXX'
)
$ResultTable = [System.Collections.ArrayList]::new()
$STList | %{
$ThisRecord = $_
$a = iwr -Uri "http://www.dell.com/support/home/us/en/19/product-support/servicetag/$ThisRecord/configuration?ref=captchaseen"
$b = $a.InputFields | ?{$_ -match 'core|processor|memory|xeon'} | select -expandproperty Value -First 1 | ConvertFrom-Json
$c = $b | ?{$_.SkuDescription -match 'Core|DDR|RAM|memory|dimm|xeon|processor|i5|i7|i3' -and $_.SkuDescription -notmatch 'NVIDIA|gddr|quadro|firepro'} | select @{N='ServiceTag';E={$ThisRecord}},SkuDescription,@{N='Quantity';E={$_.Parts.Qty}},@{N='ExtendedDescription';E={$_.Parts.Description}}
[void]$ResultTable.Add($c)
if ($c) {
Write-Verbose -Message (($c | ft -AutoSize)|Out-String) -Verbose
} else {
Write-Error -Message "Error Retrieving: $ThisRecord" -ErrorAction Continue
}
start-sleep -Seconds 2
}
$ResultTable | Out-GridView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment