Skip to content

Commit 15fbee1

Browse files
committed
install pwsh profile to set widht/height
1 parent 227a10d commit 15fbee1

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

.github/workflows/otel_sdk.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,25 @@ jobs:
1616
contents: write
1717
steps:
1818
- uses: actions/checkout@v5
19+
- name: Install PowerShell profile
20+
shell: pwsh
21+
run: |
22+
$profileDir = Split-Path -Parent $PROFILE.CurrentUserAllHosts
23+
New-Item -ItemType Directory -Path $profileDir -Force | Out-Null
24+
Copy-Item .github/workflows/pwsh_profile.ps1 $PROFILE.CurrentUserAllHosts -Force
1925
- run: systeminfo
2026
- run: ls "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC"
2127
- run: Get-ChildItem env:* | Sort-Object -Property Name | Format-Table -AutoSize -Wrap
2228
- run: choco uninstall bazel --yes
23-
# - uses: Cyberboss/install-winget@6f566e9e227561d5d31e45d65f9b777b3fa8f56f
29+
- run: cmd /c "dir c:\ || echo swallowing errors"
30+
- run: cmd /c "dir d:\ || echo swallowing errors"
2431
- run: winget list --accept-source-agreements --disable-interactivity
2532
- run: cmd /c "winget --info || echo swallowing errors"
26-
- run: cmd /c "winget settings export || echo swallowing errors"
27-
- run: cmd /c "echo %CD% || echo swallowing errors"
28-
- run: cmd /c "type .github\workflows\winget_settings.json || echo swallowing errors"
29-
- run: cmd /c "echo A=%LOCALAPPDATA% || echo swalloing wrrroe"
30-
- run: cmd /c "dir %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe /s || echo swalloing errors"
31-
- run: cmd /c "type %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json || echo swallowing errors"
3233
- run: cmd /c "copy .github\workflows\winget_settings.json %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json || echo swallowing errors"
33-
- run: cmd /c "type %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json || echo swallowing errors"
34-
- run: cmd /c "winget settings export || echo swallowing errors"
35-
- run: cmd /c "dir c:\ || echo swallowing errors"
36-
- run: cmd /c "dir d:\ || echo swallowing errors"
3734
- run: |
3835
winget remove --all --verbose --force --purge --disable-interactivity Anaconda.Miniconda3 Mozilla.Firefox ShiningLight.OpenSSL.Dev PostgreSQL.PostgreSQL.17 RProject.R RProject.Rtools Unity.UnityHub Amazon.SAM-CLI Microsoft.AzureCLI Microsoft.webpicmd Google.Chrome StrawberryPerl.StrawberryPerl Microsoft.ServiceFabricSDK OpenJS.NodeJS.LTS Amazon.AWSCLI Microsoft.WebDeploy Microsoft.Azure.CosmosEmulator MongoDB.Shell MongoDB.Server WiXToolset.WiXToolset Amazon.SessionManagerPlugin sbt.sbt
3936
echo Done! LASTEXITCODE=$LASTEXITCODE
37+
- run: winget list --accept-source-agreements --disable-interactivity
4038
- run: cmd /c "dir c:\ || echo swallowing errors"
4139
- run: cmd /c "dir d:\ || echo swallowing errors"
4240
- run: winget install bazelisk -r bazel --accept-package-agreements --disable-interactivity --silent

.github/workflows/pwsh_profile.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function Set-WideOutput {
2+
param(
3+
[int]$Width = 256,
4+
[int]$BufferHeight = 8192
5+
)
6+
7+
try {
8+
if ($Host.UI -and $Host.UI.RawUI) {
9+
$rawUI = $Host.UI.RawUI
10+
$rawUI.BufferSize = New-Object Management.Automation.Host.Size($Width, $BufferHeight)
11+
$rawUI.WindowSize = New-Object Management.Automation.Host.Size($Width, $rawUI.WindowSize.Height)
12+
}
13+
}
14+
catch {
15+
# Non-interactive or redirected output may not support RawUI
16+
}
17+
18+
$PSDefaultParameterValues["Format-Table:AutoSize"] = $true
19+
$PSDefaultParameterValues["Out-String:Width"] = $Width
20+
}
21+
22+
# Apply immediately when PowerShell starts
23+
Set-WideOutput

0 commit comments

Comments
 (0)