Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/build.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE"
pwsh -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE"
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this launcher from PowerShell to pwsh drops support for environments that only have Windows PowerShell 5.x installed, meaning build.cmd will now fail on such machines unless PowerShell Core is installed; please confirm this breaking change in build requirements is intentional, or add a fallback to Windows PowerShell if Core is unavailable.

Copilot uses AI. Check for mistakes.
22 changes: 5 additions & 17 deletions build/build.ps1
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
#!/usr/bin/env pwsh

#Requires -PSEdition Core

$DotNetInstallerUri = 'https://dot.net/v1/dotnet-install.ps1';
$BuildPath = Split-Path $MyInvocation.MyCommand.Path -Parent
$PSScriptRoot = Split-Path $PSScriptRoot -Parent
Comment on lines +3 to 7
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With #Requires -PSEdition Core at the top, this script can never run on non-Core PowerShell, so the compatibility block that checks $PSVersionTable.PSEdition -ne 'Core' and configures legacy TLS behavior a few lines below is now effectively dead code; consider removing that block to avoid confusion and keep the script focused on the supported runtime.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the compatibility block that checks $PSVersionTable.PSEdition -ne 'Core' and configures legacy TLS behavior a few lines below is now effectively dead code

I've removed dead code on latest commit (a731881)


if ($PSVersionTable.PSEdition -ne 'Core') {
# Attempt to set highest encryption available for SecurityProtocol.
# PowerShell will not set this by default (until maybe .NET 4.6.x). This
# will typically produce a message for PowerShell v2 (just an info
# message though)
try {
# Set TLS 1.2 (3072), then TLS 1.1 (768), then TLS 1.0 (192), finally SSL 3.0 (48)
# Use integers because the enumeration values for TLS 1.2 and TLS 1.1 won't
# exist in .NET 4.0, even though they are addressable if .NET 4.5+ is
# installed (.NET 4.5 is an in-place upgrade).
[System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor 768 -bor 192 -bor 48
} catch {
Write-Output 'Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to upgrade to .NET Framework 4.5+ and PowerShell v3'
}
}

###########################################################################
# INSTALL .NET CORE CLI
###########################################################################
Expand Down Expand Up @@ -55,7 +41,9 @@ $GlobalJsonPath = Join-Path $SdkPath "global.json"
if (!(Test-Path $InstallPath)) {
New-Item -Path $InstallPath -ItemType Directory -Force | Out-Null;
$ScriptPath = Join-Path $InstallPath 'dotnet-install.ps1'
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, $ScriptPath);

curl -LsSfo $ScriptPath $DotNetInstallerUri --retry 5 --retry-delay 5

& $ScriptPath -JSonFile $GlobalJsonPath -InstallDir $InstallPath;

# Install .NET 8 SDK
Expand Down
2 changes: 1 addition & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0

if [ ! -d "$PROJECT_ROOT/.dotnet" ]; then
mkdir "$PROJECT_ROOT/.dotnet"
curl -Lsfo "$PROJECT_ROOT/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh
curl -LsSfo "$PROJECT_ROOT/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh --retry 5 --retry-delay 5
bash "$PROJECT_ROOT/.dotnet/dotnet-install.sh" --jsonfile ./build/sdk/global.json --install-dir .dotnet --no-path

# Install .NET 8 SDK
Expand Down
2 changes: 1 addition & 1 deletion docs/articles/contributing/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Once all the necessary tools are in place, building is trivial. Simply open solu
The build currently depends on the following prerequisites:

- Windows:
- PowerShell version 5 or higher
- PowerShell Core
- MSBuild version 15.1 or higher
- .NET Framework 4.6 or higher

Expand Down