Prerequisites
Steps to reproduce
When trying to do a local build in a PowerShell 7.6.5 session after running
Import-Module .\build.psm1
Whilst running Start-PSBootstrap -Scenario All -Force it gets into the Install-DotNet function and during this it ends up changing the console font & size as shown below, which is a jarring and unwanted experience.
It seems to b connected to the use of calling out to PowerShell.exe & Start-NativeExecution form initial stepping through the code
|
else { |
|
# dotnet-install.ps1 uses APIs that are not supported in .NET Core, so we run it with Windows PowerShell |
|
$fullPSPath = Join-Path -Path $env:windir -ChildPath "System32\WindowsPowerShell\v1.0\powershell.exe" |
|
$fullDotnetInstallPath = Join-Path -Path (Convert-Path -Path $PWD.Path) -ChildPath $installScript |
|
|
|
if ($Version) { |
|
$psArgs = @('-NoLogo', '-NoProfile', '-File', $fullDotnetInstallPath, '-Version', $Version) |
|
} |
|
elseif ($Channel) { |
|
$psArgs = @('-NoLogo', '-NoProfile', '-File', $fullDotnetInstallPath, '-Channel', $Channel, '-Quality', $Quality) |
|
} |
|
|
|
if ($InstallDir) { |
|
$psArgs += @('-InstallDir', $InstallDir) |
|
} |
|
|
|
if ($AzureFeed) { |
|
$psArgs += @('-AzureFeed', $AzureFeed) |
|
} |
|
|
|
if ($FeedCredential) { |
|
$psArgs += @('-FeedCredential', $FeedCredential) |
|
} |
|
|
|
$psArgs += @('-SkipNonVersionedFiles') |
|
|
|
# Removing the verbose message to not expose the secret |
|
# $psArgs -join ' ' | Write-Verbose -Verbose |
|
|
|
Start-NativeExecution { |
|
& $fullPSPath @psArgs |
|
} |
Note: this does not occur in WinTerminal & is only seems to be in conhost (I've not tested elsewhere)
Also, annoyingly this doesn't happen every time I attempt a build either & this is the 2nd time I've dug into it for this to resolve whilst creating this issue.
Raising for awareness as it's unlikely this will be fixed with it being in conhost only & not being easily repeatable either.
Expected behavior
Console doesn't change unnecessarily
Actual behavior
Fonts change & other unwanted behaviours
Error details
Environment data
Name Value
---- -----
PSVersion 7.6.5
PSEdition Core
GitCommitId 7.6.5
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
This is how it comes out (with my profile)

When the defaults are

Prerequisites
Steps to reproduce
When trying to do a local build in a PowerShell 7.6.5 session after running
Import-Module .\build.psm1Whilst running
Start-PSBootstrap -Scenario All -Forceit gets into theInstall-DotNetfunction and during this it ends up changing the console font & size as shown below, which is a jarring and unwanted experience.It seems to b connected to the use of calling out to PowerShell.exe &
Start-NativeExecutionform initial stepping through the codePowerShell/build.psm1
Lines 2807 to 2838 in b664c2e
Also, annoyingly this doesn't happen every time I attempt a build either & this is the 2nd time I've dug into it for this to
resolvewhilst creating this issue.Raising for awareness as it's unlikely this will be fixed with it being in conhost only & not being easily repeatable either.
Expected behavior
Console doesn't change unnecessarilyActual behavior
Fonts change & other unwanted behavioursError details
N/AEnvironment data
Visuals
This is how it comes out (with my profile)

When the defaults are