Clean up analyzer warnings across app search and ISO workflows (#4794)

* Clean up analyzer warnings

* Align analyzer warning cleanup policy

* Run PSScriptAnalyzer directly in unittests workflow

* Bind lazy-rendered buttons to click handlers

* Remove WinUtil performance tracing

* Fix Win11 ISO creator temp directory reuse
This commit is contained in:
Chris Titus
2026-07-02 12:05:25 -05:00
committed by GitHub
parent b72bfb03ba
commit 58d37bb461
45 changed files with 262 additions and 439 deletions
+22
View File
@@ -35,6 +35,7 @@ Describe "Win11 Creator setup media" {
return $functionAst.Extent.Text
}
$script:modifyFunction = Get-WinUtilFunctionText -Path $script:isoWorkflowPath -FunctionName "Invoke-WinUtilISOModify"
$script:editionIdFunction = Get-WinUtilFunctionText -Path $script:isoWorkflowPath -FunctionName "Get-WinUtilEditionIdFromName"
$script:addDriversFunction = Get-WinUtilFunctionText -Path $script:isoScriptPath -FunctionName "Add-DriversToImage"
$script:answerFileChildElementFunction = Get-WinUtilFunctionText -Path $script:isoScriptPath -FunctionName "Get-WinUtilISOScriptChildElement"
@@ -69,6 +70,27 @@ Describe "Win11 Creator setup media" {
}
}
It "starts each new ISO modification in a fresh working directory" {
foreach ($expectedText in @(
'$workDir = Join-Path $env:TEMP "WinUtil_Win11ISO_$(Get-Date -Format ''yyyyMMdd_HHmmss'')"',
'$workDir = Join-Path $env:TEMP "WinUtil_Win11ISO_$(Get-Date -Format ''yyyyMMdd_HHmmss'')_$(([guid]::NewGuid()).ToString(''N'').Substring(0, 8))"'
)) {
$script:modifyFunction | Should -Match ([regex]::Escape($expectedText))
}
$script:modifyFunction | Should -Not -Match ([regex]::Escape("Reusing existing temp directory"))
}
It "mounts the copied image file that was verified from the ISO" {
foreach ($expectedText in @(
'$sourceImageFileName = Split-Path $wimPath -Leaf',
'$localWim = Join-Path $isoContents "sources\$sourceImageFileName"',
'Copied ISO image file not found: sources\$sourceImageFileName'
)) {
$script:modifyFunction | Should -Match ([regex]::Escape($expectedText))
}
}
It "maps Windows edition names to setup edition IDs" {
. ([scriptblock]::Create($script:editionIdFunction))