mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 22:55:52 -06:00
Compile Winutil
This commit is contained in:
parent
ab384029f1
commit
6c49a8f2c9
15
winutil.ps1
15
winutil.ps1
@ -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 {
|
||||
@ -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
|
||||
@ -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)"
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user