DirectX (June 2010)
Install Detection
This script simply looks for the existence of a registry entry indicating that DirectX has probably been installed previously.
$Exists = Test-Path "HKLM:\\SOFTWARE\Microsoft\DirectX"
if ($Exists -eq $True) {
$Host.SetShouldExit(1)
} else {
$Host.SetShouldExit(0)
}
Install Script
This script installs the DirectX (June 2010) redistributable silently.
Write-Host "Installing DirectX (June 2010) Redistributable..."
Start-Process -FilePath "DXSETUP.exe" -ArgumentList "/silent" -Wait -Passthru
Write-Host "Done!"