2021-04-26 10:27:45 -07:00
|
|
|
# Copyright (c) Microsoft Corporation.
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2024-07-03 20:01:35 -07:00
|
|
|
param([string]$SasToken)
|
2021-04-26 10:27:45 -07:00
|
|
|
|
2024-07-03 20:01:35 -07:00
|
|
|
if (Test-Path "$PSScriptRoot/utility-prefix.ps1") {
|
|
|
|
. "$PSScriptRoot/utility-prefix.ps1"
|
|
|
|
}
|
2021-04-26 10:27:45 -07:00
|
|
|
|
2024-07-03 20:01:35 -07:00
|
|
|
[string]$MpiUrl
|
|
|
|
if ([string]::IsNullOrEmpty($SasToken)) {
|
2024-11-19 14:42:29 -08:00
|
|
|
Write-Host 'Downloading from the Internet'
|
2024-07-03 20:01:35 -07:00
|
|
|
$MpiUrl = 'https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe'
|
|
|
|
} else {
|
2024-11-19 14:42:29 -08:00
|
|
|
Write-Host 'Downloading from vcpkgimageminting using SAS token'
|
2024-07-03 20:01:35 -07:00
|
|
|
$SasToken = $SasToken.Replace('"', '')
|
|
|
|
$MpiUrl = "https://vcpkgimageminting.blob.core.windows.net/assets/msmpisetup.exe?$SasToken"
|
2021-04-26 10:27:45 -07:00
|
|
|
}
|
|
|
|
|
2024-07-03 20:01:35 -07:00
|
|
|
DownloadAndInstall -Name 'MSMPI' -Url $MpiUrl -Args @('-force', '-unattend')
|