您好acrobat删除对x版本的支持id就像为我们的监控系统制作脚本。
目前我有:
$FullFolderPath = 'C:\Program Files (x86)\Adobe Reader DC';
$FolderName = (Split-Path $FullFolderPath -Leaf).ToString();
$DashIndex = $FolderName.IndexOf('Re');
$FolderNameFromDashToEnd = $FolderName.SubString($DashIndex);
$ADDC = "Reader DC"
if (($ADDC) -notcontains $FolderNameFromDashToEnd){
Write-Host "End of Support $adobeversion"
Exit 1010
}
else {
Write-Host "Adobe $FolderNameFromDashToEnd"
Exit 0
}
但我有两个 C:\ Program Files(x86)\ Adobe \ Acrobat 2017和 C:\ Program Files(x86)\ Adobe \ Acrobat Reader DC。
有多个版本,所以我需要排除除读者直流文件夹以外的所有文件夹。 有谁知道这个很好的黑客?
期望:如果文件夹acrobat *是excist但不是acrobat reader dc,那么:
我还尝试了几个选项:
$acrobatversion = Get-Childitem "C:\Program Files (x86)\Adobe\Acrobat*" | Select-Object @{Name="Name"; Expression = {$_.Name}}
$acrobatversion
但它只是招募两个acrobat文件夹
答案 0 :(得分:1)
您可以查看Uninstall registry keys以获取有关Reader安装的信息。然后使用Where-Object
进行过滤,以便只安装经典曲目。
$ReaderClassicTrackInstalls = @((Get-ChildItem HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\), (Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\)) |
ForEach-Object {
Get-ItemProperty ($_ -replace 'HKEY_LOCAL_MACHINE', 'HKLM:') |
Where-Object {$_.displayname -like "Adobe Acrobat Reader*" -and $_.displayname -notlike '*DC'}
}
$ReaderClassicTrackInstalls |
Select-Object InstallLocation, DisplayVersion