diff --git a/images/win/scripts/Installers/Install-Rust.ps1 b/images/win/scripts/Installers/Install-Rust.ps1 index 96f9618b3..bbb259a0e 100644 --- a/images/win/scripts/Installers/Install-Rust.ps1 +++ b/images/win/scripts/Installers/Install-Rust.ps1 @@ -22,7 +22,7 @@ $env:Path = Get-MachinePath # Install common tools rustup component add rustfmt clippy -cargo install bindgen cbindgen +cargo install bindgen cbindgen cargo-audit cargo-outdated # Run script at startup for all users $cmdRustSymScript = @" diff --git a/images/win/scripts/Installers/Validate-Rust.ps1 b/images/win/scripts/Installers/Validate-Rust.ps1 index 116f33cf5..88968a21c 100644 --- a/images/win/scripts/Installers/Validate-Rust.ps1 +++ b/images/win/scripts/Installers/Validate-Rust.ps1 @@ -17,3 +17,13 @@ else Write-Host "rustc is not on the path" exit 1 } + +if (-Not (Get-Command -Name 'cargo-audit')){ + Write-Host "cargo audit is not on the path" + exit 1 +} + +if (-Not (Get-Command -Name 'cargo-outdated')){ + Write-Host "cargo outdated is not on the path" + exit 1 +} \ No newline at end of file diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 829ac4657..8e1560eef 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -37,6 +37,22 @@ function Get-RustVersion { return "Rust ${rustVersion}" } +function Get-BindgenVersion { + return bindgen --version +} + +function Get-CbindgenVersion { + return cbindgen --version +} + +function Get-CargoAuditVersion { + return cargo audit --version +} + +function Get-CargoOutdatedVersion { + return cargo outdated --version +} + function Get-PythonVersion { return & python --version } diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 0f7f1fa09..014430ed5 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -112,6 +112,14 @@ $markdown += New-MDList -Style Unordered -Lines @( (Get-GoogleCloudSDKVersion) ) +$markdown += New-MDHeader "Rust packages:" -Level 3 +$markdown += New-MDList -Style Unordered -Lines @( + (Get-BindgenVersion), + (Get-CbindgenVersion), + (Get-CargoAuditVersion), + (Get-CargoOutdatedVersion) +) + $markdown += New-MDHeader "Browsers and webdrivers" -Level 3 $markdown += New-MDList -Style Unordered -Lines @( (Get-BrowserVersion -Browser "chrome"),