Skip to content

Commit

Permalink
Use Write-Host so we don't muck up the pipeline output.
Browse files Browse the repository at this point in the history
  • Loading branch information
enclave-alistair committed Nov 30, 2023
1 parent 8dc0202 commit 1fc5f01
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions setup-unattended.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if ($newEnclaveVersion -ne $existingEnclaveVersion)

if (!$existingEnclaveVersion)
{
"Installing VC++ Redistributable";
Write-Host "Installing VC++ Redistributable";

$vcRedistInstallPath = Join-Path $env:TEMP "enclave_vcredist.exe";

Expand All @@ -76,7 +76,7 @@ if ($newEnclaveVersion -ne $existingEnclaveVersion)
& $vcRedistInstallPath "/install" "/silent" "/norestart";
}

"Downloading latest enclave version $newEnclaveVersion from $($selectedPackage.Url)";
Write-Host "Downloading latest enclave version $newEnclaveVersion from $($selectedPackage.Url)";

$enclaveInstallerFile = Join-Path $env:TEMP "enclave-$newEnclaveVersion.msi";
$enclaveInstallLogFile = Join-Path $env:TEMP "enclave-$newEnclaveVersion.install.log"
Expand All @@ -85,20 +85,20 @@ if ($newEnclaveVersion -ne $existingEnclaveVersion)

if ($existingEnclaveVersion)
{
"Closing any open instances of the enclave tray"
Write-Host "Closing any open instances of the enclave tray"
Get-Process "enclave-tray" -ErrorAction SilentlyContinue | Stop-Process -ErrorAction SilentlyContinue
}

if ($existingEnclaveVersion -or !$EnrolmentKey)
{
# Don't need to re-enrol, we're already installed, or we don't have an enrolment key, so don't provide one to the installer.
"Installing enclave; writing install log to $enclaveInstallLogFile"
Write-Host "Installing enclave; writing install log to $enclaveInstallLogFile"
Start-Process msiexec "/i $enclaveInstallerFile /qn /l*v $enclaveInstallLogFile" -Wait
}
else
{
# Not installed, provide the enrolment key.
"Installing enclave and enrolling; writing install log to $enclaveInstallLogFile"
Write-Host "Installing enclave and enrolling; writing install log to $enclaveInstallLogFile"
Start-Process msiexec "/i $enclaveInstallerFile /qn /l*v $enclaveInstallLogFile ENROLMENT_KEY=$EnrolmentKey" -Wait

# Make sure we purge the enrolment key from the log file.
Expand All @@ -116,7 +116,7 @@ if ($newEnclaveVersion -ne $existingEnclaveVersion)
}
else
{
"Nothing to do; local installation is already at latest version $existingEnclaveVersion"
Write-Host "Nothing to do; local installation is already at latest version $existingEnclaveVersion"
}

# Get installed enclave status.
Expand Down

0 comments on commit 1fc5f01

Please sign in to comment.