Microsoft Visual C++ 2012 Redistributable (x86): Difference between revisions

From LANCommander
No edit summary
No edit summary
 
Line 11: Line 11:
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents = <syntaxhighlight lang="powershell" line>
$Installed = Get-Package "Microsoft Visual C++ 2012 Redistributable (x86)*"
$Installed | Where-Object -Property Name -like "Microsoft Visual C++ 2012 Redistributable (x86)*"


if ($Installed.Length -ge 0) {
if ($Installed.Length -ge 0) {

Latest revision as of 18:11, 19 December 2023


Downloads

Version Release Date File
10.0.40219 Download

Install Detection

This script will look at the installed package list from Windows for anything matching Visual C++ 2012 Redistributable (x86).

$Installed | Where-Object -Property Name -like "Microsoft Visual C++ 2012 Redistributable (x86)*"

if ($Installed.Length -ge 0) {
    $Host.SetShouldExit(1)
} else {
    $Host.SetShouldExit(0)
}

Install Script

This script installs the Visual C++ 2012 Redistributable (x86) redistributable silently.

Write-Host "Installing Visual C++ 2012 Redistributable (x86)..."
Start-Process -FilePath "vcredist_x86.exe" -ArgumentList "/quiet /norestart" -Wait -Passthru
Write-Host "Done!"