Skip to content

Commit

Permalink
Compile Winutil
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTitusTech authored and github-actions[bot] committed Jun 28, 2024
1 parent ab38402 commit 6c49a8f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions winutil.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,7 @@ function Get-WinUtilVariables {
[Parameter()]
[string[]]$Type
)

$keys = $sync.keys | Where-Object { $_ -like "WPF*" }

$keys = ($sync.keys).where{ $_ -like "WPF*" }
if ($Type) {
$output = $keys | ForEach-Object {
Try {
Expand Down Expand Up @@ -14121,7 +14119,7 @@ $InitialSessionState = [System.Management.Automation.Runspaces.InitialSessionSta
$InitialSessionState.Variables.Add($hashVars)

# Get every private function and add them to the session state
$functions = Get-ChildItem function:\ | Where-Object {$_.name -like "*winutil*" -or $_.name -like "*WPF*"}
$functions = (Get-ChildItem function:\).where{$_.name -like "*winutil*" -or $_.name -like "*WPF*"}
foreach ($function in $functions){
$functionDefinition = Get-Content function:\$($function.name)
$functionEntry = New-Object System.Management.Automation.Runspaces.SessionStateFunctionEntry -ArgumentList $($function.name), $functionDefinition
Expand Down Expand Up @@ -14387,7 +14385,7 @@ Add-Type @"
"@
}

foreach ($proc in (Get-Process | Where-Object { $_.MainWindowTitle -and $_.MainWindowTitle -like "*titus*" })) {
foreach ($proc in (Get-Process).where{ $_.MainWindowTitle -and $_.MainWindowTitle -like "*titus*" }) {
# Check if the process's MainWindowHandle is valid
if ($proc.MainWindowHandle -ne [System.IntPtr]::Zero) {
Write-Debug "MainWindowHandle: $($proc.Id) $($proc.MainWindowTitle) $($proc.MainWindowHandle)"
Expand Down Expand Up @@ -14503,11 +14501,11 @@ Add-Type @"

# Load Checkboxes and Labels outside of the Filter fuction only once on startup for performance reasons
$filter = Get-WinUtilVariables -Type CheckBox
$CheckBoxes = $sync.GetEnumerator() | Where-Object { $psitem.Key -in $filter }
$CheckBoxes = ($sync.GetEnumerator()).where{ $psitem.Key -in $filter }

$filter = Get-WinUtilVariables -Type Label
$labels = @{}
$sync.GetEnumerator() | Where-Object {$PSItem.Key -in $filter} | ForEach-Object {$labels[$_.Key] = $_.Value}
($sync.GetEnumerator()).where{$PSItem.Key -in $filter} | ForEach-Object {$labels[$_.Key] = $_.Value}

$allCategories = $checkBoxes.Name | ForEach-Object {$sync.configs.applications.$_} | Select-Object -Unique -ExpandProperty category

Expand Down Expand Up @@ -14610,6 +14608,5 @@ Version : <a href="https://github.com/ChrisTitusTech/winutil/releases/tag/$($sy
"@
Show-CustomDialog -Message $authorInfo -Width 400
})

$sync["Form"].ShowDialog() | out-null
Stop-Transcript
Stop-Transcript

0 comments on commit 6c49a8f

Please sign in to comment.