I have a script that show the dll version for zip file Now I have a CAB file but it doesn't work for him Here is my script: How can I change it to CAB
$path = "C:\Temp\test\New folder\cab\ForTesting"
$tempFolder = Join-Path ([IO.Path]::GetTempPath()) (New-GUID).ToString('n')
$compressedfiles = Get-ChildItem -path $path\* -Include "*.zip"
foreach ($file in $zips) {
try {
$zip = [System.IO.Compression.ZipFile]::ExtractToDirectory($file, $tempFolder)
$dlls = Get-ChildItem $tempFolder -Include "*.dll","*.exe" -Recurse
foreach($dll in $dlls) {
if ((($dll.VersionInfo.FileVersion) -eq "1.0.0.0") -or (($dll.VersionInfo.FileVersion) -eq "0.0.0.0"))
{
Write-host "The version of $($dll.Name) is: $($dll.VersionInfo.FileVersion) for: $($file.Name)" -ForegroundColor yellow
}
else {write-host "Dll $($dll.Name) version is: $($dll.VersionInfo.FileVersion)" -ForegroundColor Green}
}
}
catch {
Write-Warning $_.Exception.Message
continue
}
finally {
Remove-Item $tempFolder -Force -Recurse
}
}