Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MZ] [01/14/2019] Fixed broken CAB extract #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions ParseDellCab.ps1
Expand Up @@ -21,7 +21,7 @@ $Items = $shell.Namespace($CabPath).items()
$Extract = $shell.Namespace($PSScriptRoot)
$Extract.CopyHere($Items)
#>
Expand $CabPath "$PSScriptRoot\DellSDPCatalogPC.xml"
Expand $CabPath "-F:DellSDPCatalogPC.xml" "$PSScriptRoot"

# Import and Create XML Object
[xml]$XML = Get-Content $PSScriptRoot\DellSDPCatalogPC.xml -Verbose
Expand All @@ -36,10 +36,10 @@ $Downloads = $xml.SystemsManagementCatalog.SoftwareDistributionPackage
$Model = (Get-WmiObject win32_computersystem).Model
If(!($Model.EndsWith("AIO")) -or !($Model.EndsWith("M"))){
$Target = $Downloads | Where-Object -FilterScript {
$PSitem.LocalizedProperties.Title -match $model -and $PSitem.LocalizedProperties.Title -notmatch $model + " AIO" -and $PSitem.LocalizedProperties.Title -notmatch $model + "M"
$PSitem.LocalizedProperties.Title -match $model -and $PSitem.LocalizedProperties.Title -notmatch $model + " AIO" -and $PSitem.LocalizedProperties.Title -notmatch $model + "M" -and $PSitem.Properties.PublicationState -match "Published"
}
}
Else{$Target = $Downloads | Where-Object -FilterScript {$PSitem.LocalizedProperties.Title -match $model}}
Else{$Target = $Downloads | Where-Object -FilterScript {$PSitem.LocalizedProperties.Title -match $model -and $PSitem.Properties.PublicationState -match "Published"}}
$TargetLink = $Target.InstallableItem.OriginFile.OriginUri
$TargetFileName = $Target.InstallableItem.OriginFile.FileName
Invoke-WebRequest -Uri $TargetLink -OutFile $PSScriptRoot\$TargetFileName -UseBasicParsing -Verbose
Expand Down