TroubleChute Logo
< Go Back

TroubleChute Script Hub

Currently viewing: PowerShell/General/install-vcredist.ps1


NOTE: The following code may be out-of-date compared to GitHub, but is all pulled from GitHub every hour or so.

When shortlinks are used (filename as subdomain), code used by PowerShell and other interactions with this site is served from GitHub.

(Right-click -> Download the button below to save the file)

Last modified: 2023-04-13T00:46:49.000+02:00

install-vcredist.ps1
# While you could go out of your way to create a VCredist installer...
# There already exists one:
# https://vcredist.com/quick/#install-the-visual-c-redistributables
# 
# A huge thank you to aaronparker/vcredist for this!

iex (irm Import-RemoteFunction.tc.ht) # Get RemoteFunction importer
Import-RemoteFunction -ScriptUri "Invoke-Elevated.tc.ht" # Import function to raise code to Admin

# The following does need to be run as admin, so that is done with the above to elevate it.
Invoke-Elevated {
    Write-Host "Preparing to download and install missing VcRedists (if any)." -ForegroundColor Yellow
    Write-Host "Please close this window when the process completes to continue (if it does not close itself)!" -ForegroundColor Red
    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://vcredist.com/install.ps1'))
}

TCNO TechNobo / TroubleChute © Wesley Pyburn (TroubleChute)
Support Me Privacy Policy Cookies Policy Terms of Service Contact