Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Last active September 6, 2017 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mczerniawski/58ff763d9e8ed04dc5b180add01928d2 to your computer and use it in GitHub Desktop.
Save mczerniawski/58ff763d9e8ed04dc5b180add01928d2 to your computer and use it in GitHub Desktop.
Download LAPS
$URLs = @('https://download.microsoft.com/download/C/7/A/C7AAD914-A8A6-4904-88A1-29E657445D03/LAPS.x64.msi','https://download.microsoft.com/download/C/7/A/C7AAD914-A8A6-4904-88A1-29E657445D03/LAPS.x86.msi')
$Date = Get-Date -Format yyyyMMdd_hhmm
$TempFolder = "d:\Temp_$Date"
New-Item -Path $TempFolder -ItemType Directory -Force
$URLs | foreach-object {
$fileName = Split-Path $_ -Leaf
$DestinationPath = Join-Path $TempFolder -ChildPath $fileName
Invoke-WebRequest -Uri $_ -OutFile $DestinationPath
}
Start-Process msiexec -ArgumentList "/i $TempFolder\LAPS.x64.msi ADDLOCAL=Management.UI,Management.PS,Management.ADMX /quiet /norestart" -Wait -NoNewWindow -PassThru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment