mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-08-10 10:01:16 +10:00
Clean up analyzer warnings
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -24,6 +24,7 @@ function Invoke-WPFRunspace {
|
||||
#>
|
||||
|
||||
[CmdletBinding()]
|
||||
[OutputType([System.IAsyncResult])]
|
||||
Param (
|
||||
$ScriptBlock,
|
||||
$ArgumentList,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user