From 6846f12d42a5aed66ca3d9e8bca287d236aa24d3 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Mon, 20 Dec 2021 17:25:00 +0300 Subject: [PATCH] Initialize rust environment to get software report (#4774) --- .../win/scripts/SoftwareReport/SoftwareReport.Common.psm1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 0bd99e7cc..77099297f 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -1,3 +1,9 @@ +function Initialize-RustEnvironment { + $env:RUSTUP_HOME = "C:\Users\Default\.rustup" + $env:CARGO_HOME = "C:\Users\Default\.cargo" + $env:Path += ";$env:CARGO_HOME\bin" +} + function Get-OSName { return (Get-CimInstance -ClassName Win32_OperatingSystem).Caption } @@ -14,6 +20,7 @@ function Get-BashVersion { } function Get-RustVersion { + Initialize-RustEnvironment $rustVersion = [regex]::matches($(rustc --version), "\d+\.\d+\.\d+").Value return $rustVersion } @@ -349,4 +356,3 @@ function Build-PackageManagementEnvironmentTable { } } } -