From e6c7421580d9bd4b381930e5412767fe28177840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Majcherski?= <43614029+majcherm-da@users.noreply.github.com> Date: Wed, 15 May 2019 11:59:56 +0200 Subject: [PATCH] windows: CI agent diagnostics (#1146) --- ci/build-windows.yml | 3 +++ ci/windows-diagnostics.ps1 | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 ci/windows-diagnostics.ps1 diff --git a/ci/build-windows.yml b/ci/build-windows.yml index 576fd04a92..6e95bd5e0a 100644 --- a/ci/build-windows.yml +++ b/ci/build-windows.yml @@ -8,6 +8,9 @@ steps: # to upload to the bazel cache GOOGLE_APPLICATION_CREDENTIALS_CONTENT: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT) + - powershell: '.\ci\windows-diagnostics.ps1' + displayName: 'Agent diagnostics' + - powershell: '.\build.ps1' displayName: 'Build' diff --git a/ci/windows-diagnostics.ps1 b/ci/windows-diagnostics.ps1 new file mode 100644 index 0000000000..de6d4a8d0f --- /dev/null +++ b/ci/windows-diagnostics.ps1 @@ -0,0 +1,15 @@ +Set-StrictMode -Version latest +$ErrorActionPreference = 'Stop' + +$info = Get-CimInstance -ClassName win32_operatingsystem + +$info | format-table CSName + +$info | format-table LastBootUpTime + +$info | format-table FreePhysicalMemory, TotalVisibleMemorySize + +get-wmiobject win32_logicaldisk | format-table ` + Name,` + @{n="Size [GB]";e={[math]::truncate($_.size / 1GB)}},` + @{n="Free [GB]";e={[math]::truncate($_.freespace / 1GB)}}