mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-06-04 14:17:27 +00:00
Compare commits
23 Commits
d8193fd8ac
...
26.05.19
| Author | SHA1 | Date | |
|---|---|---|---|
| 5aa099f6e2 | |||
| 9d85eea4e5 | |||
| c765ffb317 | |||
| 82f51b4bf1 | |||
| d44c013464 | |||
| 753d47b9bc | |||
| 8034e85521 | |||
| a09736f9a8 | |||
| 24aaf9a3cf | |||
| f57b5f4ffa | |||
| 32d24c8024 | |||
| 743f9e3783 | |||
| 522c4471c0 | |||
| ea698f3791 | |||
| 8ffd15c9f3 | |||
| 6c1cb0caab | |||
| bcafbe6234 | |||
| fb54380b8b | |||
| 39f26133f4 | |||
| 09695f10aa | |||
| d1becc5310 | |||
| 543b8958ef | |||
| c39c54c7c1 |
@@ -15,101 +15,63 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: echo "command=false" >> $GITHUB_ENV
|
- name: Process slash command
|
||||||
|
uses: actions/github-script@v9
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const allowedUsers = ["ChrisTitusTech", "og-mrk", "Marterich", "MyDrift-user", "Real-MullaC", "CodingWonders", "GabiNun2", "FluffyPunk"];
|
||||||
|
const commenter = context.payload.comment.user.login;
|
||||||
|
|
||||||
- name: Check for /label command
|
// Authorization check first — before any parsing of comment content
|
||||||
id: check_label_command
|
if (!allowedUsers.includes(commenter)) {
|
||||||
run: |
|
console.log(`User ${commenter} is not in the allowlist. Skipping.`);
|
||||||
if [[ "${{ contains(github.event.comment.body, '/label') }}" == "true" ]]; then
|
return;
|
||||||
echo "command=true" >> $GITHUB_ENV
|
}
|
||||||
LABEL_NAME=$(echo "${{ github.event.comment.body }}" | awk -F"/label" '/\/label/ { match($2, /'\''([^'\'']*)'\''/, arr); if (arr[1] != "") print arr[1] }')
|
|
||||||
echo "label_command=true" >> $GITHUB_ENV
|
|
||||||
echo "label_name=${LABEL_NAME}" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "label_command=false" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Check for /unlabel command
|
// Read comment body as data, never interpolated into shell
|
||||||
id: check_unlabel_command
|
const body = context.payload.comment.body;
|
||||||
run: |
|
const issueNumber = context.issue.number;
|
||||||
if [[ "${{ contains(github.event.comment.body, '/unlabel') }}" == "true" ]]; then
|
const owner = context.repo.owner;
|
||||||
echo "command=true" >> $GITHUB_ENV
|
const repo = context.repo.repo;
|
||||||
UNLABEL_NAME=$(echo "${{ github.event.comment.body }}" | awk -F"/unlabel" '/\/unlabel/ { match($2, /'\''([^'\'']*)'\''/, arr); if (arr[1] != "") print arr[1] }')
|
|
||||||
echo "unlabel_command=true" >> $GITHUB_ENV
|
|
||||||
echo "unlabel_name=${UNLABEL_NAME}" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "unlabel_command=false" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Check for /close command
|
// /label 'name' or /label name
|
||||||
id: check_close_command
|
const labelMatch = body.match(/\/label\s+'([^']+)'|\/label\s+(\S+?)(?:\s|$)/);
|
||||||
run: |
|
if (labelMatch) {
|
||||||
if [[ "${{ contains(github.event.comment.body, '/close') }}" == "true" ]]; then
|
const labelName = (labelMatch[1] || labelMatch[2]).trim();
|
||||||
echo "command=true" >> $GITHUB_ENV
|
console.log(`Adding label: ${labelName}`);
|
||||||
echo "close_command=true" >> $GITHUB_ENV
|
await github.rest.issues.addLabels({
|
||||||
echo "reopen_command=false" >> $GITHUB_ENV
|
owner, repo, issue_number: issueNumber,
|
||||||
else
|
labels: [labelName],
|
||||||
echo "close_command=false" >> $GITHUB_ENV
|
});
|
||||||
fi
|
}
|
||||||
|
|
||||||
- name: Check for /open or /reopen command
|
// /unlabel 'name' or /unlabel name
|
||||||
id: check_reopen_command
|
const unlabelMatch = body.match(/\/unlabel\s+'([^']+)'|\/unlabel\s+(\S+?)(?:\s|$)/);
|
||||||
run: |
|
if (unlabelMatch) {
|
||||||
if [[ "${{ contains(github.event.comment.body, '/open') }}" == "true" ]] || [[ "${{ contains(github.event.comment.body, '/reopen') }}" == "true" ]]; then
|
const labelName = (unlabelMatch[1] || unlabelMatch[2]).trim();
|
||||||
echo "command=true" >> $GITHUB_ENV
|
console.log(`Removing label: ${labelName}`);
|
||||||
echo "reopen_command=true" >> $GITHUB_ENV
|
await github.rest.issues.removeLabel({
|
||||||
echo "close_command=false" >> $GITHUB_ENV
|
owner, repo, issue_number: issueNumber,
|
||||||
else
|
name: labelName,
|
||||||
echo "reopen_command=false" >> $GITHUB_ENV
|
});
|
||||||
fi
|
}
|
||||||
|
|
||||||
- name: Check if the user is allowed
|
// /close (optionally with 'not planned')
|
||||||
id: check_user
|
if (body.includes('/close')) {
|
||||||
if: env.command == 'true'
|
const stateReason = body.includes('not planned') ? 'not_planned' : 'completed';
|
||||||
run: |
|
console.log(`Closing issue (reason: ${stateReason})`);
|
||||||
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC" "CodingWonders" "GabiNun2" "FluffyPunk")
|
await github.rest.issues.update({
|
||||||
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then
|
owner, repo, issue_number: issueNumber,
|
||||||
echo "user=true" >> $GITHUB_ENV
|
state: 'closed',
|
||||||
else
|
state_reason: stateReason,
|
||||||
exit 0
|
});
|
||||||
fi
|
}
|
||||||
|
|
||||||
- name: Close issue
|
// /open or /reopen
|
||||||
if: env.user == 'true' && env.close_command == 'true'
|
if (body.includes('/open') || body.includes('/reopen')) {
|
||||||
env:
|
console.log('Reopening issue');
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
await github.rest.issues.update({
|
||||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
owner, repo, issue_number: issueNumber,
|
||||||
run: |
|
state: 'open',
|
||||||
echo Closing the issue...
|
});
|
||||||
if [[ "${{ contains(github.event.comment.body, 'not planned') }}" == "true" ]]; then
|
}
|
||||||
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }} --reason 'not planned'
|
|
||||||
else
|
|
||||||
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Reopen issue
|
|
||||||
if: env.user == 'true' && env.reopen_command == 'true'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
|
||||||
run: |
|
|
||||||
echo Reopening the issue...
|
|
||||||
gh issue reopen $ISSUE_NUMBER --repo ${{ github.repository }}
|
|
||||||
|
|
||||||
- name: Label issue
|
|
||||||
if: env.user == 'true' && env.label_command == 'true'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
|
||||||
run: |
|
|
||||||
echo Labeling the issue...
|
|
||||||
gh issue edit $ISSUE_NUMBER --repo ${{ github.repository }} --add-label "${{ env.label_name }}"
|
|
||||||
|
|
||||||
- name: Remove labels
|
|
||||||
if: env.user == 'true' && env.unlabel_command == 'true'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
|
||||||
run: |
|
|
||||||
echo Unlabeling the issue...
|
|
||||||
gh issue edit $ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "${{ env.unlabel_name }}"
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
config/feature.json
|
config/feature.json
|
||||||
labels: |
|
labels: |
|
||||||
automated
|
automated
|
||||||
documentation
|
skip-changelog
|
||||||
|
|
||||||
- name: Check outputs
|
- name: Check outputs
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -11,9 +11,6 @@
|
|||||||
|
|
||||||
winutil.pdb
|
winutil.pdb
|
||||||
|
|
||||||
### Preprocessor Hashes ###
|
|
||||||
.preprocessor_hashes.json
|
|
||||||
|
|
||||||
### Windows ###
|
### Windows ###
|
||||||
|
|
||||||
# Folder config file
|
# Folder config file
|
||||||
@@ -54,8 +51,6 @@ winutil.ps1
|
|||||||
|
|
||||||
binary/
|
binary/
|
||||||
|
|
||||||
.preprocessor_hashes.json
|
|
||||||
|
|
||||||
# Hugo Files
|
# Hugo Files
|
||||||
docs/public/
|
docs/public/
|
||||||
docs/.hugo_build.lock
|
docs/.hugo_build.lock
|
||||||
|
|||||||
+25
-119
@@ -1,144 +1,50 @@
|
|||||||
param (
|
param (
|
||||||
[switch]$Run,
|
[switch]$Run
|
||||||
[string]$Arguments
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if ((Get-Item ".\winutil.ps1" -ErrorAction SilentlyContinue).IsReadOnly) {
|
$OFS = "`r`n" # Makes it so we dont need to add -Raw to every Get-Content command
|
||||||
Remove-Item ".\winutil.ps1" -Force
|
|
||||||
}
|
|
||||||
|
|
||||||
$OFS = "`r`n"
|
|
||||||
$scriptname = "winutil.ps1"
|
|
||||||
$workingdir = $PSScriptRoot
|
|
||||||
|
|
||||||
# Variable to sync between runspaces
|
# Variable to sync between runspaces
|
||||||
$sync = [Hashtable]::Synchronized(@{})
|
$sync = [Hashtable]::Synchronized(@{})
|
||||||
$sync.configs = @{}
|
$sync.configs = @{}
|
||||||
|
|
||||||
function Update-Progress {
|
# Create the script in memory.
|
||||||
param (
|
$script = [System.Collections.Generic.List[string]]::new()
|
||||||
[Parameter(Mandatory, position=0)]
|
|
||||||
[string]$StatusMessage,
|
|
||||||
|
|
||||||
[Parameter(Mandatory, position=1)]
|
$script.Add(
|
||||||
[ValidateRange(0,100)]
|
((Get-Content -Path scripts\start.ps1) -replace '#{replaceme}', (Get-Date -Format 'yy.MM.dd'))
|
||||||
[int]$Percent,
|
|
||||||
|
|
||||||
[Parameter(position=2)]
|
|
||||||
[string]$Activity = "Compiling"
|
|
||||||
)
|
|
||||||
|
|
||||||
Write-Progress -Activity $Activity -Status $StatusMessage -PercentComplete $Percent
|
|
||||||
}
|
|
||||||
|
|
||||||
Update-Progress "Pre-req: Running Preprocessor..." 0
|
|
||||||
|
|
||||||
# Dot source the 'Invoke-Preprocessing' Function from 'tools/Invoke-Preprocessing.ps1' Script
|
|
||||||
$preprocessingFilePath = ".\tools\Invoke-Preprocessing.ps1"
|
|
||||||
. $preprocessingFilePath
|
|
||||||
|
|
||||||
$excludedFiles = @()
|
|
||||||
|
|
||||||
# Add directories only if they exist
|
|
||||||
if (Test-Path '.\.git\') { $excludedFiles += '.\.git\' }
|
|
||||||
if (Test-Path '.\binary\') { $excludedFiles += '.\binary\' }
|
|
||||||
|
|
||||||
# Add files that should always be excluded
|
|
||||||
$excludedFiles += @(
|
|
||||||
'.\.gitignore',
|
|
||||||
'.\.gitattributes',
|
|
||||||
'.\.github\CODEOWNERS',
|
|
||||||
'.\LICENSE',
|
|
||||||
"$preprocessingFilePath",
|
|
||||||
'*.png',
|
|
||||||
'.\.preprocessor_hashes.json'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
$msg = "Pre-req: Code Formatting"
|
$script.Add((Get-ChildItem -Path functions -Recurse -File | Get-Content))
|
||||||
Invoke-Preprocessing -WorkingDir "$workingdir" -ExcludedFiles $excludedFiles -ProgressStatusMessage $msg
|
|
||||||
|
|
||||||
# Create the script in memory.
|
Get-ChildItem config | ForEach-Object {
|
||||||
Update-Progress "Pre-req: Allocating Memory" 0
|
$obj = Get-Content -Path $_.FullName | ConvertFrom-Json
|
||||||
$script_content = [System.Collections.Generic.List[string]]::new()
|
|
||||||
|
|
||||||
Update-Progress "Adding: Version" 10
|
if ($_.Name -eq "applications.json") {
|
||||||
$script_content.Add($(Get-Content "scripts\start.ps1").replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)"))
|
$fixed = [ordered]@{}
|
||||||
|
foreach ($p in $obj.PSObject.Properties) {
|
||||||
Update-Progress "Adding: Functions" 20
|
$fixed["WPFInstall$($p.Name)"] = $p.Value
|
||||||
Get-ChildItem "functions" -Recurse -File | ForEach-Object {
|
|
||||||
$script_content.Add($(Get-Content $psitem.FullName))
|
|
||||||
}
|
|
||||||
Update-Progress "Adding: Config *.json" 40
|
|
||||||
Get-ChildItem "config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
|
|
||||||
$json = (Get-Content $psitem.FullName -Raw)
|
|
||||||
$jsonAsObject = $json | ConvertFrom-Json
|
|
||||||
|
|
||||||
# Add 'WPFInstall' as a prefix to every entry-name in 'applications.json' file
|
|
||||||
if ($psitem.Name -eq "applications.json") {
|
|
||||||
foreach ($appEntryName in $jsonAsObject.PSObject.Properties.Name) {
|
|
||||||
$appEntryContent = $jsonAsObject.$appEntryName
|
|
||||||
$jsonAsObject.PSObject.Properties.Remove($appEntryName)
|
|
||||||
$jsonAsObject | Add-Member -MemberType NoteProperty -Name "WPFInstall$appEntryName" -Value $appEntryContent
|
|
||||||
}
|
}
|
||||||
|
$obj = [pscustomobject]$fixed
|
||||||
}
|
}
|
||||||
|
|
||||||
# Line 90 requires no whitespace inside the here-strings, to keep formatting of the JSON in the final script.
|
$json = $obj | ConvertTo-Json -Depth 10
|
||||||
$json = @"
|
|
||||||
$($jsonAsObject | ConvertTo-Json -Depth 3)
|
|
||||||
"@
|
|
||||||
|
|
||||||
$sync.configs.$($psitem.BaseName) = $json | ConvertFrom-Json
|
$sync.configs[$_.BaseName] = $obj
|
||||||
$script_content.Add($(Write-Output "`$sync.configs.$($psitem.BaseName) = @'`r`n$json`r`n'@ `| ConvertFrom-Json" ))
|
$script.Add("`$sync.configs.$($_.BaseName) = @'`r`n$json`r`n'@ | ConvertFrom-Json")
|
||||||
}
|
}
|
||||||
|
|
||||||
# Read the entire XAML file as a single string, preserving line breaks
|
# Read the entire XAML file as a single string, preserving line breaks
|
||||||
$xaml = Get-Content "$workingdir\xaml\inputXML.xaml" -Raw
|
$xaml = Get-Content -Path xaml\inputXML.xaml
|
||||||
|
$script.Add('$inputXML = @''' + "`n" + $xaml + "`n" + '''@')
|
||||||
|
|
||||||
Update-Progress "Adding: Xaml " 90
|
$autounattendXml = Get-Content -Path tools\autounattend.xml
|
||||||
|
$script.Add("`$WinUtilAutounattendXml = @'`r`n$autounattendXml`r`n'@")
|
||||||
|
|
||||||
# Add the XAML content to $script_content using a here-string
|
$script.Add((Get-Content -Path scripts\main.ps1))
|
||||||
$script_content.Add(@"
|
|
||||||
`$inputXML = @'
|
|
||||||
$xaml
|
|
||||||
'@
|
|
||||||
"@)
|
|
||||||
|
|
||||||
Update-Progress "Adding: autounattend.xml" 95
|
Set-Content -Path winutil.ps1 -Value $script
|
||||||
$autounattendRaw = Get-Content "$workingdir\tools\autounattend.xml" -Raw
|
|
||||||
# Strip XML comments (<!-- ... -->, including multi-line)
|
|
||||||
$autounattendRaw = [regex]::Replace($autounattendRaw, '<!--.*?-->', '', [System.Text.RegularExpressions.RegexOptions]::Singleline)
|
|
||||||
# Drop blank lines and trim trailing whitespace per line
|
|
||||||
$autounattendXml = ($autounattendRaw -split "`r?`n" |
|
|
||||||
Where-Object { $_.Trim() -ne '' } |
|
|
||||||
ForEach-Object { $_.TrimEnd() }) -join "`r`n"
|
|
||||||
$script_content.Add(@"
|
|
||||||
`$WinUtilAutounattendXml = @'
|
|
||||||
$autounattendXml
|
|
||||||
'@
|
|
||||||
"@)
|
|
||||||
|
|
||||||
$script_content.Add($(Get-Content "scripts\main.ps1"))
|
if ($Run) {
|
||||||
|
.\Winutil.ps1
|
||||||
Update-Progress "Removing temporary files" 99
|
|
||||||
Remove-Item "xaml\inputApp.xaml" -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item "xaml\inputTweaks.xaml" -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item "xaml\inputFeatures.xaml" -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
Set-Content -Path "$scriptname" -Value ($script_content -join "`r`n") -Encoding ascii
|
|
||||||
Write-Progress -Activity "Compiling" -Completed
|
|
||||||
|
|
||||||
Update-Progress -Activity "Validating" -StatusMessage "Checking winutil.ps1 Syntax" -Percent 0
|
|
||||||
try {
|
|
||||||
Get-Command -Syntax .\winutil.ps1 | Out-Null
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Syntax Validation for 'winutil.ps1' has failed"
|
|
||||||
Write-Host "$($Error[0])" -ForegroundColor Red
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
Write-Progress -Activity "Validating" -Completed
|
|
||||||
|
|
||||||
if ($run) {
|
|
||||||
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
|
|
||||||
.\Winutil.ps1 $Arguments
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ You'll see a new file named `winutil.ps1`, which was created by `Compile.ps1` sc
|
|||||||
|
|
||||||
These are the sponsors that help keep this project alive with monthly contributions.
|
These are the sponsors that help keep this project alive with monthly contributions.
|
||||||
|
|
||||||
<!-- sponsors --><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="User avatar: Martin Stockzell" /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="User avatar: Dave J (WhamGeek)" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/FatBastard0"><img src="https://github.com/FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DursleyGuy"><img src="https://github.com/DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/DwayneTheRockLobster1"><img src="https://github.com/DwayneTheRockLobster1.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KieraKujisawa"><img src="https://github.com/KieraKujisawa.png" width="60px" alt="User avatar: Kiera Meredith" /></a><a href="https://github.com/andrewpayne68"><img src="https://github.com/andrewpayne68.png" width="60px" alt="User avatar: Andrew P" /></a><a href="https://github.com/Di3Z1E"><img src="https://github.com/Di3Z1E.png" width="60px" alt="User avatar: Di3Z1E" /></a><a href="https://github.com/AbdulVakeel"><img src="https://github.com/AbdulVakeel.png" width="60px" alt="User avatar: Abdul Vakeel Software Engineer" /></a><!-- sponsors -->
|
<!-- sponsors --><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="User avatar: Martin Stockzell" /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="User avatar: Dave J (WhamGeek)" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/FatBastard0"><img src="https://github.com/FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DursleyGuy"><img src="https://github.com/DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/DwayneTheRockLobster1"><img src="https://github.com/DwayneTheRockLobster1.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KieraKujisawa"><img src="https://github.com/KieraKujisawa.png" width="60px" alt="User avatar: Kiera Meredith" /></a><a href="https://github.com/andrewpayne68"><img src="https://github.com/andrewpayne68.png" width="60px" alt="User avatar: Andrew P" /></a><!-- sponsors -->
|
||||||
|
|
||||||
## 🏅 Thanks to all Contributors
|
## 🏅 Thanks to all Contributors
|
||||||
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.
|
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.
|
||||||
|
|||||||
@@ -686,7 +686,7 @@
|
|||||||
"category": "Multimedia Tools",
|
"category": "Multimedia Tools",
|
||||||
"choco": "mediainfo",
|
"choco": "mediainfo",
|
||||||
"content": "mpc-qt",
|
"content": "mpc-qt",
|
||||||
"description": "MPC-HC (Media Player Classic Home Cinema) is considered by many to be the quintessential media player for the Windows desktop. MPC-QT (Media Player Classic Qute Theater) aims to reproduce most of the interface and functionality of MPC-HC while using libmpv to play video instead of DirectShow.",
|
"description": "Media Player Classic Qute Theater",
|
||||||
"link": "https://github.com/mpc-qt/mpc-qt",
|
"link": "https://github.com/mpc-qt/mpc-qt",
|
||||||
"winget": "mpc-qt.mpc-qt",
|
"winget": "mpc-qt.mpc-qt",
|
||||||
"foss": true
|
"foss": true
|
||||||
|
|||||||
+1
-1
@@ -129,7 +129,7 @@
|
|||||||
"link": "https://winutil.christitus.com/dev/features/features/sandbox"
|
"link": "https://winutil.christitus.com/dev/features/features/sandbox"
|
||||||
},
|
},
|
||||||
"WPFFeatureInstall": {
|
"WPFFeatureInstall": {
|
||||||
"Content": "Run Features",
|
"Content": "Install Features",
|
||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Type": "Button",
|
"Type": "Button",
|
||||||
|
|||||||
+66
-1
@@ -607,6 +607,19 @@
|
|||||||
],
|
],
|
||||||
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/removeedge"
|
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/removeedge"
|
||||||
},
|
},
|
||||||
|
"WPFTweaksDisableBitLocker": {
|
||||||
|
"Content": "BitLocker - Disable",
|
||||||
|
"Description": "Disables BitLocker.",
|
||||||
|
"category": "Essential Tweaks",
|
||||||
|
"panel": "1",
|
||||||
|
"InvokeScript": [
|
||||||
|
"Disable-BitLocker -MountPoint $Env:SystemDrive"
|
||||||
|
],
|
||||||
|
"UndoScript": [
|
||||||
|
"Enable-BitLocker -MountPoint $Env:SystemDrive"
|
||||||
|
],
|
||||||
|
"link": "https://winutil.christitus.com/dev/tweaks/essential-tweaks/disablebitlocker"
|
||||||
|
},
|
||||||
"WPFTweaksUTC": {
|
"WPFTweaksUTC": {
|
||||||
"Content": "Date & Time - Set Time to UTC",
|
"Content": "Date & Time - Set Time to UTC",
|
||||||
"Description": "Essential for computers that are dual booting. Fixes the time sync with Linux systems.",
|
"Description": "Essential for computers that are dual booting. Fixes the time sync with Linux systems.",
|
||||||
@@ -807,7 +820,7 @@
|
|||||||
},
|
},
|
||||||
"WPFTweaksDeBloat": {
|
"WPFTweaksDeBloat": {
|
||||||
"Content": "Unwanted Pre-Installed Apps - Remove",
|
"Content": "Unwanted Pre-Installed Apps - Remove",
|
||||||
"Description": "This will remove a bunch of Windows pre-installed applications which most people dont want on there system.",
|
"Description": "This will remove a bunch of Windows pre-installed applications which most people dont want on their system.",
|
||||||
"category": "Essential Tweaks",
|
"category": "Essential Tweaks",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"appx": [
|
"appx": [
|
||||||
@@ -1461,6 +1474,14 @@
|
|||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"OriginalValue": "5",
|
"OriginalValue": "5",
|
||||||
"DefaultState": "true"
|
"DefaultState": "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers",
|
||||||
|
"Name": "DisableOverlays",
|
||||||
|
"Value": "1",
|
||||||
|
"Type": "DWord",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"DefaultState": "false"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/multiplaneoverlay"
|
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/multiplaneoverlay"
|
||||||
@@ -1741,6 +1762,50 @@
|
|||||||
],
|
],
|
||||||
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/taskview"
|
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/taskview"
|
||||||
},
|
},
|
||||||
|
"WPFToggleGameMode": {
|
||||||
|
"Content": "Game Mode",
|
||||||
|
"Description": "If enabled, Windows prioritizes gaming performance by allocating system resources. Disable for audio/video production to prevent interference.",
|
||||||
|
"category": "Customize Preferences",
|
||||||
|
"panel": "2",
|
||||||
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\GameBar",
|
||||||
|
"Name": "AllowAutoGameMode",
|
||||||
|
"Value": "1",
|
||||||
|
"Type": "DWord",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"DefaultState": "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\GameBar",
|
||||||
|
"Name": "AutoGameModeEnabled",
|
||||||
|
"Value": "1",
|
||||||
|
"Type": "DWord",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"DefaultState": "true"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/gamemode"
|
||||||
|
},
|
||||||
|
"WPFToggleLongPaths": {
|
||||||
|
"Content": "Enable Long Paths",
|
||||||
|
"Description": "Enables support for file paths longer than 260 characters.",
|
||||||
|
"category": "Customize Preferences",
|
||||||
|
"panel": "2",
|
||||||
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\FileSystem",
|
||||||
|
"Name": "LongPathsEnabled",
|
||||||
|
"Value": "1",
|
||||||
|
"Type": "DWord",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"DefaultState": "false"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/longpaths"
|
||||||
|
},
|
||||||
"WPFOOSUbutton": {
|
"WPFOOSUbutton": {
|
||||||
"Content": "O&O ShutUp10++ - Run",
|
"Content": "O&O ShutUp10++ - Run",
|
||||||
"category": "z__Advanced Tweaks - CAUTION",
|
"category": "z__Advanced Tweaks - CAUTION",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "System Tray Battery Percentage"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1255}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1268}
|
||||||
"WPFToggleBatteryPercentage": {
|
"WPFToggleBatteryPercentage": {
|
||||||
"Content": "System Tray Battery Percentage",
|
"Content": "System Tray Battery Percentage",
|
||||||
"Description": "If enabled, Shows numeric battery percentage next to the battery icon in the system tray.",
|
"Description": "If enabled, Shows numeric battery percentage next to the battery icon in the system tray.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Start Menu Bing Search"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1582}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1603}
|
||||||
"WPFToggleBingSearch": {
|
"WPFToggleBingSearch": {
|
||||||
"Content": "Start Menu Bing Search",
|
"Content": "Start Menu Bing Search",
|
||||||
"Description": "If enabled, Bing web search results will be included in your Start Menu search.",
|
"Description": "If enabled, Bing web search results will be included in your Start Menu search.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Dark Theme for Windows"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1273}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1286}
|
||||||
"WPFToggleDarkMode": {
|
"WPFToggleDarkMode": {
|
||||||
"Content": "Dark Theme for Windows",
|
"Content": "Dark Theme for Windows",
|
||||||
"Description": "Enable/Disable Dark Mode.",
|
"Description": "Enable/Disable Dark Mode.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "BSoD Verbose Mode"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1229}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1242}
|
||||||
"WPFToggleDetailedBSoD": {
|
"WPFToggleDetailedBSoD": {
|
||||||
"Content": "BSoD Verbose Mode",
|
"Content": "BSoD Verbose Mode",
|
||||||
"Description": "If enabled, you will see a detailed Blue Screen of Death (BSOD) with more information.",
|
"Description": "If enabled, you will see a detailed Blue Screen of Death (BSOD) with more information.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Cross-Device Resume"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1211}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1224}
|
||||||
"WPFToggleDisableCrossDeviceResume": {
|
"WPFToggleDisableCrossDeviceResume": {
|
||||||
"Content": "Cross-Device Resume",
|
"Content": "Cross-Device Resume",
|
||||||
"Description": "This tweak controls the Resume function in Windows 11 24H2 and later, which allows you to resume an activity from a mobile device and vice-versa.",
|
"Description": "This tweak controls the Resume function in Windows 11 24H2 and later, which allows you to resume an activity from a mobile device and vice-versa.",
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
title: "Game Mode"
|
||||||
|
description: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1765}
|
||||||
|
"WPFToggleGameMode": {
|
||||||
|
"Content": "Game Mode",
|
||||||
|
"Description": "If enabled, Windows prioritizes gaming performance by allocating system resources. Disable for audio/video production to prevent interference.",
|
||||||
|
"category": "Customize Preferences",
|
||||||
|
"panel": "2",
|
||||||
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\GameBar",
|
||||||
|
"Name": "AllowAutoGameMode",
|
||||||
|
"Value": "1",
|
||||||
|
"Type": "DWord",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"DefaultState": "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\GameBar",
|
||||||
|
"Name": "AutoGameModeEnabled",
|
||||||
|
"Value": "1",
|
||||||
|
"Type": "DWord",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"DefaultState": "true"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
```
|
||||||
|
|
||||||
|
## Registry Changes
|
||||||
|
|
||||||
|
Applications and System Components store and retrieve configuration data to modify Windows settings, so we can use the registry to change many settings in one place.
|
||||||
|
|
||||||
|
You can find information about the registry on [Wikipedia](https://www.wikiwand.com/en/Windows_Registry) and [Microsoft's Website](https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry).
|
||||||
@@ -3,7 +3,7 @@ title: "File Explorer Hidden Files"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1343}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1356}
|
||||||
"WPFToggleHiddenFiles": {
|
"WPFToggleHiddenFiles": {
|
||||||
"Content": "File Explorer Hidden Files",
|
"Content": "File Explorer Hidden Files",
|
||||||
"Description": "If enabled, Hidden Files will be shown.",
|
"Description": "If enabled, Hidden Files will be shown.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Settings Home Page"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1564}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1585}
|
||||||
"WPFToggleHideSettingsHome": {
|
"WPFToggleHideSettingsHome": {
|
||||||
"Content": "Settings Home Page",
|
"Content": "Settings Home Page",
|
||||||
"Description": "Enable or disable the Home Page in the Windows Settings app.",
|
"Description": "Enable or disable the Home Page in the Windows Settings app.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Logon Screen Acrylic Blur"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1600}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1621}
|
||||||
"WPFToggleLoginBlur": {
|
"WPFToggleLoginBlur": {
|
||||||
"Content": "Logon Screen Acrylic Blur",
|
"Content": "Logon Screen Acrylic Blur",
|
||||||
"Description": "If disabled, the acrylic blur effect will be removed on the Windows 10/11 login screen background.",
|
"Description": "If disabled, the acrylic blur effect will be removed on the Windows 10/11 login screen background.",
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
title: "Enable Long Paths"
|
||||||
|
description: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1791}
|
||||||
|
"WPFToggleLongPaths": {
|
||||||
|
"Content": "Enable Long Paths",
|
||||||
|
"Description": "Enables support for file paths longer than 260 characters.",
|
||||||
|
"category": "Customize Preferences",
|
||||||
|
"panel": "2",
|
||||||
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\FileSystem",
|
||||||
|
"Name": "LongPathsEnabled",
|
||||||
|
"Value": "1",
|
||||||
|
"Type": "DWord",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"DefaultState": "false"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
```
|
||||||
|
|
||||||
|
## Registry Changes
|
||||||
|
|
||||||
|
Applications and System Components store and retrieve configuration data to modify Windows settings, so we can use the registry to change many settings in one place.
|
||||||
|
|
||||||
|
You can find information about the registry on [Wikipedia](https://www.wikiwand.com/en/Windows_Registry) and [Microsoft's Website](https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry).
|
||||||
@@ -3,7 +3,7 @@ title: "Mouse Acceleration"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1468}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1489}
|
||||||
"WPFToggleMouseAcceleration": {
|
"WPFToggleMouseAcceleration": {
|
||||||
"Content": "Mouse Acceleration",
|
"Content": "Mouse Acceleration",
|
||||||
"Description": "If enabled, the Cursor movement is affected by the speed of your physical mouse movements.",
|
"Description": "If enabled, the Cursor movement is affected by the speed of your physical mouse movements.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Multiplane Overlay"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1450}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1463}
|
||||||
"WPFToggleMultiplaneOverlay": {
|
"WPFToggleMultiplaneOverlay": {
|
||||||
"Content": "Multiplane Overlay",
|
"Content": "Multiplane Overlay",
|
||||||
"Description": "Enable or disable the Multiplane Overlay, which can sometimes cause issues with graphics cards.",
|
"Description": "Enable or disable the Multiplane Overlay, which can sometimes cause issues with graphics cards.",
|
||||||
@@ -18,6 +18,14 @@ description: ""
|
|||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"OriginalValue": "5",
|
"OriginalValue": "5",
|
||||||
"DefaultState": "true"
|
"DefaultState": "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers",
|
||||||
|
"Name": "DisableOverlays",
|
||||||
|
"Value": "1",
|
||||||
|
"Type": "DWord",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"DefaultState": "false"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Microsoft Outlook New Version"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1389}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1402}
|
||||||
"WPFToggleNewOutlook": {
|
"WPFToggleNewOutlook": {
|
||||||
"Content": "Microsoft Outlook New Version",
|
"Content": "Microsoft Outlook New Version",
|
||||||
"Description": "If disabled, it removes the new Outlook toggle, disables the new Outlook migration, and ensures the classic Outlook application is used.",
|
"Description": "If disabled, it removes the new Outlook toggle, disables the new Outlook migration, and ensures the classic Outlook application is used.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Num Lock on Startup"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1502}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1523}
|
||||||
"WPFToggleNumLock": {
|
"WPFToggleNumLock": {
|
||||||
"Content": "Num Lock on Startup",
|
"Content": "Num Lock on Startup",
|
||||||
"Description": "Toggle the Num Lock key state when your computer starts.",
|
"Description": "Toggle the Num Lock key state when your computer starts.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "S3 Sleep"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1546}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1567}
|
||||||
"WPFToggleS3Sleep": {
|
"WPFToggleS3Sleep": {
|
||||||
"Content": "S3 Sleep",
|
"Content": "S3 Sleep",
|
||||||
"Description": "Toggles between Modern Standby and S3 Sleep.",
|
"Description": "Toggles between Modern Standby and S3 Sleep.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "File Explorer File Extensions"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1315}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1328}
|
||||||
"WPFToggleShowExt": {
|
"WPFToggleShowExt": {
|
||||||
"Content": "File Explorer File Extensions",
|
"Content": "File Explorer File Extensions",
|
||||||
"Description": "If enabled, File extensions (e.g., .txt, .jpg) are visible.",
|
"Description": "If enabled, File extensions (e.g., .txt, .jpg) are visible.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "S0 Sleep Network Connectivity"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1528}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1549}
|
||||||
"WPFToggleStandbyFix": {
|
"WPFToggleStandbyFix": {
|
||||||
"Content": "S0 Sleep Network Connectivity",
|
"Content": "S0 Sleep Network Connectivity",
|
||||||
"Description": "Enable or disable network connectivity during S0 Sleep.",
|
"Description": "Enable or disable network connectivity during S0 Sleep.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Start Menu Recommendations"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1618}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1639}
|
||||||
"WPFToggleStartMenuRecommendations": {
|
"WPFToggleStartMenuRecommendations": {
|
||||||
"Content": "Start Menu Recommendations",
|
"Content": "Start Menu Recommendations",
|
||||||
"Description": "If disabled, then you will not see recommendations in the Start Menu. WARNING: This will also disable Windows Spotlight on your Lock Screen as a side effect.",
|
"Description": "If disabled, then you will not see recommendations in the Start Menu. WARNING: This will also disable Windows Spotlight on your Lock Screen as a side effect.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Sticky Keys"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1662}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1683}
|
||||||
"WPFToggleStickyKeys": {
|
"WPFToggleStickyKeys": {
|
||||||
"Content": "Sticky Keys",
|
"Content": "Sticky Keys",
|
||||||
"Description": "If enabled, Sticky Keys is activated. Sticky keys is an accessibility feature of some graphical user interfaces which assists users who have physical disabilities or help users reduce repetitive strain injury.",
|
"Description": "If enabled, Sticky Keys is activated. Sticky keys is an accessibility feature of some graphical user interfaces which assists users who have physical disabilities or help users reduce repetitive strain injury.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Taskbar Task View Icon"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1726}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1747}
|
||||||
"WPFToggleTaskView": {
|
"WPFToggleTaskView": {
|
||||||
"Content": "Taskbar Task View Icon",
|
"Content": "Taskbar Task View Icon",
|
||||||
"Description": "If enabled, Task View Button in Taskbar will be shown.",
|
"Description": "If enabled, Task View Button in Taskbar will be shown.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Taskbar Centered Icons"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1680}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1701}
|
||||||
"WPFToggleTaskbarAlignment": {
|
"WPFToggleTaskbarAlignment": {
|
||||||
"Content": "Taskbar Centered Icons",
|
"Content": "Taskbar Centered Icons",
|
||||||
"Description": "[Windows 11] If enabled, the Taskbar Items will be shown on the Center, otherwise the Taskbar Items will be shown on the Left.",
|
"Description": "[Windows 11] If enabled, the Taskbar Items will be shown on the Center, otherwise the Taskbar Items will be shown on the Left.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Taskbar Search Icon"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1708}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1729}
|
||||||
"WPFToggleTaskbarSearch": {
|
"WPFToggleTaskbarSearch": {
|
||||||
"Content": "Taskbar Search Icon",
|
"Content": "Taskbar Search Icon",
|
||||||
"Description": "If enabled, Search Button will be on the Taskbar.",
|
"Description": "If enabled, Search Button will be on the Taskbar.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Logon Verbose Mode"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1371}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1384}
|
||||||
"WPFToggleVerboseLogon": {
|
"WPFToggleVerboseLogon": {
|
||||||
"Content": "Logon Verbose Mode",
|
"Content": "Logon Verbose Mode",
|
||||||
"Description": "Show detailed messages during the login process for troubleshooting and diagnostics.",
|
"Description": "Show detailed messages during the login process for troubleshooting and diagnostics.",
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ title: "Unwanted Pre-Installed Apps - Remove"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=808}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=821}
|
||||||
"WPFTweaksDeBloat": {
|
"WPFTweaksDeBloat": {
|
||||||
"Content": "Unwanted Pre-Installed Apps - Remove",
|
"Content": "Unwanted Pre-Installed Apps - Remove",
|
||||||
"Description": "This will remove a bunch of Windows pre-installed applications which most people dont want on there system.",
|
"Description": "This will remove a bunch of Windows pre-installed applications which most people dont want on their system.",
|
||||||
"category": "Essential Tweaks",
|
"category": "Essential Tweaks",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"appx": [
|
"appx": [
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Temporary Files - Remove"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1106}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1119}
|
||||||
"WPFTweaksDeleteTempFiles": {
|
"WPFTweaksDeleteTempFiles": {
|
||||||
"Content": "Temporary Files - Remove",
|
"Content": "Temporary Files - Remove",
|
||||||
"Description": "Erases TEMP Folders.",
|
"Description": "Erases TEMP Folders.",
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
title: "BitLocker - Disable"
|
||||||
|
description: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=610}
|
||||||
|
"WPFTweaksDisableBitLocker": {
|
||||||
|
"Content": "BitLocker - Disable",
|
||||||
|
"Description": "Disables BitLocker.",
|
||||||
|
"category": "Essential Tweaks",
|
||||||
|
"panel": "1",
|
||||||
|
"InvokeScript": [
|
||||||
|
"Disable-BitLocker -MountPoint $Env:SystemDrive"
|
||||||
|
],
|
||||||
|
"UndoScript": [
|
||||||
|
"Enable-BitLocker -MountPoint $Env:SystemDrive"
|
||||||
|
],
|
||||||
|
```
|
||||||
@@ -3,7 +3,7 @@ title: "File Explorer Automatic Folder Discovery - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1775}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1840}
|
||||||
"WPFTweaksDisableExplorerAutoDiscovery": {
|
"WPFTweaksDisableExplorerAutoDiscovery": {
|
||||||
"Content": "File Explorer Automatic Folder Discovery - Disable",
|
"Content": "File Explorer Automatic Folder Discovery - Disable",
|
||||||
"Description": "Windows Explorer automatically tries to guess the type of the folder based on its contents, slowing down the browsing experience. WARNING! Will disable File Explorer grouping.",
|
"Description": "Windows Explorer automatically tries to guess the type of the folder based on its contents, slowing down the browsing experience. WARNING! Will disable File Explorer grouping.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Disk Cleanup - Run"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1093}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1106}
|
||||||
"WPFTweaksDiskCleanup": {
|
"WPFTweaksDiskCleanup": {
|
||||||
"Content": "Disk Cleanup - Run",
|
"Content": "Disk Cleanup - Run",
|
||||||
"Description": "Runs Disk Cleanup on Drive C: and removes old Windows Updates.",
|
"Description": "Runs Disk Cleanup on Drive C: and removes old Windows Updates.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "End Task With Right Click - Enable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=876}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=889}
|
||||||
"WPFTweaksEndTaskOnTaskbar": {
|
"WPFTweaksEndTaskOnTaskbar": {
|
||||||
"Content": "End Task With Right Click - Enable",
|
"Content": "End Task With Right Click - Enable",
|
||||||
"Description": "Enables option to end task when right clicking a program in the taskbar.",
|
"Description": "Enables option to end task when right clicking a program in the taskbar.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "PowerShell 7 Telemetry - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=892}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=905}
|
||||||
"WPFTweaksPowershell7Tele": {
|
"WPFTweaksPowershell7Tele": {
|
||||||
"Content": "PowerShell 7 Telemetry - Disable",
|
"Content": "PowerShell 7 Telemetry - Disable",
|
||||||
"Description": "Creates an Environment Variable called 'POWERSHELL_TELEMETRY_OPTOUT' with a value of '1' which will tell PowerShell 7 to not send Telemetry Data.",
|
"Description": "Creates an Environment Variable called 'POWERSHELL_TELEMETRY_OPTOUT' with a value of '1' which will tell PowerShell 7 to not send Telemetry Data.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Restore Point - Create"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=849}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=862}
|
||||||
"WPFTweaksRestorePoint": {
|
"WPFTweaksRestorePoint": {
|
||||||
"Content": "Restore Point - Create",
|
"Content": "Restore Point - Create",
|
||||||
"Description": "Creates a restore point at runtime in case a revert is needed from WinUtil modifications.",
|
"Description": "Creates a restore point at runtime in case a revert is needed from WinUtil modifications.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Windows Platform Binary Table (WPBT) - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=961}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=974}
|
||||||
"WPFTweaksWPBT": {
|
"WPFTweaksWPBT": {
|
||||||
"Content": "Windows Platform Binary Table (WPBT) - Disable",
|
"Content": "Windows Platform Binary Table (WPBT) - Disable",
|
||||||
"Description": "If enabled, WPBT allows your computer vendor to execute programs at boot time, such as anti-theft software, software drivers, as well as force install software without user consent. Poses potential security risk.",
|
"Description": "If enabled, WPBT allows your computer vendor to execute programs at boot time, such as anti-theft software, software drivers, as well as force install software without user consent. Poses potential security risk.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Adobe URL Block List - Enable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1041}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1054}
|
||||||
"WPFTweaksBlockAdobeNet": {
|
"WPFTweaksBlockAdobeNet": {
|
||||||
"Content": "Adobe URL Block List - Enable",
|
"Content": "Adobe URL Block List - Enable",
|
||||||
"Description": "Reduces user interruptions by selectively blocking connections to Adobe's activation and telemetry servers. Credit: Ruddernation-Designs",
|
"Description": "Reduces user interruptions by selectively blocking connections to Adobe's activation and telemetry servers. Credit: Ruddernation-Designs",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Background Apps - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1179}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1192}
|
||||||
"WPFTweaksDisableBGapps": {
|
"WPFTweaksDisableBGapps": {
|
||||||
"Content": "Background Apps - Disable",
|
"Content": "Background Apps - Disable",
|
||||||
"Description": "Disables all Microsoft Store apps from running in the background, which has to be done individually since Windows 11.",
|
"Description": "Disables all Microsoft Store apps from running in the background, which has to be done individually since Windows 11.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Fullscreen Optimizations - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1195}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1208}
|
||||||
"WPFTweaksDisableFSO": {
|
"WPFTweaksDisableFSO": {
|
||||||
"Content": "Fullscreen Optimizations - Disable",
|
"Content": "Fullscreen Optimizations - Disable",
|
||||||
"Description": "Disables FSO in all applications. NOTE: This will disable Color Management in Exclusive Fullscreen.",
|
"Description": "Disables FSO in all applications. NOTE: This will disable Color Management in Exclusive Fullscreen.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "IPv6 - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1157}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1170}
|
||||||
"WPFTweaksDisableIPv6": {
|
"WPFTweaksDisableIPv6": {
|
||||||
"Content": "IPv6 - Disable",
|
"Content": "IPv6 - Disable",
|
||||||
"Description": "Disables IPv6.",
|
"Description": "Disables IPv6.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "System Tray Notifications & Calendar - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1018}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1031}
|
||||||
"WPFTweaksDisableNotifications": {
|
"WPFTweaksDisableNotifications": {
|
||||||
"Content": "System Tray Notifications & Calendar - Disable",
|
"Content": "System Tray Notifications & Calendar - Disable",
|
||||||
"Description": "Disables all Notifications INCLUDING Calendar.",
|
"Description": "Disables all Notifications INCLUDING Calendar.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Visual Effects - Set to Best Performance"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=686}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=699}
|
||||||
"WPFTweaksDisplay": {
|
"WPFTweaksDisplay": {
|
||||||
"Content": "Visual Effects - Set to Best Performance",
|
"Content": "Visual Effects - Set to Best Performance",
|
||||||
"Description": "Sets the system preferences to performance. You can do this manually with sysdm.cpl as well.",
|
"Description": "Sets the system preferences to performance. You can do this manually with sysdm.cpl as well.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "IPv6 - Set IPv4 as Preferred"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1119}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1132}
|
||||||
"WPFTweaksIPv46": {
|
"WPFTweaksIPv46": {
|
||||||
"Content": "IPv6 - Set IPv4 as Preferred",
|
"Content": "IPv6 - Set IPv4 as Preferred",
|
||||||
"Description": "Setting the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.",
|
"Description": "Setting the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Razer Software Auto-Install - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=977}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=990}
|
||||||
"WPFTweaksRazerBlock": {
|
"WPFTweaksRazerBlock": {
|
||||||
"Content": "Razer Software Auto-Install - Disable",
|
"Content": "Razer Software Auto-Install - Disable",
|
||||||
"Description": "Blocks ALL Razer Software installations. The hardware works fine without any software.",
|
"Description": "Blocks ALL Razer Software installations. The hardware works fine without any software.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "File Explorer Home and Gallery - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=663}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=676}
|
||||||
"WPFTweaksRemoveHome": {
|
"WPFTweaksRemoveHome": {
|
||||||
"Content": "File Explorer Home and Gallery - Disable",
|
"Content": "File Explorer Home and Gallery - Disable",
|
||||||
"Description": "Removes the Home and Gallery from Explorer and sets This PC as default.",
|
"Description": "Removes the Home and Gallery from Explorer and sets This PC as default.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Microsoft OneDrive - Remove"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=626}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=639}
|
||||||
"WPFTweaksRemoveOneDrive": {
|
"WPFTweaksRemoveOneDrive": {
|
||||||
"Content": "Microsoft OneDrive - Remove",
|
"Content": "Microsoft OneDrive - Remove",
|
||||||
"Description": "Denies permission to remove OneDrive user files, then uses its own uninstaller to remove it and restores the original permission afterward.",
|
"Description": "Denies permission to remove OneDrive user files, then uses its own uninstaller to remove it and restores the original permission afterward.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Right-Click Menu Previous Layout - Enable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1071}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1084}
|
||||||
"WPFTweaksRightClickMenu": {
|
"WPFTweaksRightClickMenu": {
|
||||||
"Content": "Right-Click Menu Previous Layout - Enable",
|
"Content": "Right-Click Menu Previous Layout - Enable",
|
||||||
"Description": "Restores the classic context menu when right-clicking in File Explorer, replacing the simplified Windows 11 version.",
|
"Description": "Restores the classic context menu when right-clicking in File Explorer, replacing the simplified Windows 11 version.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Storage Sense - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=905}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=918}
|
||||||
"WPFTweaksStorage": {
|
"WPFTweaksStorage": {
|
||||||
"Content": "Storage Sense - Disable",
|
"Content": "Storage Sense - Disable",
|
||||||
"Description": "Storage Sense deletes temp files automatically.",
|
"Description": "Storage Sense deletes temp files automatically.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Teredo - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1135}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1148}
|
||||||
"WPFTweaksTeredo": {
|
"WPFTweaksTeredo": {
|
||||||
"Content": "Teredo - Disable",
|
"Content": "Teredo - Disable",
|
||||||
"Description": "Teredo network tunneling is an IPv6 feature that can cause additional latency, but may cause problems with some games.",
|
"Description": "Teredo network tunneling is an IPv6 feature that can cause additional latency, but may cause problems with some games.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Date & Time - Set Time to UTC"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=610}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=623}
|
||||||
"WPFTweaksUTC": {
|
"WPFTweaksUTC": {
|
||||||
"Content": "Date & Time - Set Time to UTC",
|
"Content": "Date & Time - Set Time to UTC",
|
||||||
"Description": "Essential for computers that are dual booting. Fixes the time sync with Linux systems.",
|
"Description": "Essential for computers that are dual booting. Fixes the time sync with Linux systems.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Windows AI - Disable"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=921}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=934}
|
||||||
"WPFTweaksWindowsAI": {
|
"WPFTweaksWindowsAI": {
|
||||||
"Content": "Windows AI - Disable",
|
"Content": "Windows AI - Disable",
|
||||||
"Description": "Removes or disables all ai features and packages",
|
"Description": "Removes or disables all ai features and packages",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Xbox & Gaming Components - Remove"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=785}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=798}
|
||||||
"WPFTweaksXboxRemoval": {
|
"WPFTweaksXboxRemoval": {
|
||||||
"Content": "Xbox & Gaming Components - Remove",
|
"Content": "Xbox & Gaming Components - Remove",
|
||||||
"Description": "Removes Xbox services, the Xbox app, Game Bar, and related authentication components.",
|
"Description": "Removes Xbox services, the Xbox app, Game Bar, and related authentication components.",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "DNS - Set to:"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1751}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1816}
|
||||||
"WPFchangedns": {
|
"WPFchangedns": {
|
||||||
"Content": "DNS - Set to:",
|
"Content": "DNS - Set to:",
|
||||||
"category": "z__Advanced Tweaks - CAUTION",
|
"category": "z__Advanced Tweaks - CAUTION",
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ module github.com/ChrisTitusTech/WinUtil
|
|||||||
|
|
||||||
go 1.26
|
go 1.26
|
||||||
|
|
||||||
require github.com/imfing/hextra v0.12.1 // indirect
|
require github.com/imfing/hextra v0.12.3 // indirect
|
||||||
|
|||||||
+2
-8
@@ -1,8 +1,2 @@
|
|||||||
github.com/imfing/hextra v0.9.7 h1:Zg5n24us36Bn/S/5mEUPkRW6uwE6vHHEqWSgN0bPXaM=
|
github.com/imfing/hextra v0.12.3 h1:DZHY2rUWYteyzjlHi9r4n7Bb5e2Q+6LXe4C1Dqn0ZjM=
|
||||||
github.com/imfing/hextra v0.9.7/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI=
|
github.com/imfing/hextra v0.12.3/go.mod h1:vi+yhpq8YPp/aghvJlNKVnJKcPJ/VyAEcfC1BSV9ARo=
|
||||||
github.com/imfing/hextra v0.11.1 h1:8pTc4ReYbzGTHAnyiebmlT3ijFfIXiGu1r7tM/UGjFI=
|
|
||||||
github.com/imfing/hextra v0.11.1/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI=
|
|
||||||
github.com/imfing/hextra v0.12.0 h1:f6y35hW/WDJEcx9S0dOmbICOBxYE0PmP6IJFsTUgVyY=
|
|
||||||
github.com/imfing/hextra v0.12.0/go.mod h1:YAv8XRNSmcqjieFwI7fVQK1AoY2Do+45DO9HGqxSGu4=
|
|
||||||
github.com/imfing/hextra v0.12.1 h1:3t1n0bmJbDzSTVfht93UDcfF1BXMRjeFojA071ri2l8=
|
|
||||||
github.com/imfing/hextra v0.12.1/go.mod h1:vi+yhpq8YPp/aghvJlNKVnJKcPJ/VyAEcfC1BSV9ARo=
|
|
||||||
|
|||||||
@@ -3,78 +3,134 @@ function Find-AppsByNameOrDescription {
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Searches through the Apps on the Install Tab and hides all entries that do not match the string
|
Searches through the Apps on the Install Tab and hides all entries that do not match the string
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Filters application entries by name or description using literal string matching.
|
||||||
|
Respects collapsed category state and handles null $sync gracefully.
|
||||||
|
|
||||||
.PARAMETER SearchString
|
.PARAMETER SearchString
|
||||||
The string to be searched for
|
The string to be searched for. Wildcards are treated as literal characters.
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
- Uses module-scope $sync (no parameter needed; inherits from caller's scope)
|
||||||
|
- Performs literal matching (no wildcard expansion)
|
||||||
|
- Safely handles missing hashtable keys and null UI elements
|
||||||
|
- Protected by try/catch to prevent UI thread crashes
|
||||||
#>
|
#>
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory=$false)]
|
[Parameter(Mandatory = $false)]
|
||||||
[string]$SearchString = ""
|
[string]$SearchString = ""
|
||||||
)
|
)
|
||||||
# Reset the visibility if the search string is empty or the search is cleared
|
|
||||||
if ([string]::IsNullOrWhiteSpace($SearchString)) {
|
|
||||||
$sync.ItemsControl.Items | ForEach-Object {
|
|
||||||
# Each item is a StackPanel container
|
|
||||||
$_.Visibility = [Windows.Visibility]::Visible
|
|
||||||
|
|
||||||
|
# Validate that $sync exists and has required structure
|
||||||
|
if ($null -eq $sync) {
|
||||||
|
Write-Warning "Find-AppsByNameOrDescription: Global `$sync not found. Aborting search."
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($null -eq $sync.ItemsControl) {
|
||||||
|
Write-Warning "Find-AppsByNameOrDescription: `$sync.ItemsControl not initialized. Aborting search."
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($null -eq $sync.configs -or $null -eq $sync.configs.applicationsHashtable) {
|
||||||
|
Write-Warning "Find-AppsByNameOrDescription: `$sync.configs.applicationsHashtable not initialized. Aborting search."
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
# Reset the visibility if the search string is empty or the search is cleared
|
||||||
|
if ([string]::IsNullOrWhiteSpace($SearchString)) {
|
||||||
|
$sync.ItemsControl.Items | ForEach-Object {
|
||||||
|
# Each item is a StackPanel container
|
||||||
|
$_.Visibility = [Windows.Visibility]::Visible
|
||||||
|
|
||||||
|
if ($_.Children.Count -ge 2) {
|
||||||
|
$categoryLabel = $_.Children[0]
|
||||||
|
$wrapPanel = $_.Children[1]
|
||||||
|
|
||||||
|
# Keep category label visible
|
||||||
|
$categoryLabel.Visibility = [Windows.Visibility]::Visible
|
||||||
|
|
||||||
|
# Respect the collapsed state of categories (indicated by + prefix)
|
||||||
|
if ($categoryLabel.Content -like "+*") {
|
||||||
|
$wrapPanel.Visibility = [Windows.Visibility]::Collapsed
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$wrapPanel.Visibility = [Windows.Visibility]::Visible
|
||||||
|
}
|
||||||
|
|
||||||
|
# Show all apps within the category
|
||||||
|
$wrapPanel.Children | ForEach-Object {
|
||||||
|
$_.Visibility = [Windows.Visibility]::Visible
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
# Escape wildcard characters for literal matching
|
||||||
|
$escapedSearchString = [System.Management.Automation.WildcardPattern]::Escape($SearchString)
|
||||||
|
|
||||||
|
# Perform search
|
||||||
|
$sync.ItemsControl.Items | ForEach-Object {
|
||||||
|
# Each item is a StackPanel container with Children[0] = label, Children[1] = WrapPanel
|
||||||
if ($_.Children.Count -ge 2) {
|
if ($_.Children.Count -ge 2) {
|
||||||
$categoryLabel = $_.Children[0]
|
$categoryLabel = $_.Children[0]
|
||||||
$wrapPanel = $_.Children[1]
|
$wrapPanel = $_.Children[1]
|
||||||
|
$categoryHasMatch = $false
|
||||||
|
|
||||||
# Keep category label visible
|
# Keep category label visible
|
||||||
$categoryLabel.Visibility = [Windows.Visibility]::Visible
|
$categoryLabel.Visibility = [Windows.Visibility]::Visible
|
||||||
|
|
||||||
# Respect the collapsed state of categories (indicated by + prefix)
|
# Search through apps in this category
|
||||||
if ($categoryLabel.Content -like "+*") {
|
|
||||||
$wrapPanel.Visibility = [Windows.Visibility]::Collapsed
|
|
||||||
} else {
|
|
||||||
$wrapPanel.Visibility = [Windows.Visibility]::Visible
|
|
||||||
}
|
|
||||||
|
|
||||||
# Show all apps within the category
|
|
||||||
$wrapPanel.Children | ForEach-Object {
|
$wrapPanel.Children | ForEach-Object {
|
||||||
$_.Visibility = [Windows.Visibility]::Visible
|
# Safely retrieve app entry from hashtable
|
||||||
|
$appTag = $_.Tag
|
||||||
|
$appEntry = $null
|
||||||
|
|
||||||
|
if (-not [string]::IsNullOrWhiteSpace($appTag) -and $sync.configs.applicationsHashtable.ContainsKey($appTag)) {
|
||||||
|
$appEntry = $sync.configs.applicationsHashtable[$appTag]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if app matches search criteria
|
||||||
|
if ($null -ne $appEntry) {
|
||||||
|
$contentMatch = $appEntry.Content -like "*$escapedSearchString*"
|
||||||
|
$descriptionMatch = $appEntry.Description -like "*$escapedSearchString*"
|
||||||
|
|
||||||
|
if ($contentMatch -or $descriptionMatch) {
|
||||||
|
# Show the App and mark that this category has a match
|
||||||
|
$_.Visibility = [Windows.Visibility]::Visible
|
||||||
|
$categoryHasMatch = $true
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$_.Visibility = [Windows.Visibility]::Collapsed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Hide app if no entry found (data integrity issue)
|
||||||
|
$_.Visibility = [Windows.Visibility]::Collapsed
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# Perform search
|
# If category has matches, show the WrapPanel and update the category label to expanded state
|
||||||
$sync.ItemsControl.Items | ForEach-Object {
|
if ($categoryHasMatch) {
|
||||||
# Each item is a StackPanel container with Children[0] = label, Children[1] = WrapPanel
|
$wrapPanel.Visibility = [Windows.Visibility]::Visible
|
||||||
if ($_.Children.Count -ge 2) {
|
|
||||||
$categoryLabel = $_.Children[0]
|
|
||||||
$wrapPanel = $_.Children[1]
|
|
||||||
$categoryHasMatch = $false
|
|
||||||
|
|
||||||
# Keep category label visible
|
|
||||||
$categoryLabel.Visibility = [Windows.Visibility]::Visible
|
|
||||||
|
|
||||||
# Search through apps in this category
|
|
||||||
$wrapPanel.Children | ForEach-Object {
|
|
||||||
$appEntry = $sync.configs.applicationsHashtable.$($_.Tag)
|
|
||||||
if ($appEntry.Content -like "*$SearchString*" -or $appEntry.Description -like "*$SearchString*") {
|
|
||||||
# Show the App and mark that this category has a match
|
|
||||||
$_.Visibility = [Windows.Visibility]::Visible
|
$_.Visibility = [Windows.Visibility]::Visible
|
||||||
$categoryHasMatch = $true
|
# Update category label to show expanded state (-)
|
||||||
|
if ($categoryLabel.Content -like "+*") {
|
||||||
|
$categoryLabel.Content = $categoryLabel.Content -replace "^\+ ", "- "
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
# Hide the entire category container if no matches
|
||||||
$_.Visibility = [Windows.Visibility]::Collapsed
|
$_.Visibility = [Windows.Visibility]::Collapsed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# If category has matches, show the WrapPanel and update the category label to expanded state
|
|
||||||
if ($categoryHasMatch) {
|
|
||||||
$wrapPanel.Visibility = [Windows.Visibility]::Visible
|
|
||||||
$_.Visibility = [Windows.Visibility]::Visible
|
|
||||||
# Update category label to show expanded state (-)
|
|
||||||
if ($categoryLabel.Content -like "+*") {
|
|
||||||
$categoryLabel.Content = $categoryLabel.Content -replace "^\+ ", "- "
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
# Hide the entire category container if no matches
|
|
||||||
$_.Visibility = [Windows.Visibility]::Collapsed
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch {
|
||||||
|
Write-Warning "Find-AppsByNameOrDescription: An error occurred during search: $_"
|
||||||
|
# Fail gracefully - do not crash the UI thread
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,98 +3,300 @@ function Find-TweaksByNameOrDescription {
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Searches through the Tweaks on the Tweaks Tab and hides all entries that do not match the search string
|
Searches through the Tweaks on the Tweaks Tab and hides all entries that do not match the search string
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Filters tweak entries by name or description using literal string matching (no wildcard expansion).
|
||||||
|
Respects collapsed category state and handles null $sync gracefully.
|
||||||
|
Safe for rapid keystroke events; no terminal spam on error conditions.
|
||||||
|
|
||||||
.PARAMETER SearchString
|
.PARAMETER SearchString
|
||||||
The string to be searched for
|
The string to be searched for. Wildcards are treated as literal characters.
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
- Uses module-scope $sync (resolved via global/script fallback if needed)
|
||||||
|
- Performs literal matching (no wildcard expansion)
|
||||||
|
- Safely handles missing UI elements and null properties
|
||||||
|
- Protected by try/catch to prevent UI thread crashes
|
||||||
|
- PowerShell 5.1 compatible (no ternary operators, no advanced language features)
|
||||||
#>
|
#>
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory=$false)]
|
[Parameter(Mandatory = $false)]
|
||||||
[string]$SearchString = ""
|
[string]$SearchString = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
# Reset the visibility if the search string is empty or the search is cleared
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
if ([string]::IsNullOrWhiteSpace($SearchString)) {
|
# 1. RESOLVE $SYNC WITH MULTI-LEVEL FALLBACK
|
||||||
# Show all categories
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
$tweakspanel = $sync.Form.FindName("tweakspanel")
|
|
||||||
$tweakspanel.Children | ForEach-Object {
|
|
||||||
$_.Visibility = [Windows.Visibility]::Visible
|
|
||||||
|
|
||||||
# Foreach category section, show all items
|
if ($null -eq $Sync) {
|
||||||
if ($_ -is [Windows.Controls.Border]) {
|
$Sync = $global:sync
|
||||||
$_.Visibility = [Windows.Visibility]::Visible
|
if ($null -eq $Sync) {
|
||||||
|
$Sync = $script:sync
|
||||||
# Find ItemsControl
|
|
||||||
$dockPanel = $_.Child
|
|
||||||
if ($dockPanel -is [Windows.Controls.DockPanel]) {
|
|
||||||
$itemsControl = $dockPanel.Children | Where-Object { $_ -is [Windows.Controls.ItemsControl] }
|
|
||||||
if ($itemsControl) {
|
|
||||||
# Show items in the category
|
|
||||||
foreach ($item in $itemsControl.Items) {
|
|
||||||
if ($item -is [Windows.Controls.Label]) {
|
|
||||||
$item.Visibility = [Windows.Visibility]::Visible
|
|
||||||
} elseif ($item -is [Windows.Controls.DockPanel] -or
|
|
||||||
$item -is [Windows.Controls.StackPanel]) {
|
|
||||||
$item.Visibility = [Windows.Visibility]::Visible
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Validate that $Sync exists and has required structure
|
||||||
|
if ($null -eq $Sync) {
|
||||||
|
# Silent return - function called on every keystroke; no warning spam
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
# Search for matching tweaks when search string is not null
|
if ($null -eq $Sync.Form) {
|
||||||
$tweakspanel = $sync.Form.FindName("tweakspanel")
|
# Silent return - form not yet initialized
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
$tweakspanel.Children | ForEach-Object {
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
$categoryBorder = $_
|
# 2. GET REFERENCE TO TWEAKS PANEL
|
||||||
$categoryVisible = $false
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
if ($_ -is [Windows.Controls.Border]) {
|
$tweaksPanel = $null
|
||||||
# Find the ItemsControl
|
try {
|
||||||
$dockPanel = $_.Child
|
$tweaksPanel = $Sync.Form.FindName("tweakspanel")
|
||||||
if ($dockPanel -is [Windows.Controls.DockPanel]) {
|
}
|
||||||
$itemsControl = $dockPanel.Children | Where-Object { $_ -is [Windows.Controls.ItemsControl] }
|
catch {
|
||||||
if ($itemsControl) {
|
# Silent return - panel not found or disposed
|
||||||
$categoryLabel = $null
|
return
|
||||||
|
}
|
||||||
|
|
||||||
# Process all items in the ItemsControl
|
if ($null -eq $tweaksPanel) {
|
||||||
for ($i = 0; $i -lt $itemsControl.Items.Count; $i++) {
|
# Silent return - panel doesn't exist
|
||||||
$item = $itemsControl.Items[$i]
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if ($item -is [Windows.Controls.Label]) {
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
$categoryLabel = $item
|
# 3. HANDLE EMPTY/WHITESPACE SEARCH STRING - RESET TO DEFAULT STATE
|
||||||
$item.Visibility = [Windows.Visibility]::Collapsed
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
} elseif ($item -is [Windows.Controls.DockPanel]) {
|
|
||||||
$checkbox = $item.Children | Where-Object { $_ -is [Windows.Controls.CheckBox] } | Select-Object -First 1
|
|
||||||
$label = $item.Children | Where-Object { $_ -is [Windows.Controls.Label] } | Select-Object -First 1
|
|
||||||
|
|
||||||
if ($label -and ($label.Content -like "*$SearchString*" -or $label.ToolTip -like "*$SearchString*")) {
|
if ([string]::IsNullOrWhiteSpace($SearchString)) {
|
||||||
$item.Visibility = [Windows.Visibility]::Visible
|
try {
|
||||||
if ($categoryLabel) { $categoryLabel.Visibility = [Windows.Visibility]::Visible }
|
$tweaksPanel.Children | ForEach-Object {
|
||||||
$categoryVisible = $true
|
$categoryBorder = $_
|
||||||
} else {
|
|
||||||
$item.Visibility = [Windows.Visibility]::Collapsed
|
|
||||||
}
|
|
||||||
} elseif ($item -is [Windows.Controls.StackPanel]) {
|
|
||||||
# StackPanel which contain checkboxes or other elements
|
|
||||||
$checkbox = $item.Children | Where-Object { $_ -is [Windows.Controls.CheckBox] } | Select-Object -First 1
|
|
||||||
|
|
||||||
if ($checkbox -and ($checkbox.Content -like "*$SearchString*" -or $checkbox.ToolTip -like "*$SearchString*")) {
|
# Safely set visibility
|
||||||
$item.Visibility = [Windows.Visibility]::Visible
|
if ($null -ne $categoryBorder) {
|
||||||
if ($categoryLabel) { $categoryLabel.Visibility = [Windows.Visibility]::Visible }
|
$categoryBorder.Visibility = [Windows.Visibility]::Visible
|
||||||
$categoryVisible = $true
|
}
|
||||||
} else {
|
|
||||||
$item.Visibility = [Windows.Visibility]::Collapsed
|
# Process each category
|
||||||
|
if ($categoryBorder -is [Windows.Controls.Border]) {
|
||||||
|
$dockPanel = $null
|
||||||
|
if ($null -ne $categoryBorder.Child) {
|
||||||
|
$dockPanel = $categoryBorder.Child
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($dockPanel -is [Windows.Controls.DockPanel]) {
|
||||||
|
$itemsControl = $null
|
||||||
|
$itemsControl = $dockPanel.Children | Where-Object { $_ -is [Windows.Controls.ItemsControl] } | Select-Object -First 1
|
||||||
|
|
||||||
|
if ($null -ne $itemsControl) {
|
||||||
|
# Show all items in the category
|
||||||
|
foreach ($item in $itemsControl.Items) {
|
||||||
|
if ($null -ne $item) {
|
||||||
|
# Check if it's a category label (first Label in the ItemsControl)
|
||||||
|
if ($item -is [Windows.Controls.Label]) {
|
||||||
|
$item.Visibility = [Windows.Visibility]::Visible
|
||||||
|
}
|
||||||
|
elseif ($item -is [Windows.Controls.DockPanel] -or $item -is [Windows.Controls.StackPanel]) {
|
||||||
|
# Show all checkbox containers
|
||||||
|
$item.Visibility = [Windows.Visibility]::Visible
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
# Silent catch - UI element may be disposed
|
||||||
|
}
|
||||||
|
|
||||||
# Set the visibility based on if any item matched
|
return
|
||||||
$categoryBorder.Visibility = if ($categoryVisible) { [Windows.Visibility]::Visible } else { [Windows.Visibility]::Collapsed }
|
}
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
|
# 4. PERFORM LITERAL SEARCH (NO WILDCARD EXPANSION)
|
||||||
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
try {
|
||||||
|
# Normalize search term once for the entire operation
|
||||||
|
$searchTerm = $SearchString
|
||||||
|
if ($null -eq $searchTerm) {
|
||||||
|
$searchTerm = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
# Iterate through all categories
|
||||||
|
$tweaksPanel.Children | ForEach-Object {
|
||||||
|
$categoryBorder = $_
|
||||||
|
$categoryHasMatch = $false
|
||||||
|
|
||||||
|
if ($categoryBorder -is [Windows.Controls.Border]) {
|
||||||
|
$dockPanel = $null
|
||||||
|
if ($null -ne $categoryBorder.Child) {
|
||||||
|
$dockPanel = $categoryBorder.Child
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($dockPanel -is [Windows.Controls.DockPanel]) {
|
||||||
|
$itemsControl = $null
|
||||||
|
$itemsControl = $dockPanel.Children | Where-Object { $_ -is [Windows.Controls.ItemsControl] } | Select-Object -First 1
|
||||||
|
|
||||||
|
if ($null -ne $itemsControl) {
|
||||||
|
$categoryLabel = $null
|
||||||
|
|
||||||
|
# Process all items (checkboxes, labels, panels) in the ItemsControl
|
||||||
|
for ($i = 0; $i -lt $itemsControl.Items.Count; $i++) {
|
||||||
|
$item = $itemsControl.Items[$i]
|
||||||
|
|
||||||
|
if ($null -eq $item) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
# ────────────────────────────────────────────────────────────
|
||||||
|
# Check if this is a category label (usually first Label)
|
||||||
|
# ────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
if ($item -is [Windows.Controls.Label]) {
|
||||||
|
$categoryLabel = $item
|
||||||
|
# Initially hide category label; show it only if matches found
|
||||||
|
$item.Visibility = [Windows.Visibility]::Collapsed
|
||||||
|
}
|
||||||
|
|
||||||
|
# ────────────────────────────────────────────────────────────
|
||||||
|
# Check if this is a DockPanel containing a tweak checkbox
|
||||||
|
# ────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
elseif ($item -is [Windows.Controls.DockPanel]) {
|
||||||
|
$checkbox = $null
|
||||||
|
$label = $null
|
||||||
|
|
||||||
|
# Safely extract checkbox and label
|
||||||
|
$checkbox = $item.Children | Where-Object { $_ -is [Windows.Controls.CheckBox] } | Select-Object -First 1
|
||||||
|
$label = $item.Children | Where-Object { $_ -is [Windows.Controls.Label] } | Select-Object -First 1
|
||||||
|
|
||||||
|
# Check if tweak matches search criteria
|
||||||
|
$itemMatches = $false
|
||||||
|
|
||||||
|
if ($null -ne $label) {
|
||||||
|
$labelContent = $label.Content
|
||||||
|
$labelToolTip = $label.ToolTip
|
||||||
|
|
||||||
|
# Safely null-check properties
|
||||||
|
if ($null -eq $labelContent) {
|
||||||
|
$labelContent = ""
|
||||||
|
}
|
||||||
|
if ($null -eq $labelToolTip) {
|
||||||
|
$labelToolTip = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
# Convert to string and perform LITERAL matching
|
||||||
|
$labelContentStr = [string]$labelContent
|
||||||
|
$labelToolTipStr = [string]$labelToolTip
|
||||||
|
|
||||||
|
# Use IndexOf for literal matching (no wildcard interpretation)
|
||||||
|
$contentMatch = $labelContentStr.IndexOf($searchTerm, [System.StringComparison]::OrdinalIgnoreCase) -ge 0
|
||||||
|
$toolTipMatch = $labelToolTipStr.IndexOf($searchTerm, [System.StringComparison]::OrdinalIgnoreCase) -ge 0
|
||||||
|
|
||||||
|
if ($contentMatch -or $toolTipMatch) {
|
||||||
|
$itemMatches = $true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set visibility based on match result
|
||||||
|
if ($itemMatches) {
|
||||||
|
$item.Visibility = [Windows.Visibility]::Visible
|
||||||
|
$categoryHasMatch = $true
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$item.Visibility = [Windows.Visibility]::Collapsed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ────────────────────────────────────────────────────────────
|
||||||
|
# Check if this is a StackPanel containing a tweak checkbox
|
||||||
|
# ────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
elseif ($item -is [Windows.Controls.StackPanel]) {
|
||||||
|
$checkbox = $null
|
||||||
|
$checkbox = $item.Children | Where-Object { $_ -is [Windows.Controls.CheckBox] } | Select-Object -First 1
|
||||||
|
|
||||||
|
$itemMatches = $false
|
||||||
|
|
||||||
|
if ($null -ne $checkbox) {
|
||||||
|
$checkboxContent = $checkbox.Content
|
||||||
|
$checkboxToolTip = $checkbox.ToolTip
|
||||||
|
|
||||||
|
# Safely null-check properties
|
||||||
|
if ($null -eq $checkboxContent) {
|
||||||
|
$checkboxContent = ""
|
||||||
|
}
|
||||||
|
if ($null -eq $checkboxToolTip) {
|
||||||
|
$checkboxToolTip = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
# Convert to string and perform LITERAL matching
|
||||||
|
$checkboxContentStr = [string]$checkboxContent
|
||||||
|
$checkboxToolTipStr = [string]$checkboxToolTip
|
||||||
|
|
||||||
|
# Use IndexOf for literal matching (no wildcard interpretation)
|
||||||
|
$contentMatch = $checkboxContentStr.IndexOf($searchTerm, [System.StringComparison]::OrdinalIgnoreCase) -ge 0
|
||||||
|
$toolTipMatch = $checkboxToolTipStr.IndexOf($searchTerm, [System.StringComparison]::OrdinalIgnoreCase) -ge 0
|
||||||
|
|
||||||
|
if ($contentMatch -or $toolTipMatch) {
|
||||||
|
$itemMatches = $true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set visibility based on match result
|
||||||
|
if ($itemMatches) {
|
||||||
|
$item.Visibility = [Windows.Visibility]::Visible
|
||||||
|
$categoryHasMatch = $true
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$item.Visibility = [Windows.Visibility]::Collapsed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ────────────────────────────────────────────────────────────
|
||||||
|
# Update category label visibility and expanded/collapsed state
|
||||||
|
# ────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
if ($categoryHasMatch) {
|
||||||
|
# Show category label
|
||||||
|
if ($null -ne $categoryLabel) {
|
||||||
|
$categoryLabel.Visibility = [Windows.Visibility]::Visible
|
||||||
|
|
||||||
|
# Update category label to expanded state (change "+" to "-")
|
||||||
|
$labelContent = $categoryLabel.Content
|
||||||
|
if ($null -ne $labelContent) {
|
||||||
|
$labelStr = [string]$labelContent
|
||||||
|
|
||||||
|
# Safe string replacement without -replace regex
|
||||||
|
if ($labelStr.StartsWith("+ ")) {
|
||||||
|
$expandedLabel = "- " + $labelStr.Substring(2)
|
||||||
|
$categoryLabel.Content = $expandedLabel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ────────────────────────────────────────────────────────────────
|
||||||
|
# Set category border visibility based on whether it has matches
|
||||||
|
# ────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
if ($categoryHasMatch) {
|
||||||
|
$categoryBorder.Visibility = [Windows.Visibility]::Visible
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$categoryBorder.Visibility = [Windows.Visibility]::Collapsed
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch {
|
||||||
|
# Silent catch - UI elements may be disposed or in unexpected state
|
||||||
|
# Do not log to terminal as this function is called on every keystroke
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
function Get-LocalizedYesNo {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
This function runs choice.exe and captures its output to extract yes no in a localized Windows
|
|
||||||
|
|
||||||
.DESCRIPTION
|
|
||||||
The function retrieves the output of the command 'cmd /c "choice <nul 2>nul"' and converts the default output for Yes and No
|
|
||||||
in the localized format, such as "Yes=<first character>, No=<second character>".
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
$yesNoArray = Get-LocalizedYesNo
|
|
||||||
Write-Host "Yes=$($yesNoArray[0]), No=$($yesNoArray[1])"
|
|
||||||
#>
|
|
||||||
|
|
||||||
# Run choice and capture its options as output
|
|
||||||
# The output shows the options for Yes and No as "[Y,N]?" in the (partially) localized format.
|
|
||||||
# eg. English: [Y,N]?
|
|
||||||
# Dutch: [Y,N]?
|
|
||||||
# German: [J,N]?
|
|
||||||
# French: [O,N]?
|
|
||||||
# Spanish: [S,N]?
|
|
||||||
# Italian: [S,N]?
|
|
||||||
# Russian: [Y,N]?
|
|
||||||
|
|
||||||
$line = cmd /c "choice <nul 2>nul"
|
|
||||||
$charactersArray = @()
|
|
||||||
$regexPattern = '([a-zA-Z])'
|
|
||||||
$charactersArray = [regex]::Matches($line, $regexPattern) | ForEach-Object { $_.Groups[1].Value }
|
|
||||||
|
|
||||||
Write-Debug "According to takeown.exe local Yes is $charactersArray[0]"
|
|
||||||
# Return the array of characters
|
|
||||||
return $charactersArray
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
function Get-WPFObjectName {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
This is a helper function that generates an objectname with the prefix WPF that can be used as a Powershell Variable after compilation.
|
|
||||||
To achieve this, all characters that are not a-z, A-Z or 0-9 are simply removed from the name.
|
|
||||||
|
|
||||||
.PARAMETER type
|
|
||||||
The type of object for which the name should be generated. (e.g. Label, Button, CheckBox...)
|
|
||||||
|
|
||||||
.PARAMETER name
|
|
||||||
The name or description to be used for the object. (invalid characters are removed)
|
|
||||||
|
|
||||||
.OUTPUTS
|
|
||||||
A string that can be used as a object/variable name in powershell.
|
|
||||||
For example: WPFLabelMicrosoftTools
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Get-WPFObjectName -type Label -name "Microsoft Tools"
|
|
||||||
#>
|
|
||||||
|
|
||||||
param(
|
|
||||||
[Parameter(Mandatory, position=0)]
|
|
||||||
[string]$type,
|
|
||||||
|
|
||||||
[Parameter(position=1)]
|
|
||||||
[string]$name
|
|
||||||
)
|
|
||||||
|
|
||||||
$Output = $("WPF"+$type+$name) -replace '[^a-zA-Z0-9]', ''
|
|
||||||
return $Output
|
|
||||||
}
|
|
||||||
@@ -1,18 +1,12 @@
|
|||||||
function Get-WinUtilSelectedPackages
|
function Get-WinUtilSelectedPackages {
|
||||||
{
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Sorts given packages based on installer preference and availability.
|
|
||||||
|
|
||||||
.OUTPUTS
|
param(
|
||||||
Hashtable. Key = Package Manager, Value = ArrayList of packages to install
|
[Parameter(Mandatory = $true)]
|
||||||
#>
|
[object] $PackageList,
|
||||||
param (
|
|
||||||
[Parameter(Mandatory=$true)]
|
[Parameter(Mandatory = $true)]
|
||||||
$PackageList,
|
[PackageManagers] $Preference
|
||||||
[Parameter(Mandatory=$true)]
|
)
|
||||||
[PackageManagers]$Preference
|
|
||||||
)
|
|
||||||
|
|
||||||
if ($PackageList.count -eq 1) {
|
if ($PackageList.count -eq 1) {
|
||||||
Invoke-WPFUIThread -ScriptBlock { Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" }
|
Invoke-WPFUIThread -ScriptBlock { Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" }
|
||||||
@@ -23,34 +17,21 @@ function Get-WinUtilSelectedPackages
|
|||||||
$packages = [System.Collections.Hashtable]::new()
|
$packages = [System.Collections.Hashtable]::new()
|
||||||
$packagesWinget = [System.Collections.ArrayList]::new()
|
$packagesWinget = [System.Collections.ArrayList]::new()
|
||||||
$packagesChoco = [System.Collections.ArrayList]::new()
|
$packagesChoco = [System.Collections.ArrayList]::new()
|
||||||
|
|
||||||
$packages[[PackageManagers]::Winget] = $packagesWinget
|
$packages[[PackageManagers]::Winget] = $packagesWinget
|
||||||
$packages[[PackageManagers]::Choco] = $packagesChoco
|
$packages[[PackageManagers]::Choco] = $packagesChoco
|
||||||
|
|
||||||
Write-Debug "Checking packages using Preference '$($Preference)'"
|
|
||||||
|
|
||||||
foreach ($package in $PackageList) {
|
foreach ($package in $PackageList) {
|
||||||
switch ($Preference) {
|
switch ($Preference) {
|
||||||
"Choco" {
|
"Choco" {
|
||||||
if ($package.choco -eq "na") {
|
if ($package.choco -eq "na") {
|
||||||
Write-Debug "$($package.content) has no Choco value."
|
$null = $packagesWinget.add($package.winget)
|
||||||
$null = $packagesWinget.add($($package.winget))
|
|
||||||
Write-Host "Queueing $($package.winget) for WinGet..."
|
|
||||||
} else {
|
} else {
|
||||||
$null = $packagesChoco.add($package.choco)
|
$null = $packagesChoco.add($package.choco)
|
||||||
Write-Host "Queueing $($package.choco) for Chocolatey..."
|
|
||||||
}
|
}
|
||||||
break
|
|
||||||
}
|
}
|
||||||
"Winget" {
|
"Winget" {
|
||||||
if ($package.winget -eq "na") {
|
$null = $packagesWinget.add($package.winget)
|
||||||
Write-Debug "$($package.content) has no WinGet value."
|
|
||||||
$null = $packagesChoco.add($package.choco)
|
|
||||||
Write-Host "Queueing $($package.choco) for Chocolatey..."
|
|
||||||
} else {
|
|
||||||
$null = $packagesWinget.add($($package.winget))
|
|
||||||
Write-Host "Queueing $($package.winget) for WinGet..."
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,78 +1,47 @@
|
|||||||
Function Get-WinUtilToggleStatus {
|
Function Get-WinUtilToggleStatus {
|
||||||
<#
|
param(
|
||||||
|
[string]$ToggleSwitch
|
||||||
|
)
|
||||||
|
|
||||||
.SYNOPSIS
|
$toggleSwitchReg = if ($ToggleSwitch) {
|
||||||
Pulls the registry keys for the given toggle switch and checks whether the toggle should be checked or unchecked
|
$sync.configs.tweaks.$ToggleSwitch.registry
|
||||||
|
} else {
|
||||||
|
$ToggleSwitchReg
|
||||||
|
}
|
||||||
|
|
||||||
.PARAMETER ToggleSwitch
|
if (-not $toggleSwitchReg) {
|
||||||
The name of the toggle to check
|
|
||||||
|
|
||||||
.OUTPUTS
|
|
||||||
Boolean to set the toggle's status to
|
|
||||||
|
|
||||||
#>
|
|
||||||
|
|
||||||
Param($ToggleSwitch)
|
|
||||||
|
|
||||||
$ToggleSwitchReg = $sync.configs.tweaks.$ToggleSwitch.registry
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (($ToggleSwitchReg.path -imatch "hku") -and !(Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) {
|
|
||||||
$null = (New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS)
|
|
||||||
if (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue) {
|
|
||||||
Write-Debug "HKU drive created successfully."
|
|
||||||
} else {
|
|
||||||
Write-Debug "Failed to create HKU drive."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
Write-Error "An error occurred regarding the HKU Drive: $_"
|
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ToggleSwitchReg) {
|
New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS
|
||||||
$count = 0
|
|
||||||
|
|
||||||
foreach ($regentry in $ToggleSwitchReg) {
|
foreach ($regentry in $toggleSwitchReg) {
|
||||||
try {
|
|
||||||
if (!(Test-Path $regentry.Path)) {
|
if (-not (Test-Path $regentry.Path)) {
|
||||||
New-Item -Path $regentry.Path -Force | Out-Null
|
New-Item -Path $regentry.Path -Force | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
|
$regstate = (Get-ItemProperty -Path $regentry.Path).$($regentry.Name)
|
||||||
|
|
||||||
|
if ($null -eq $regstate) {
|
||||||
|
switch ($regentry.DefaultState) {
|
||||||
|
"true" {
|
||||||
|
$regstate = $regentry.Value
|
||||||
}
|
}
|
||||||
$regstate = (Get-ItemProperty -path $regentry.Path).$($regentry.Name)
|
"false" {
|
||||||
if ($regstate -eq $regentry.Value) {
|
$regstate = $regentry.OriginalValue
|
||||||
$count += 1
|
|
||||||
Write-Debug "$($regentry.Name) is true (state: $regstate, value: $($regentry.Value), original: $($regentry.OriginalValue))"
|
|
||||||
} else {
|
|
||||||
Write-Debug "$($regentry.Name) is false (state: $regstate, value: $($regentry.Value), original: $($regentry.OriginalValue))"
|
|
||||||
}
|
}
|
||||||
if ($null -eq $regstate) {
|
default {
|
||||||
switch ($regentry.DefaultState) {
|
Write-Error "Entry $($regentry.Name): missing value and no DefaultState"
|
||||||
"true" {
|
$regstate = $regentry.OriginalValue
|
||||||
$regstate = $regentry.Value
|
|
||||||
$count += 1
|
|
||||||
}
|
|
||||||
"false" {
|
|
||||||
$regstate = $regentry.OriginalValue
|
|
||||||
}
|
|
||||||
default {
|
|
||||||
Write-Error "Entry for $($regentry.Name) does not exist and no DefaultState is defined."
|
|
||||||
$regstate = $regentry.OriginalValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch {
|
|
||||||
Write-Error "An unexpected error occurred: $_"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($count -eq $ToggleSwitchReg.Count) {
|
if ($regstate -ne $regentry.Value) {
|
||||||
Write-Debug "$($ToggleSwitchReg.Name) is true (count: $count)"
|
|
||||||
return $true
|
|
||||||
} else {
|
|
||||||
Write-Debug "$($ToggleSwitchReg.Name) is false (count: $count)"
|
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return $false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,10 +117,6 @@ Function Invoke-WinUtilCurrentSystem {
|
|||||||
if ($values -notcontains $false) {
|
if ($values -notcontains $false) {
|
||||||
Write-Output $Config
|
Write-Output $Config
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if ($invokeScript -or $appxKeys) {
|
|
||||||
Write-Debug "Skipping $Config in Get Installed: no detectable registry, scheduled task, or service state."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,49 +1,16 @@
|
|||||||
function Invoke-WinUtilFeatureInstall {
|
function Invoke-WinUtilFeatureInstall ($CheckBox) {
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
if ($sync.configs.feature.$CheckBox.feature) {
|
||||||
Converts all the values from the tweaks.json and routes them to the appropriate function
|
foreach ($feature in $sync.configs.feature.$CheckBox.feature) {
|
||||||
|
Write-Host "Installing $feature"
|
||||||
#>
|
Enable-WindowsOptionalFeature -Online -FeatureName $feature -All -NoRestart -ErrorAction Stop
|
||||||
|
|
||||||
param(
|
|
||||||
$CheckBox
|
|
||||||
)
|
|
||||||
|
|
||||||
if($sync.configs.feature.$CheckBox.feature) {
|
|
||||||
Foreach( $feature in $sync.configs.feature.$CheckBox.feature ) {
|
|
||||||
try {
|
|
||||||
Write-Host "Installing $feature"
|
|
||||||
Enable-WindowsOptionalFeature -Online -FeatureName $feature -All -NoRestart
|
|
||||||
} catch {
|
|
||||||
if ($CheckBox.Exception.Message -like "*requires elevation*") {
|
|
||||||
Write-Warning "Unable to Install $feature due to permissions. Are you running as admin?"
|
|
||||||
Invoke-WPFUIThread -ScriptBlock { Set-WinUtilTaskbaritem -state "Error" }
|
|
||||||
} else {
|
|
||||||
|
|
||||||
Write-Warning "Unable to Install $feature due to unhandled exception."
|
|
||||||
Write-Warning $CheckBox.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($sync.configs.feature.$CheckBox.InvokeScript) {
|
|
||||||
Foreach( $script in $sync.configs.feature.$CheckBox.InvokeScript ) {
|
|
||||||
try {
|
|
||||||
$Scriptblock = [scriptblock]::Create($script)
|
|
||||||
|
|
||||||
Write-Host "Running Script for $CheckBox"
|
if ($sync.configs.feature.$CheckBox.InvokeScript) {
|
||||||
Invoke-Command $scriptblock -ErrorAction stop
|
foreach ($script in $sync.configs.feature.$CheckBox.InvokeScript) {
|
||||||
} catch {
|
Write-Host "Running Script for $CheckBox"
|
||||||
if ($CheckBox.Exception.Message -like "*requires elevation*") {
|
Invoke-Command -ScriptBlock ([scriptblock]::Create($script)) -ErrorAction Stop
|
||||||
Write-Warning "Unable to Install $feature due to permissions. Are you running as admin?"
|
|
||||||
Invoke-WPFUIThread -ScriptBlock { Set-WinUtilTaskbaritem -state "Error" }
|
|
||||||
} else {
|
|
||||||
Invoke-WPFUIThread -ScriptBlock { Set-WinUtilTaskbaritem -state "Error" }
|
|
||||||
Write-Warning "Unable to Install $feature due to unhandled exception."
|
|
||||||
Write-Warning $CheckBox.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ function Invoke-WinUtilFontScaling {
|
|||||||
# Calculates and applies the new font size
|
# Calculates and applies the new font size
|
||||||
$newValue = [math]::Round($originalValue * $ScaleFactor, 1)
|
$newValue = [math]::Round($originalValue * $ScaleFactor, 1)
|
||||||
$sync.Form.Resources[$resourceName] = $newValue
|
$sync.Form.Resources[$resourceName] = $newValue
|
||||||
Write-Debug "Scaled $resourceName from original $originalValue to $newValue (factor: $ScaleFactor)"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
@@ -80,8 +79,4 @@ function Invoke-WinUtilFontScaling {
|
|||||||
$percentage = [math]::Round($ScaleFactor * 100)
|
$percentage = [math]::Round($ScaleFactor * 100)
|
||||||
$sync.FontScalingValue.Text = "$percentage%"
|
$sync.FontScalingValue.Text = "$percentage%"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Debug "Font scaling applied with factor: $ScaleFactor"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -213,6 +213,90 @@ function Invoke-WinUtilISOModify {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-DismImageInfoMap {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory)][string]$ImagePath,
|
||||||
|
[int]$Index = 1
|
||||||
|
)
|
||||||
|
|
||||||
|
$map = @{}
|
||||||
|
$lines = & dism /English "/Get-ImageInfo" "/ImageFile:$ImagePath" "/Index:$Index"
|
||||||
|
foreach ($line in $lines) {
|
||||||
|
if ($line -match '^\s*([^:]+?)\s*:\s*(.*)$') {
|
||||||
|
$key = $Matches[1].Trim()
|
||||||
|
$val = $Matches[2].Trim()
|
||||||
|
if (-not $map.ContainsKey($key)) {
|
||||||
|
$map[$key] = $val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $map
|
||||||
|
}
|
||||||
|
|
||||||
|
function Invoke-WinUtilWimMetadataHydration {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory)][string]$ImagePath,
|
||||||
|
[Parameter(Mandatory)][string]$EditionName,
|
||||||
|
[scriptblock]$Logger
|
||||||
|
)
|
||||||
|
|
||||||
|
function LogMeta([string]$Message) {
|
||||||
|
if ($Logger) {
|
||||||
|
$null = $Logger.Invoke($Message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$before = Get-DismImageInfoMap -ImagePath $ImagePath -Index 1
|
||||||
|
$undefinedBefore = @($before.GetEnumerator() | Where-Object { $_.Value -eq '<undefined>' } | ForEach-Object { $_.Key })
|
||||||
|
|
||||||
|
if ($undefinedBefore.Count -eq 0) {
|
||||||
|
LogMeta "Metadata check: no undefined DISM fields detected."
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
LogMeta "Metadata check: undefined DISM fields detected: $($undefinedBefore -join ', ')"
|
||||||
|
LogMeta "Attempting best-effort metadata hydration for install.wim..."
|
||||||
|
|
||||||
|
$setImage = Get-Command Set-WindowsImage -ErrorAction SilentlyContinue
|
||||||
|
if (-not $setImage) {
|
||||||
|
LogMeta "Set-WindowsImage is unavailable on this host; cannot write additional WIM metadata fields."
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
$targetName = if ($EditionName -and $EditionName -ne 'Unknown') { $EditionName } else { $before['Name'] }
|
||||||
|
if (-not $targetName) { $targetName = 'Windows 11' }
|
||||||
|
|
||||||
|
$targetDescription = if ($before['Description'] -and $before['Description'] -ne '<undefined>') {
|
||||||
|
$before['Description']
|
||||||
|
} else {
|
||||||
|
$targetName
|
||||||
|
}
|
||||||
|
|
||||||
|
$setArgs = @{
|
||||||
|
ImagePath = $ImagePath
|
||||||
|
Index = 1
|
||||||
|
Name = $targetName
|
||||||
|
Description = $targetDescription
|
||||||
|
ErrorAction = 'Stop'
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Set-WindowsImage @setArgs | Out-Null
|
||||||
|
LogMeta "Applied Set-WindowsImage metadata updates (Name/Description)."
|
||||||
|
} catch {
|
||||||
|
LogMeta "Warning: Set-WindowsImage metadata update failed: $_"
|
||||||
|
}
|
||||||
|
|
||||||
|
$after = Get-DismImageInfoMap -ImagePath $ImagePath -Index 1
|
||||||
|
$undefinedAfter = @($after.GetEnumerator() | Where-Object { $_.Value -eq '<undefined>' } | ForEach-Object { $_.Key })
|
||||||
|
if ($undefinedAfter.Count -eq 0) {
|
||||||
|
LogMeta "Metadata hydration complete: no undefined DISM fields remain."
|
||||||
|
} else {
|
||||||
|
LogMeta "Metadata hydration complete. Remaining undefined DISM fields: $($undefinedAfter -join ', ')"
|
||||||
|
LogMeta "Note: some DISM metadata fields are read-only and come from Microsoft image internals."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
|
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
|
||||||
$sync["WPFWin11ISOSelectSection"].Visibility = "Collapsed"
|
$sync["WPFWin11ISOSelectSection"].Visibility = "Collapsed"
|
||||||
@@ -261,6 +345,9 @@ function Invoke-WinUtilISOModify {
|
|||||||
$localWim = Join-Path $isoContents "sources\install.wim"
|
$localWim = Join-Path $isoContents "sources\install.wim"
|
||||||
Log "Unused editions removed. install.wim now contains only '$selectedEditionName'."
|
Log "Unused editions removed. install.wim now contains only '$selectedEditionName'."
|
||||||
|
|
||||||
|
SetProgress "Hydrating WIM metadata..." 76
|
||||||
|
Invoke-WinUtilWimMetadataHydration -ImagePath $localWim -EditionName $selectedEditionName -Logger ${function:Log}
|
||||||
|
|
||||||
SetProgress "Dismounting source ISO..." 80
|
SetProgress "Dismounting source ISO..." 80
|
||||||
Log "Dismounting original ISO..."
|
Log "Dismounting original ISO..."
|
||||||
Dismount-DiskImage -ImagePath $isoPath
|
Dismount-DiskImage -ImagePath $isoPath
|
||||||
|
|||||||
@@ -21,8 +21,7 @@ function Invoke-WinUtilTweaks {
|
|||||||
$KeepServiceStartup = $true
|
$KeepServiceStartup = $true
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Debug "Tweaks: $($CheckBox)"
|
if ($undo) {
|
||||||
if($undo) {
|
|
||||||
$Values = @{
|
$Values = @{
|
||||||
Registry = "OriginalValue"
|
Registry = "OriginalValue"
|
||||||
Service = "OriginalType"
|
Service = "OriginalType"
|
||||||
@@ -37,18 +36,16 @@ function Invoke-WinUtilTweaks {
|
|||||||
ScriptType = "InvokeScript"
|
ScriptType = "InvokeScript"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($sync.configs.tweaks.$CheckBox.service) {
|
if ($sync.configs.tweaks.$CheckBox.service) {
|
||||||
Write-Debug "KeepServiceStartup is $KeepServiceStartup"
|
|
||||||
$sync.configs.tweaks.$CheckBox.service | ForEach-Object {
|
$sync.configs.tweaks.$CheckBox.service | ForEach-Object {
|
||||||
$changeservice = $true
|
$changeservice = $true
|
||||||
|
|
||||||
# The check for !($undo) is required, without it the script will throw an error for accessing unavailable member, which's the 'OriginalService' Property
|
# The check for !($undo) is required, without it the script will throw an error for accessing unavailable member, which's the 'OriginalService' Property
|
||||||
if($KeepServiceStartup -AND !($undo)) {
|
if ($KeepServiceStartup -AND !($undo)) {
|
||||||
try {
|
try {
|
||||||
# Check if the service exists
|
# Check if the service exists
|
||||||
$service = Get-Service -Name $psitem.Name -ErrorAction Stop
|
$service = Get-Service -Name $psitem.Name -ErrorAction Stop
|
||||||
if(!($service.StartType.ToString() -eq $psitem.$($values.OriginalService))) {
|
if(!($service.StartType.ToString() -eq $psitem.$($values.OriginalService))) {
|
||||||
Write-Debug "Service $($service.Name) was changed in the past to $($service.StartType.ToString()) from it's original type of $($psitem.$($values.OriginalService)), will not change it to $($psitem.$($values.service))"
|
|
||||||
$changeservice = $false
|
$changeservice = $false
|
||||||
}
|
}
|
||||||
} catch [System.ServiceProcess.ServiceNotFoundException] {
|
} catch [System.ServiceProcess.ServiceNotFoundException] {
|
||||||
@@ -56,41 +53,28 @@ function Invoke-WinUtilTweaks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($changeservice) {
|
if ($changeservice) {
|
||||||
Write-Debug "$($psitem.Name) and state is $($psitem.$($values.service))"
|
|
||||||
Set-WinUtilService -Name $psitem.Name -StartupType $psitem.$($values.Service)
|
Set-WinUtilService -Name $psitem.Name -StartupType $psitem.$($values.Service)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($sync.configs.tweaks.$CheckBox.registry) {
|
if ($sync.configs.tweaks.$CheckBox.registry) {
|
||||||
$sync.configs.tweaks.$CheckBox.registry | ForEach-Object {
|
$sync.configs.tweaks.$CheckBox.registry | ForEach-Object {
|
||||||
Write-Debug "$($psitem.Name) and state is $($psitem.$($values.registry))"
|
|
||||||
if (($psitem.Path -imatch "hku") -and !(Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) {
|
|
||||||
$null = (New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS)
|
|
||||||
if (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue) {
|
|
||||||
Write-Debug "HKU drive created successfully."
|
|
||||||
} else {
|
|
||||||
Write-Debug "Failed to create HKU drive."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry)
|
Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($sync.configs.tweaks.$CheckBox.$($values.ScriptType)) {
|
if ($sync.configs.tweaks.$CheckBox.$($values.ScriptType)) {
|
||||||
$sync.configs.tweaks.$CheckBox.$($values.ScriptType) | ForEach-Object {
|
$sync.configs.tweaks.$CheckBox.$($values.ScriptType) | ForEach-Object {
|
||||||
Write-Debug "$($psitem) and state is $($psitem.$($values.ScriptType))"
|
|
||||||
$Scriptblock = [scriptblock]::Create($psitem)
|
$Scriptblock = [scriptblock]::Create($psitem)
|
||||||
Invoke-WinUtilScript -ScriptBlock $scriptblock -Name $CheckBox
|
Invoke-WinUtilScript -ScriptBlock $scriptblock -Name $CheckBox
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$undo) {
|
if (!$undo) {
|
||||||
if($sync.configs.tweaks.$CheckBox.appx) {
|
if($sync.configs.tweaks.$CheckBox.appx) {
|
||||||
$sync.configs.tweaks.$CheckBox.appx | ForEach-Object {
|
$sync.configs.tweaks.$CheckBox.appx | ForEach-Object {
|
||||||
Write-Debug "UNDO $($psitem.Name)"
|
|
||||||
Remove-WinUtilAPPX -Name $psitem
|
Remove-WinUtilAPPX -Name $psitem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,14 +23,6 @@ function Reset-WPFCheckBoxes {
|
|||||||
|
|
||||||
$CheckBoxesToCheck = $sync.selectedApps + $sync.selectedTweaks + $sync.selectedFeatures
|
$CheckBoxesToCheck = $sync.selectedApps + $sync.selectedTweaks + $sync.selectedFeatures
|
||||||
$CheckBoxes = ($sync.GetEnumerator()).where{ $_.Value -is [System.Windows.Controls.CheckBox] -and $_.Name -notlike "WPFToggle*" -and $_.Name -like "$checkboxfilterpattern"}
|
$CheckBoxes = ($sync.GetEnumerator()).where{ $_.Value -is [System.Windows.Controls.CheckBox] -and $_.Name -notlike "WPFToggle*" -and $_.Name -like "$checkboxfilterpattern"}
|
||||||
Write-Debug "Getting checkboxes to set, number of checkboxes: $($CheckBoxes.Count)"
|
|
||||||
|
|
||||||
if ($CheckBoxesToCheck -ne "") {
|
|
||||||
$debugMsg = "CheckBoxes to Check are: "
|
|
||||||
$CheckBoxesToCheck | ForEach-Object { $debugMsg += "$_, " }
|
|
||||||
$debugMsg = $debugMsg -replace (',\s*$', '')
|
|
||||||
Write-Debug "$debugMsg"
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($CheckBox in $CheckBoxes) {
|
foreach ($CheckBox in $CheckBoxes) {
|
||||||
$checkboxName = $CheckBox.Key
|
$checkboxName = $CheckBox.Key
|
||||||
@@ -43,11 +35,9 @@ function Reset-WPFCheckBoxes {
|
|||||||
if ($CheckBoxesToCheck -contains $checkboxName) {
|
if ($CheckBoxesToCheck -contains $checkboxName) {
|
||||||
# If it exists, set IsChecked to true
|
# If it exists, set IsChecked to true
|
||||||
$sync.$checkboxName.IsChecked = $true
|
$sync.$checkboxName.IsChecked = $true
|
||||||
Write-Debug "$checkboxName is checked"
|
|
||||||
} else {
|
} else {
|
||||||
# If it doesn't exist, set IsChecked to false
|
# If it doesn't exist, set IsChecked to false
|
||||||
$sync.$checkboxName.IsChecked = $false
|
$sync.$checkboxName.IsChecked = $false
|
||||||
Write-Debug "$checkboxName is not checked"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +58,6 @@ function Reset-WPFCheckBoxes {
|
|||||||
foreach ($toggle in $allToggles) {
|
foreach ($toggle in $allToggles) {
|
||||||
if ($importedToggles -contains $toggle.Key) {
|
if ($importedToggles -contains $toggle.Key) {
|
||||||
$sync[$toggle.Key].IsChecked = $true
|
$sync[$toggle.Key].IsChecked = $true
|
||||||
Write-Debug "Restoring toggle: $($toggle.Key) = checked"
|
|
||||||
}
|
}
|
||||||
# Toggles not present in the import are intentionally left untouched;
|
# Toggles not present in the import are intentionally left untouched;
|
||||||
# their current UI state already reflects the real system state.
|
# their current UI state already reflects the real system state.
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ function Set-Preferences{
|
|||||||
$ini = ""
|
$ini = ""
|
||||||
foreach($key in $sync.preferences.Keys) {
|
foreach($key in $sync.preferences.Keys) {
|
||||||
$pref = "$($key)=$($sync.preferences.$key)"
|
$pref = "$($key)=$($sync.preferences.$key)"
|
||||||
Write-Debug "Saving pref: $($pref)"
|
|
||||||
$ini = $ini + $pref + "`r`n"
|
$ini = $ini + $pref + "`r`n"
|
||||||
}
|
}
|
||||||
$ini | Out-File $iniPath
|
$ini | Out-File $iniPath
|
||||||
@@ -49,7 +48,6 @@ function Set-Preferences{
|
|||||||
$arr = $line -split "=",-2
|
$arr = $line -split "=",-2
|
||||||
$key = $arr[0] -replace "\s",""
|
$key = $arr[0] -replace "\s",""
|
||||||
$value = $arr[1] -replace "\s",""
|
$value = $arr[1] -replace "\s",""
|
||||||
Write-Debug "Preference: Key = '$($key)' Value ='$($value)'"
|
|
||||||
$sync.preferences.$key = $value
|
$sync.preferences.$key = $value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ function Update-WinUtilSelections {
|
|||||||
$flatJson
|
$flatJson
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Debug "JSON to import: $($flatJson)"
|
|
||||||
|
|
||||||
foreach ($item in $flatJson) {
|
foreach ($item in $flatJson) {
|
||||||
# Ensure each item is treated as a string to handle PSCustomObject from JSON deserialization
|
# Ensure each item is treated as a string to handle PSCustomObject from JSON deserialization
|
||||||
$cbkey = [string]$item
|
$cbkey = [string]$item
|
||||||
@@ -51,11 +49,4 @@ function Update-WinUtilSelections {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Debug "-------------------------------------"
|
|
||||||
Write-Debug "Selected Apps: $($sync.selectedApps)"
|
|
||||||
Write-Debug "Selected Tweaks: $($sync.selectedTweaks)"
|
|
||||||
Write-Debug "Selected Toggles: $($sync.selectedToggles)"
|
|
||||||
Write-Debug "Selected Features: $($sync.selectedFeatures)"
|
|
||||||
Write-Debug "--------------------------------------"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ function Invoke-WPFButton {
|
|||||||
"WPFGetInstalled" {Invoke-WPFGetInstalled -CheckBox "winget"}
|
"WPFGetInstalled" {Invoke-WPFGetInstalled -CheckBox "winget"}
|
||||||
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
|
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
|
||||||
"WPFCloseButton" {$sync.Form.Close(); Write-Host "Bye bye!"}
|
"WPFCloseButton" {$sync.Form.Close(); Write-Host "Bye bye!"}
|
||||||
|
"WPFMinimizeButton" {$sync.Form.WindowState = [Windows.WindowState]::Minimized}
|
||||||
"WPFselectedAppsButton" {$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen}
|
"WPFselectedAppsButton" {$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen}
|
||||||
"WPFToggleFOSSHighlight" {
|
"WPFToggleFOSSHighlight" {
|
||||||
if ($sync.WPFToggleFOSSHighlight.IsChecked) {
|
if ($sync.WPFToggleFOSSHighlight.IsChecked) {
|
||||||
|
|||||||
@@ -85,11 +85,4 @@ function Invoke-WPFSelectedCheckboxesUpdate{
|
|||||||
Write-Host "Unknown group for checkbox: $($appKey)"
|
Write-Host "Unknown group for checkbox: $($appKey)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Debug "-------------------------------------"
|
|
||||||
Write-Debug "Selected Apps: $($sync.selectedApps)"
|
|
||||||
Write-Debug "Selected Tweaks: $($sync.selectedTweaks)"
|
|
||||||
Write-Debug "Selected Toggles: $($sync.selectedToggles)"
|
|
||||||
Write-Debug "Selected Features: $($sync.selectedFeatures)"
|
|
||||||
Write-Debug "--------------------------------------"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ function Invoke-WPFtweaksbutton {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Debug "Number of tweaks to process: $($Tweaks.Count)"
|
|
||||||
|
|
||||||
if ($restorePointSelected) {
|
if ($restorePointSelected) {
|
||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
|
|
||||||
@@ -58,7 +56,6 @@ 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
|
# 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 {
|
$handle = Invoke-WPFRunspace -ParameterList @(("tweaks", $tweaksToRun), ("dnsProvider", $dnsProvider), ("completedSteps", $completedSteps), ("totalSteps", $totalSteps)) -ScriptBlock {
|
||||||
param($tweaks, $dnsProvider, $completedSteps, $totalSteps)
|
param($tweaks, $dnsProvider, $completedSteps, $totalSteps)
|
||||||
Write-Debug "Inside Number of tweaks to process: $($Tweaks.Count)"
|
|
||||||
|
|
||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
|
|
||||||
|
|||||||
@@ -13,14 +13,12 @@ $maxthreads = [int]$env:NUMBER_OF_PROCESSORS
|
|||||||
|
|
||||||
# Create a new session state for parsing variables into our runspace
|
# Create a new session state for parsing variables into our runspace
|
||||||
$hashVars = New-object System.Management.Automation.Runspaces.SessionStateVariableEntry -ArgumentList 'sync',$sync,$Null
|
$hashVars = New-object System.Management.Automation.Runspaces.SessionStateVariableEntry -ArgumentList 'sync',$sync,$Null
|
||||||
$debugVar = New-object System.Management.Automation.Runspaces.SessionStateVariableEntry -ArgumentList 'DebugPreference',$DebugPreference,$Null
|
|
||||||
$uiVar = New-object System.Management.Automation.Runspaces.SessionStateVariableEntry -ArgumentList 'PARAM_NOUI',$PARAM_NOUI,$Null
|
$uiVar = New-object System.Management.Automation.Runspaces.SessionStateVariableEntry -ArgumentList 'PARAM_NOUI',$PARAM_NOUI,$Null
|
||||||
$offlineVar = New-object System.Management.Automation.Runspaces.SessionStateVariableEntry -ArgumentList 'PARAM_OFFLINE',$PARAM_OFFLINE,$Null
|
$offlineVar = New-object System.Management.Automation.Runspaces.SessionStateVariableEntry -ArgumentList 'PARAM_OFFLINE',$PARAM_OFFLINE,$Null
|
||||||
$InitialSessionState = [System.Management.Automation.Runspaces.InitialSessionState]::CreateDefault()
|
$InitialSessionState = [System.Management.Automation.Runspaces.InitialSessionState]::CreateDefault()
|
||||||
|
|
||||||
# Add the variable to the session state
|
# Add the variable to the session state
|
||||||
$InitialSessionState.Variables.Add($hashVars)
|
$InitialSessionState.Variables.Add($hashVars)
|
||||||
$InitialSessionState.Variables.Add($debugVar)
|
|
||||||
$InitialSessionState.Variables.Add($uiVar)
|
$InitialSessionState.Variables.Add($uiVar)
|
||||||
$InitialSessionState.Variables.Add($offlineVar)
|
$InitialSessionState.Variables.Add($offlineVar)
|
||||||
|
|
||||||
@@ -210,7 +208,6 @@ $sync.keys | ForEach-Object {
|
|||||||
$sync["$psitem"].Add_MouseUp({
|
$sync["$psitem"].Add_MouseUp({
|
||||||
[System.Object]$Sender = $args[0]
|
[System.Object]$Sender = $args[0]
|
||||||
Start-Process $Sender.ToolTip -ErrorAction Stop
|
Start-Process $Sender.ToolTip -ErrorAction Stop
|
||||||
Write-Debug "Opening: $($Sender.ToolTip)"
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,7 +313,6 @@ $sync["Form"].Add_MouseDoubleClick({
|
|||||||
})
|
})
|
||||||
|
|
||||||
$sync["Form"].Add_Deactivated({
|
$sync["Form"].Add_Deactivated({
|
||||||
Write-Debug "WinUtil lost focus"
|
|
||||||
Invoke-WPFPopup -Action "Hide" -Popups @("Settings", "Theme", "FontScaling")
|
Invoke-WPFPopup -Action "Hide" -Popups @("Settings", "Theme", "FontScaling")
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -330,10 +326,6 @@ $sync["Form"].Add_ContentRendered({
|
|||||||
$screenWidth = $primaryScreen.Bounds.Width
|
$screenWidth = $primaryScreen.Bounds.Width
|
||||||
$screenHeight = $primaryScreen.Bounds.Height
|
$screenHeight = $primaryScreen.Bounds.Height
|
||||||
|
|
||||||
# Print the screen size
|
|
||||||
Write-Debug "Primary Monitor Width: $screenWidth pixels"
|
|
||||||
Write-Debug "Primary Monitor Height: $screenHeight pixels"
|
|
||||||
|
|
||||||
# Compare with the primary monitor size
|
# Compare with the primary monitor size
|
||||||
if ($sync.Form.ActualWidth -gt $screenWidth -or $sync.Form.ActualHeight -gt $screenHeight) {
|
if ($sync.Form.ActualWidth -gt $screenWidth -or $sync.Form.ActualHeight -gt $screenHeight) {
|
||||||
Write-Debug "The specified width and/or height is greater than the primary monitor size."
|
Write-Debug "The specified width and/or height is greater than the primary monitor size."
|
||||||
@@ -341,11 +333,7 @@ $sync["Form"].Add_ContentRendered({
|
|||||||
$sync.Form.Top = 0
|
$sync.Form.Top = 0
|
||||||
$sync.Form.Width = $screenWidth
|
$sync.Form.Width = $screenWidth
|
||||||
$sync.Form.Height = $screenHeight
|
$sync.Form.Height = $screenHeight
|
||||||
} else {
|
|
||||||
Write-Debug "The specified width and height are within the primary monitor size limits."
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Write-Debug "Unable to retrieve information about the primary monitor."
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PARAM_OFFLINE) {
|
if ($PARAM_OFFLINE) {
|
||||||
@@ -445,41 +433,33 @@ $sync["Form"].Add_Activated({
|
|||||||
})
|
})
|
||||||
|
|
||||||
$sync["ThemeButton"].Add_Click({
|
$sync["ThemeButton"].Add_Click({
|
||||||
Write-Debug "ThemeButton clicked"
|
|
||||||
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Hide"; "Theme" = "Toggle"; "FontScaling" = "Hide" }
|
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Hide"; "Theme" = "Toggle"; "FontScaling" = "Hide" }
|
||||||
})
|
})
|
||||||
$sync["AutoThemeMenuItem"].Add_Click({
|
$sync["AutoThemeMenuItem"].Add_Click({
|
||||||
Write-Debug "About clicked"
|
|
||||||
Invoke-WPFPopup -Action "Hide" -Popups @("Theme")
|
Invoke-WPFPopup -Action "Hide" -Popups @("Theme")
|
||||||
Invoke-WinutilThemeChange -theme "Auto"
|
Invoke-WinutilThemeChange -theme "Auto"
|
||||||
})
|
})
|
||||||
$sync["DarkThemeMenuItem"].Add_Click({
|
$sync["DarkThemeMenuItem"].Add_Click({
|
||||||
Write-Debug "Dark Theme clicked"
|
|
||||||
Invoke-WPFPopup -Action "Hide" -Popups @("Theme")
|
Invoke-WPFPopup -Action "Hide" -Popups @("Theme")
|
||||||
Invoke-WinutilThemeChange -theme "Dark"
|
Invoke-WinutilThemeChange -theme "Dark"
|
||||||
})
|
})
|
||||||
$sync["LightThemeMenuItem"].Add_Click({
|
$sync["LightThemeMenuItem"].Add_Click({
|
||||||
Write-Debug "Light Theme clicked"
|
|
||||||
Invoke-WPFPopup -Action "Hide" -Popups @("Theme")
|
Invoke-WPFPopup -Action "Hide" -Popups @("Theme")
|
||||||
Invoke-WinutilThemeChange -theme "Light"
|
Invoke-WinutilThemeChange -theme "Light"
|
||||||
})
|
})
|
||||||
|
|
||||||
$sync["SettingsButton"].Add_Click({
|
$sync["SettingsButton"].Add_Click({
|
||||||
Write-Debug "SettingsButton clicked"
|
|
||||||
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Toggle"; "Theme" = "Hide"; "FontScaling" = "Hide" }
|
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Toggle"; "Theme" = "Hide"; "FontScaling" = "Hide" }
|
||||||
})
|
})
|
||||||
$sync["ImportMenuItem"].Add_Click({
|
$sync["ImportMenuItem"].Add_Click({
|
||||||
Write-Debug "Import clicked"
|
|
||||||
Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
|
Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
|
||||||
Invoke-WPFImpex -type "import"
|
Invoke-WPFImpex -type "import"
|
||||||
})
|
})
|
||||||
$sync["ExportMenuItem"].Add_Click({
|
$sync["ExportMenuItem"].Add_Click({
|
||||||
Write-Debug "Export clicked"
|
|
||||||
Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
|
Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
|
||||||
Invoke-WPFImpex -type "export"
|
Invoke-WPFImpex -type "export"
|
||||||
})
|
})
|
||||||
$sync["AboutMenuItem"].Add_Click({
|
$sync["AboutMenuItem"].Add_Click({
|
||||||
Write-Debug "About clicked"
|
|
||||||
Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
|
Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
|
||||||
|
|
||||||
$authorInfo = @"
|
$authorInfo = @"
|
||||||
@@ -492,12 +472,10 @@ Version : <a href="https://github.com/ChrisTitusTech/winutil/releases/tag/$($sy
|
|||||||
Show-CustomDialog -Title "About" -Message $authorInfo
|
Show-CustomDialog -Title "About" -Message $authorInfo
|
||||||
})
|
})
|
||||||
$sync["DocumentationMenuItem"].Add_Click({
|
$sync["DocumentationMenuItem"].Add_Click({
|
||||||
Write-Debug "Documentation clicked"
|
|
||||||
Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
|
Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
|
||||||
Start-Process "https://winutil.christitus.com/"
|
Start-Process "https://winutil.christitus.com/"
|
||||||
})
|
})
|
||||||
$sync["SponsorMenuItem"].Add_Click({
|
$sync["SponsorMenuItem"].Add_Click({
|
||||||
Write-Debug "Sponsors clicked"
|
|
||||||
Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
|
Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
|
||||||
|
|
||||||
$authorInfo = @"
|
$authorInfo = @"
|
||||||
@@ -517,7 +495,6 @@ $sync["SponsorMenuItem"].Add_Click({
|
|||||||
|
|
||||||
# Font Scaling Event Handlers
|
# Font Scaling Event Handlers
|
||||||
$sync["FontScalingButton"].Add_Click({
|
$sync["FontScalingButton"].Add_Click({
|
||||||
Write-Debug "FontScalingButton clicked"
|
|
||||||
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Hide"; "Theme" = "Hide"; "FontScaling" = "Toggle" }
|
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Hide"; "Theme" = "Hide"; "FontScaling" = "Toggle" }
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -528,13 +505,11 @@ $sync["FontScalingSlider"].Add_ValueChanged({
|
|||||||
})
|
})
|
||||||
|
|
||||||
$sync["FontScalingResetButton"].Add_Click({
|
$sync["FontScalingResetButton"].Add_Click({
|
||||||
Write-Debug "FontScalingResetButton clicked"
|
|
||||||
$sync.FontScalingSlider.Value = 1.0
|
$sync.FontScalingSlider.Value = 1.0
|
||||||
$sync.FontScalingValue.Text = "100%"
|
$sync.FontScalingValue.Text = "100%"
|
||||||
})
|
})
|
||||||
|
|
||||||
$sync["FontScalingApplyButton"].Add_Click({
|
$sync["FontScalingApplyButton"].Add_Click({
|
||||||
Write-Debug "FontScalingApplyButton clicked"
|
|
||||||
$scaleFactor = $sync.FontScalingSlider.Value
|
$scaleFactor = $sync.FontScalingSlider.Value
|
||||||
Invoke-WinUtilFontScaling -ScaleFactor $scaleFactor
|
Invoke-WinUtilFontScaling -ScaleFactor $scaleFactor
|
||||||
Invoke-WPFPopup -Action "Hide" -Popups @("FontScaling")
|
Invoke-WPFPopup -Action "Hide" -Popups @("FontScaling")
|
||||||
@@ -547,49 +522,40 @@ $sync["WPFTab5BT"].Add_Click({
|
|||||||
})
|
})
|
||||||
|
|
||||||
$sync["WPFWin11ISOBrowseButton"].Add_Click({
|
$sync["WPFWin11ISOBrowseButton"].Add_Click({
|
||||||
Write-Debug "WPFWin11ISOBrowseButton clicked"
|
|
||||||
Invoke-WinUtilISOBrowse
|
Invoke-WinUtilISOBrowse
|
||||||
})
|
})
|
||||||
|
|
||||||
$sync["WPFWin11ISODownloadLink"].Add_Click({
|
$sync["WPFWin11ISODownloadLink"].Add_Click({
|
||||||
Write-Debug "WPFWin11ISODownloadLink clicked"
|
|
||||||
Start-Process "https://www.microsoft.com/software-download/windows11"
|
Start-Process "https://www.microsoft.com/software-download/windows11"
|
||||||
})
|
})
|
||||||
|
|
||||||
$sync["WPFWin11ISOMountButton"].Add_Click({
|
$sync["WPFWin11ISOMountButton"].Add_Click({
|
||||||
Write-Debug "WPFWin11ISOMountButton clicked"
|
|
||||||
Invoke-WinUtilISOMountAndVerify
|
Invoke-WinUtilISOMountAndVerify
|
||||||
})
|
})
|
||||||
|
|
||||||
$sync["WPFWin11ISOModifyButton"].Add_Click({
|
$sync["WPFWin11ISOModifyButton"].Add_Click({
|
||||||
Write-Debug "WPFWin11ISOModifyButton clicked"
|
|
||||||
Invoke-WinUtilISOModify
|
Invoke-WinUtilISOModify
|
||||||
})
|
})
|
||||||
|
|
||||||
$sync["WPFWin11ISOChooseISOButton"].Add_Click({
|
$sync["WPFWin11ISOChooseISOButton"].Add_Click({
|
||||||
Write-Debug "WPFWin11ISOChooseISOButton clicked"
|
|
||||||
$sync["WPFWin11ISOOptionUSB"].Visibility = "Collapsed"
|
$sync["WPFWin11ISOOptionUSB"].Visibility = "Collapsed"
|
||||||
Invoke-WinUtilISOExport
|
Invoke-WinUtilISOExport
|
||||||
})
|
})
|
||||||
|
|
||||||
$sync["WPFWin11ISOChooseUSBButton"].Add_Click({
|
$sync["WPFWin11ISOChooseUSBButton"].Add_Click({
|
||||||
Write-Debug "WPFWin11ISOChooseUSBButton clicked"
|
|
||||||
$sync["WPFWin11ISOOptionUSB"].Visibility = "Visible"
|
$sync["WPFWin11ISOOptionUSB"].Visibility = "Visible"
|
||||||
Invoke-WinUtilISORefreshUSBDrives
|
Invoke-WinUtilISORefreshUSBDrives
|
||||||
})
|
})
|
||||||
|
|
||||||
$sync["WPFWin11ISORefreshUSBButton"].Add_Click({
|
$sync["WPFWin11ISORefreshUSBButton"].Add_Click({
|
||||||
Write-Debug "WPFWin11ISORefreshUSBButton clicked"
|
|
||||||
Invoke-WinUtilISORefreshUSBDrives
|
Invoke-WinUtilISORefreshUSBDrives
|
||||||
})
|
})
|
||||||
|
|
||||||
$sync["WPFWin11ISOWriteUSBButton"].Add_Click({
|
$sync["WPFWin11ISOWriteUSBButton"].Add_Click({
|
||||||
Write-Debug "WPFWin11ISOWriteUSBButton clicked"
|
|
||||||
Invoke-WinUtilISOWriteUSB
|
Invoke-WinUtilISOWriteUSB
|
||||||
})
|
})
|
||||||
|
|
||||||
$sync["WPFWin11ISOCleanResetButton"].Add_Click({
|
$sync["WPFWin11ISOCleanResetButton"].Add_Click({
|
||||||
Write-Debug "WPFWin11ISOCleanResetButton clicked"
|
|
||||||
Invoke-WinUtilISOCleanAndReset
|
Invoke-WinUtilISOCleanAndReset
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,164 +0,0 @@
|
|||||||
function Invoke-Preprocessing {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
A function that does Code Formatting using RegEx, useful when trying to force specific coding standard(s) to a project.
|
|
||||||
|
|
||||||
.PARAMETER ExcludedFiles
|
|
||||||
A list of file paths which're *relative to* 'WorkingDir' Folder, every item in the list can be pointing to File (doesn't end with '\') or Directory (ends with '\') or None-Existing File/Directory.
|
|
||||||
By default, it checks if everyitem exists, and throws an exception if one or more are not found (None-Existing).
|
|
||||||
|
|
||||||
.PARAMETER WorkingDir
|
|
||||||
The folder to search inside recursively for files which're going to be Preprocessed (Code Formatted), unless they're found in 'ExcludedFiles' List.
|
|
||||||
Note: The path should be absolute, NOT relative.
|
|
||||||
|
|
||||||
.PARAMETER ProgressStatusMessage
|
|
||||||
The status message used when displaying the progress bar, which's done through PowerShell 'Write-Progress' Cmdlet.
|
|
||||||
This's a Required Parameter, as the information displayed to terminal is useful when running this function,
|
|
||||||
which might take less than 1 sec to minutes depending on project's scale & hardware performance.
|
|
||||||
|
|
||||||
.PARAMETER ProgressActivity
|
|
||||||
The activity message used when displaying the progress bar, which's done through PowerShell 'Write-Progress' Cmdlet,
|
|
||||||
This's an Optional Parameter, default value is 'Preprocessing', used in combination with 'ProgressStatusMessage' Parameter Value.
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Invoke-Preprocessing -WorkingDir "DRIVE:\Path\To\Folder\" -ExcludedFiles @('file.txt', '.\.git\', '*.png') -ProgressStatusMessage "Doing Preprocessing"
|
|
||||||
|
|
||||||
Calls 'Invoke-Preprocessing' function using Named Parameters, with 'WorkingDir' (Mandatory Parameter) which's used as the base folder when searching for files recursively (using 'Get-ChildItem'), other two parameters are, in order from right to left, the Optional 'ExcludeFiles', which can be a path to a file, folder, or pattern-matched (like '*.png'), and the 'ProgressStatusMessage', which's used in Progress Bar.
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Invoke-Preprocessing -WorkingDir "DRIVE:\Path\To\Folder\" -ExcludedFiles @('file.txt', '.\.git\', '*.png') -ProgressStatusMessage "Doing Preprocessing" -ProgressActivity "Re-Formatting Code"
|
|
||||||
|
|
||||||
Same as Example No. 1, but uses 'ProgressActivity' which's used in Progress Bar.
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Invoke-Preprocessing -Skip -WorkingDir "DRIVE:\Path\To\Folder\" -ExcludedFiles @('file.txt', '.\.git\', '*.png') -ProgressStatusMessage "Doing Preprocessing"
|
|
||||||
|
|
||||||
#>
|
|
||||||
|
|
||||||
param (
|
|
||||||
[Parameter(Mandatory, position=1)]
|
|
||||||
[ValidateScript({[System.IO.Path]::IsPathRooted($_)})]
|
|
||||||
[string]$WorkingDir,
|
|
||||||
|
|
||||||
[Parameter(position=2)]
|
|
||||||
[string[]]$ExcludedFiles,
|
|
||||||
|
|
||||||
[Parameter(Mandatory, position=3)]
|
|
||||||
[string]$ProgressStatusMessage,
|
|
||||||
|
|
||||||
[Parameter(position=4)]
|
|
||||||
[string]$ProgressActivity = "Preprocessing"
|
|
||||||
)
|
|
||||||
|
|
||||||
if (-NOT (Test-Path -PathType Container -Path "$WorkingDir")) {
|
|
||||||
throw "[Invoke-Preprocessing] Invalid Parameter Value for 'WorkingDir', passed value: '$WorkingDir'. Either the path is a File or Non-Existing/Invlid, please double check your code."
|
|
||||||
}
|
|
||||||
|
|
||||||
$InternalExcludedFiles = [System.Collections.Generic.List[string]]::new($ExcludedFiles.Count)
|
|
||||||
ForEach ($excludedFile in $ExcludedFiles) {
|
|
||||||
$InternalExcludedFiles.Add($excludedFile) | Out-Null
|
|
||||||
}
|
|
||||||
|
|
||||||
# Validate the ExcludedItems List before continuing on
|
|
||||||
if ($ExcludedFiles.Count -gt 0) {
|
|
||||||
ForEach ($excludedFile in $ExcludedFiles) {
|
|
||||||
$filePath = "$(($WorkingDir -replace ('\\$', '')) + '\' + ($excludedFile -replace ('\.\\', '')))"
|
|
||||||
# Only attempt to create the directory if the excludedFile ends with '\'
|
|
||||||
if ($excludedFile -match '\\$' -and -not (Test-Path "$filePath")) {
|
|
||||||
New-Item -Path "$filePath" -ItemType Directory -Force | Out-Null
|
|
||||||
}
|
|
||||||
$files = Get-ChildItem -Recurse -Path "$filePath" -File -Force
|
|
||||||
if ($files.Count -gt 0) {
|
|
||||||
ForEach ($file in $files) {
|
|
||||||
$InternalExcludedFiles.Add("$($file.FullName)") | Out-Null
|
|
||||||
}
|
|
||||||
} else { $failedFilesList += "'$filePath', " }
|
|
||||||
}
|
|
||||||
$failedFilesList = $failedFilesList -replace (',\s*$', '')
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get Files List
|
|
||||||
[System.Collections.ArrayList]$files = Get-ChildItem -LiteralPath $WorkingDir -Recurse -Exclude $InternalExcludedFiles -File -Force
|
|
||||||
|
|
||||||
# Only keep the 'FullName' Property for every entry in the list
|
|
||||||
for ($i = 0; $i -lt $files.Count; $i++) {
|
|
||||||
$file = $files[$i]
|
|
||||||
$files[$i] = $file.FullName
|
|
||||||
}
|
|
||||||
|
|
||||||
# If a file(s) are found in Exclude List,
|
|
||||||
# Remove the file from files list.
|
|
||||||
ForEach ($excludedFile in $InternalExcludedFiles) {
|
|
||||||
$index = $files.IndexOf("$excludedFile")
|
|
||||||
if ($index -ge 0) { $files.RemoveAt($index) }
|
|
||||||
}
|
|
||||||
|
|
||||||
# Define a path to store the file hashes
|
|
||||||
$hashFilePath = Join-Path -Path $WorkingDir -ChildPath ".preprocessor_hashes.json"
|
|
||||||
|
|
||||||
# Load existing hashes if the file exists
|
|
||||||
$existingHashes = @{}
|
|
||||||
if (Test-Path -Path $hashFilePath) {
|
|
||||||
# intentionally dosn't use ConvertFrom-Json -AsHashtable as it isn't supported on old powershell versions
|
|
||||||
$file_content = Get-Content -Path $hashFilePath | ConvertFrom-Json
|
|
||||||
foreach ($property in $file_content.PSObject.Properties) {
|
|
||||||
$existingHashes[$property.Name] = $property.Value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$newHashes = @{}
|
|
||||||
$changedFiles = @()
|
|
||||||
$hashingAlgorithm = "MD5"
|
|
||||||
foreach ($file in $files){
|
|
||||||
# Calculate the hash of the file
|
|
||||||
$hash = Get-FileHash -Path $file -Algorithm $hashingAlgorithm | Select-Object -ExpandProperty Hash
|
|
||||||
$newHashes[$file] = $hash
|
|
||||||
|
|
||||||
# Check if the hash already exists in the existing hashes
|
|
||||||
if (($existingHashes.ContainsKey($file) -and $existingHashes[$file] -eq $hash)) {
|
|
||||||
# Skip processing this file as it hasn't changed
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
# If the hash doesn't exist or has changed, add it to the changed files list
|
|
||||||
$changedFiles += $file
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$files = $changedFiles
|
|
||||||
$numOfFiles = $files.Count
|
|
||||||
Write-Debug "[Invoke-Preprocessing] Files Changed: $numOfFiles"
|
|
||||||
|
|
||||||
if ($numOfFiles -eq 0){
|
|
||||||
Write-Debug "[Invoke-Preprocessing] Found 0 Files to Preprocess inside 'WorkingDir' Directory : '$WorkingDir'."
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
for ($i = 0; $i -lt $numOfFiles; $i++) {
|
|
||||||
$fullFileName = $files[$i]
|
|
||||||
|
|
||||||
# TODO:
|
|
||||||
# make more formatting rules, and document them in WinUtil Official Documentation
|
|
||||||
(Get-Content "$fullFileName").TrimEnd() `
|
|
||||||
-replace ('\t', ' ') `
|
|
||||||
-replace ('\)\s*\{', ') {') `
|
|
||||||
-replace ('(?<keyword>if|for|foreach)\s*(?<condition>\([.*?]\))\s*\{', '${keyword} ${condition} {') `
|
|
||||||
-replace ('\}\s*elseif\s*(?<condition>\([.*?]\))\s*\{', '} elseif ${condition} {') `
|
|
||||||
-replace ('\}\s*else\s*\{', '} else {') `
|
|
||||||
-replace ('Try\s*\{', 'try {') `
|
|
||||||
-replace ('Catch\s*\{', 'catch {') `
|
|
||||||
-replace ('\}\s*Catch', '} catch') `
|
|
||||||
-replace ('\}\s*Catch\s*(?<exceptions>(\[.*?\]\s*(\,)?\s*)+)\s*\{', '} catch ${exceptions} {') `
|
|
||||||
-replace ('\}\s*Catch\s*(?<exceptions>\[.*?\])\s*\{', '} catch ${exceptions} {') `
|
|
||||||
-replace ('(?<parameter_type>\[[^$0-9]+\])\s*(?<str_after_type>\$.*?)', '${parameter_type}${str_after_type}') `
|
|
||||||
| Set-Content "$fullFileName"
|
|
||||||
$newHashes[$fullFileName] = Get-FileHash -Path $fullFileName -Algorithm $hashingAlgorithm | Select-Object -ExpandProperty Hash
|
|
||||||
|
|
||||||
Write-Progress -Activity $ProgressActivity -Status "$ProgressStatusMessage - Finished $i out of $numOfFiles" -PercentComplete (($i/$numOfFiles)*100)
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Progress -Activity $ProgressActivity -Status "$ProgressStatusMessage - Finished Task Successfully" -Completed
|
|
||||||
|
|
||||||
# Save the new hashes to the file
|
|
||||||
$newHashes | ConvertTo-Json -Depth 10 | Set-Content -Path $hashFilePath
|
|
||||||
}
|
|
||||||
+3
-12
@@ -1,13 +1,4 @@
|
|||||||
<#
|
# Runs the pre-release version of winutil
|
||||||
.SYNOPSIS
|
|
||||||
This Script is used as a target for the https://christitus.com/windev alias.
|
|
||||||
.DESCRIPTION
|
|
||||||
This Script provides a simple way to start the bleeding edge release of winutil.
|
|
||||||
.EXAMPLE
|
|
||||||
irm https://christitus.com/windev | iex
|
|
||||||
OR
|
|
||||||
Run in Admin Powershell > ./windev.ps1
|
|
||||||
#>
|
|
||||||
|
|
||||||
$latestTag = (Invoke-RestMethod "https://api.github.com/repos/ChrisTitusTech/winutil/tags")[0].name
|
$latestTag = (Invoke-RestMethod https://api.github.com/repos/ChrisTitusTech/winutil/tags).Name | Select-Object -First 1
|
||||||
Invoke-RestMethod "https://github.com/ChrisTitusTech/winutil/releases/download/$latestTag/winutil.ps1" | Invoke-Expression
|
Invoke-RestMethod -Uri https://github.com/ChrisTitusTech/winutil/releases/download/$latestTag/winutil.ps1 | Invoke-Expression
|
||||||
|
|||||||
@@ -1186,6 +1186,16 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</Popup>
|
</Popup>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
Content="−" BorderThickness="0"
|
||||||
|
BorderBrush="Transparent"
|
||||||
|
Background="{DynamicResource MainBackgroundColor}"
|
||||||
|
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
|
||||||
|
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
FontFamily="{DynamicResource FontFamily}"
|
||||||
|
Foreground="{DynamicResource MainForegroundColor}" FontSize="{DynamicResource CloseIconFontSize}" Name="WPFMinimizeButton" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
Content="×" BorderThickness="0"
|
Content="×" BorderThickness="0"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
|
|||||||
Reference in New Issue
Block a user