Clean up analyzer warnings

This commit is contained in:
Chris Titus
2026-07-02 00:07:56 -05:00
parent 93dc23dd66
commit 67072da1c6
26 changed files with 165 additions and 136 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ function Invoke-WPFAppxRemoval {
$selected = $sync.selectedAppx
$apps = $sync.configs.appxHashtable
$handle = Invoke-WPFRunspace -ParameterList @(("selected", $selected), ("apps", $apps)) -ScriptBlock {
Invoke-WPFRunspace -ParameterList @(("selected", $selected), ("apps", $apps)) -ScriptBlock {
param($selected, $apps)
$sync.ProcessRunning = $true
+1 -1
View File
@@ -35,7 +35,7 @@ function Invoke-WPFButton {
if ($buttonConfig.InvokeScript -and $buttonConfig.InvokeScript.Count -gt 0) {
foreach ($script in $buttonConfig.InvokeScript) {
if (-not [string]::IsNullOrWhiteSpace($script)) {
Invoke-Expression $script
Invoke-Command -ScriptBlock ([scriptblock]::Create($script)) -ErrorAction Stop
}
}
return
@@ -12,7 +12,7 @@ function Invoke-WPFFeatureInstall {
return
}
$handle = Invoke-WPFRunspace -ScriptBlock {
Invoke-WPFRunspace -ScriptBlock {
$Features = $sync.selectedFeatures
$sync.ProcessRunning = $true
if ($Features.count -eq 1) {
@@ -26,7 +26,7 @@ function Invoke-WPFFeatureInstall {
$Features | ForEach-Object {
Invoke-WinUtilFeatureInstall $_
$X++
Invoke-WPFUIThread -ScriptBlock { Set-WinUtilTaskbaritem -value ($x/$CheckBox.Count) }
Invoke-WPFUIThread -ScriptBlock { Set-WinUtilTaskbaritem -value ($x/$Features.Count) }
}
$sync.ProcessRunning = $false
+1 -1
View File
@@ -24,7 +24,7 @@ function Invoke-WPFInstall {
$packageSummary = Get-WinUtilPackageLogSummary -Packages $PackagesToInstall -Preference $ManagerPreference
Write-WinUtilLog -Component "Install" -Message "Install selected package(s): $($packageSummary -join '; ')"
$handle = Invoke-WPFRunspace -ParameterList @(("PackagesToInstall", $PackagesToInstall),("ManagerPreference", $ManagerPreference)) -ScriptBlock {
Invoke-WPFRunspace -ParameterList @(("PackagesToInstall", $PackagesToInstall),("ManagerPreference", $ManagerPreference)) -ScriptBlock {
param($PackagesToInstall, $ManagerPreference)
$packagesSorted = Get-WinUtilSelectedPackages -PackageList $PackagesToInstall -Preference $ManagerPreference
+1
View File
@@ -24,6 +24,7 @@ function Invoke-WPFRunspace {
#>
[CmdletBinding()]
[OutputType([System.IAsyncResult])]
Param (
$ScriptBlock,
$ArgumentList,
+1 -1
View File
@@ -57,7 +57,7 @@ function Invoke-WPFtweaksbutton {
}
# The leading "," in the ParameterList is necessary because we only provide one argument and powershell cannot be convinced that we want a nested loop with only one argument otherwise
$handle = Invoke-WPFRunspace -ParameterList @(("tweaks", $tweaksToRun), ("dnsProvider", $dnsProvider), ("completedSteps", $completedSteps), ("totalSteps", $totalSteps)) -ScriptBlock {
Invoke-WPFRunspace -ParameterList @(("tweaks", $tweaksToRun), ("dnsProvider", $dnsProvider), ("completedSteps", $completedSteps), ("totalSteps", $totalSteps)) -ScriptBlock {
param($tweaks, $dnsProvider, $completedSteps, $totalSteps)
$sync.ProcessRunning = $true