@@ -20,16 +20,16 @@ param (
2020# Stop script execution when a non-terminating error occurs
2121$ErrorActionPreference = " Stop"
2222
23- Write-Host " --- :windows: Setting up Windows for app distribution"
23+ Write-Output " --- :windows: Setting up Windows for app distribution"
2424
25- Write-Host " Current working directory: $PWD "
25+ Write-Output " Current working directory: $PWD "
2626
27- Write-Host " Enable long path behavior"
27+ Write-Output " Enable long path behavior"
2828# See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#maximum-path-length-limitation
2929Set-ItemProperty - Path ' HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' - Name ' LongPathsEnabled' - Value 1
3030
3131# Disable Windows Defender before starting – otherwise our performance is terrible
32- Write-Host " Disable Windows Defender..."
32+ Write-Output " Disable Windows Defender..."
3333$avPreference = @ (
3434 @ {DisableArchiveScanning = $true }
3535 @ {DisableAutoExclusions = $true }
@@ -65,59 +65,59 @@ $avPreference | Foreach-Object {
6565# https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/microsoft-defender-antivirus-compatibility?view=o365-worldwide
6666$atpRegPath = ' HKLM:\SOFTWARE\Policies\Microsoft\Windows Advanced Threat Protection'
6767if (Test-Path $atpRegPath ) {
68- Write-Host " Set Microsoft Defender Antivirus to passive mode"
68+ Write-Output " Set Microsoft Defender Antivirus to passive mode"
6969 Set-ItemProperty - Path $atpRegPath - Name ' ForceDefenderPassiveMode' - Value ' 1' - Type ' DWORD'
7070}
7171
7272# From https://stackoverflow.com/a/46760714
73- Write-Host " --- :windows: Setting up Package Manager"
73+ Write-Output " --- :windows: Setting up Package Manager"
7474$env: ChocolateyInstall = Convert-Path " $ ( (Get-Command choco).Path) \..\.."
7575Import-Module " $env: ChocolateyInstall \helpers\chocolateyProfile.psm1"
7676
7777# This should avoid issues with symlinks not being supported in Windows.
7878#
7979# See how this build failed
8080# https://buildkite.com/automattic/beeper-desktop/builds/2895#01919738-7c6e-4b82-8d1d-1c1800481740
81- Write-Host " --- :windows: :linux: Enable developer mode to use symlinks"
81+ Write-Output " --- :windows: :linux: Enable developer mode to use symlinks"
8282
8383$developerMode = Get-WindowsOptionalFeature - Online - FeatureName Microsoft- Windows- Subsystem- Linux
8484
8585if ($developerMode.State -eq ' Enabled' ) {
86- Write-Host " Developer Mode is already enabled."
86+ Write-Output " Developer Mode is already enabled."
8787} else {
88- Write-Host " Enabling Developer Mode..."
88+ Write-Output " Enabling Developer Mode..."
8989 try {
9090 Enable-WindowsOptionalFeature - Online - FeatureName Microsoft- Windows- Subsystem- Linux - NoRestart
9191 } catch {
92- Write-Host " Failed to enable Developer Mode. Continuing without it..."
92+ Write-Output " Failed to enable Developer Mode. Continuing without it..."
9393 }
9494}
9595
96- Write-Host " --- :lock_with_ink_pen: Download Code Signing Certificate"
96+ Write-Output " --- :lock_with_ink_pen: Download Code Signing Certificate"
9797$certificateBinPath = " certificate.bin"
9898$EncodedText = aws secretsmanager get-secret - value -- secret- id windows- code- signing- certificate `
9999 | jq - r ' .SecretString' `
100100 | Out-File $certificateBinPath
101101$certificatePfxPath = " certificate.pfx"
102102certutil - decode $certificateBinPath $certificatePfxPath
103- Write-Host " Code signing certificate downloaded at: $ ( (Get-Item $certificatePfxPath ).FullName) "
103+ Write-Output " Code signing certificate downloaded at: $ ( (Get-Item $certificatePfxPath ).FullName) "
104104
105- Write-Host " --- :windows: Checking whether to install Windows 10 SDK..."
105+ Write-Output " --- :windows: Checking whether to install Windows 10 SDK..."
106106
107107# When using Electron Forge and electron2appx, building Appx requires the Windows 10 SDK
108108#
109109# See https://github.com/hermit99/electron-windows-store/tree/v2.1.2?tab=readme-ov-file#usage
110110
111111if ($SkipWindows10SDKInstallation ) {
112- Write-Host " Run with SkipWindows10SDKInstallation = true. Skipping Windows 10 SDK installation check."
112+ Write-Output " Run with SkipWindows10SDKInstallation = true. Skipping Windows 10 SDK installation check."
113113 exit 0
114114}
115115
116116$windowsSDKVersionFile = " .windows-10-sdk-version"
117117if (Test-Path $windowsSDKVersionFile ) {
118- Write-Host " Found $windowsSDKVersionFile file, installing Windows 10 SDK..."
118+ Write-Output " Found $windowsSDKVersionFile file, installing Windows 10 SDK..."
119119 & " $PSScriptRoot \install_windows_10_sdk.ps1"
120120 If ($LastExitCode -ne 0 ) { Exit $LastExitCode }
121121} else {
122- Write-Host " No $windowsSDKVersionFile file found, skipping Windows 10 SDK installation."
122+ Write-Output " No $windowsSDKVersionFile file found, skipping Windows 10 SDK installation."
123123}
0 commit comments