📌  相关文章
📜  powershell 检查是否安装了软件 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:28.664000             🧑  作者: Mango

代码示例1
$software = "Microsoft .NET Core Runtime - 3.1.0 (x64)";
$installed = (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where { $_.DisplayName -eq $software }) -ne $null

If(-Not $installed) {
    Write-Host "'$software' is NOT installed.";
} else {
    Write-Host "'$software' is installed."
}