mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-15 09:20:36 -06:00
Merge branch 'main' into attributes
This commit is contained in:
commit
2d3e43b998
8
.github/workflows/close-discussion.yml
vendored
8
.github/workflows/close-discussion.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
|||||||
- name: Check if PR was merged
|
- name: Check if PR was merged
|
||||||
if: github.event.pull_request.merged == true
|
if: github.event.pull_request.merged == true
|
||||||
run: echo "PR was merged"
|
run: echo "PR was merged"
|
||||||
|
|
||||||
- name: Extract Discussion Number & Close If any Were Found
|
- name: Extract Discussion Number & Close If any Were Found
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@ -23,7 +23,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pr_body="${{ github.event.pull_request.body }}"
|
pr_body="${{ github.event.pull_request.body }}"
|
||||||
discussion_ids=$(echo "$pr_body" | grep -oP '(?i)(resolve|fix|close)[s|d]? #\K[0-9]+')
|
discussion_ids=$(echo "$pr_body" | grep -oP '(?i)(resolve|fix|close)[s|d]? #\K[0-9]+')
|
||||||
|
|
||||||
if [ -z "$discussion_ids" ]; then
|
if [ -z "$discussion_ids" ]; then
|
||||||
echo "No discussion IDs found."
|
echo "No discussion IDs found."
|
||||||
exit 0
|
exit 0
|
||||||
@ -34,10 +34,10 @@ jobs:
|
|||||||
response=$(curl -s -o /dev/null -w "%{http_code}" -X PATCH -H "Authorization: token $GITHUB_TOKEN" \
|
response=$(curl -s -o /dev/null -w "%{http_code}" -X PATCH -H "Authorization: token $GITHUB_TOKEN" \
|
||||||
-d '{"state": "closed"}' \
|
-d '{"state": "closed"}' \
|
||||||
"https://api.github.com/repos/${{ github.repository }}/discussions/$discussion_id")
|
"https://api.github.com/repos/${{ github.repository }}/discussions/$discussion_id")
|
||||||
|
|
||||||
if [ "$response" -ne 200 ]; then
|
if [ "$response" -ne 200 ]; then
|
||||||
echo "Failed to close discussion #$discussion_id. HTTP status code: $response"
|
echo "Failed to close discussion #$discussion_id. HTTP status code: $response"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
shell: bash
|
shell: bash
|
||||||
|
2
.github/workflows/compile.yaml
vendored
2
.github/workflows/compile.yaml
vendored
@ -45,4 +45,4 @@ jobs:
|
|||||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
commit_message: Compile Winutil
|
commit_message: Compile Winutil
|
||||||
if: success()
|
if: success()
|
||||||
|
2
.github/workflows/createchangelog.yml
vendored
2
.github/workflows/createchangelog.yml
vendored
@ -114,4 +114,4 @@ jobs:
|
|||||||
git config --global user.name 'github-actions[bot]'
|
git config --global user.name 'github-actions[bot]'
|
||||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||||
git add docs/changelog.md
|
git add docs/changelog.md
|
||||||
git diff --quiet && git diff --staged --quiet || (git commit -m "Update changelog.md with all releases" && git push)
|
git diff --quiet && git diff --staged --quiet || (git commit -m "Update changelog.md with all releases" && git push)
|
||||||
|
2
.github/workflows/github-pages.yml
vendored
2
.github/workflows/github-pages.yml
vendored
@ -2,7 +2,7 @@ name: GitHub Pages Deploy
|
|||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published, prereleased]
|
types: [published, prereleased]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
jobs:
|
jobs:
|
||||||
|
2
.github/workflows/issue-slash-commands.yaml
vendored
2
.github/workflows/issue-slash-commands.yaml
vendored
@ -42,4 +42,4 @@ jobs:
|
|||||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||||
run: |
|
run: |
|
||||||
echo Closing the issue...
|
echo Closing the issue...
|
||||||
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
|
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
|
||||||
|
2
.github/workflows/pre-release.yaml
vendored
2
.github/workflows/pre-release.yaml
vendored
@ -53,4 +53,4 @@ jobs:
|
|||||||
prerelease: true
|
prerelease: true
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
2
.github/workflows/sponsors.yml
vendored
2
.github/workflows/sponsors.yml
vendored
@ -23,4 +23,4 @@ jobs:
|
|||||||
uses: JamesIves/github-pages-deploy-action@v4
|
uses: JamesIves/github-pages-deploy-action@v4
|
||||||
with:
|
with:
|
||||||
branch: main
|
branch: main
|
||||||
folder: '.'
|
folder: '.'
|
||||||
|
2
.github/workflows/unittests.yaml
vendored
2
.github/workflows/unittests.yaml
vendored
@ -37,4 +37,4 @@ jobs:
|
|||||||
|
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
TEMP: ${{ runner.temp }}
|
TEMP: ${{ runner.temp }}
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -45,3 +45,5 @@ microwin.log
|
|||||||
True
|
True
|
||||||
test.ps1
|
test.ps1
|
||||||
winutil.ps1
|
winutil.ps1
|
||||||
|
|
||||||
|
binary/
|
71
Compile.ps1
71
Compile.ps1
@ -1,13 +1,15 @@
|
|||||||
param (
|
param (
|
||||||
[switch]$Debug,
|
[switch]$Debug,
|
||||||
[switch]$Run
|
[switch]$Run,
|
||||||
|
[switch]$SkipPreprocessing
|
||||||
)
|
)
|
||||||
$OFS = "`r`n"
|
$OFS = "`r`n"
|
||||||
$scriptname = "winutil.ps1"
|
$scriptname = "winutil.ps1"
|
||||||
|
$workingdir = $PSScriptRoot
|
||||||
|
|
||||||
# Variable to sync between runspaces
|
# Variable to sync between runspaces
|
||||||
$sync = [Hashtable]::Synchronized(@{})
|
$sync = [Hashtable]::Synchronized(@{})
|
||||||
$sync.PSScriptRoot = $PSScriptRoot
|
$sync.PSScriptRoot = $workingdir
|
||||||
$sync.configs = @{}
|
$sync.configs = @{}
|
||||||
|
|
||||||
function Update-Progress {
|
function Update-Progress {
|
||||||
@ -15,12 +17,12 @@ function Update-Progress {
|
|||||||
[Parameter(Mandatory, position=0)]
|
[Parameter(Mandatory, position=0)]
|
||||||
[string]$StatusMessage,
|
[string]$StatusMessage,
|
||||||
|
|
||||||
[Parameter(Mandatory, position=1)]
|
[Parameter(Mandatory, position=1)]
|
||||||
[ValidateRange(0,100)]
|
[ValidateRange(0,100)]
|
||||||
[int]$Percent,
|
[int]$Percent,
|
||||||
|
|
||||||
[Parameter(position=2)]
|
[Parameter(position=2)]
|
||||||
[string]$Activity = "Compiling"
|
[string]$Activity = "Compiling"
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Progress -Activity $Activity -Status $StatusMessage -PercentComplete $Percent
|
Write-Progress -Activity $Activity -Status $StatusMessage -PercentComplete $Percent
|
||||||
@ -34,6 +36,17 @@ $header = @"
|
|||||||
################################################################################################################
|
################################################################################################################
|
||||||
"@
|
"@
|
||||||
|
|
||||||
|
if (-NOT $SkipPreprocessing) {
|
||||||
|
Update-Progress "Pre-req: Running Preprocessor..." 0
|
||||||
|
|
||||||
|
# Dot source the 'Invoke-Preprocessing' Function from 'tools/Invoke-Preprocessing.ps1' Script
|
||||||
|
$preprocessingFilePath = ".\tools\Invoke-Preprocessing.ps1"
|
||||||
|
. "$(($workingdir -replace ('\\$', '')) + '\' + ($preprocessingFilePath -replace ('\.\\', '')))"
|
||||||
|
|
||||||
|
$excludedFiles = @('.\.git\', '.\.gitignore', '.\.gitattributes', '.\.github\CODEOWNERS', '.\LICENSE', '.\winutil.ps1', "$preprocessingFilePath", '.\docs\changelog.md', '*.png', '*.exe')
|
||||||
|
$msg = "Pre-req: Code Formatting"
|
||||||
|
Invoke-Preprocessing -WorkingDir "$workingdir" -ExcludedFiles $excludedFiles -ProgressStatusMessage $msg
|
||||||
|
}
|
||||||
|
|
||||||
# Create the script in memory.
|
# Create the script in memory.
|
||||||
Update-Progress "Pre-req: Allocating Memory" 0
|
Update-Progress "Pre-req: Allocating Memory" 0
|
||||||
@ -43,14 +56,14 @@ Update-Progress "Adding: Header" 5
|
|||||||
$script_content.Add($header)
|
$script_content.Add($header)
|
||||||
|
|
||||||
Update-Progress "Adding: Version" 10
|
Update-Progress "Adding: Version" 10
|
||||||
$script_content.Add($(Get-Content .\scripts\start.ps1).replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)"))
|
$script_content.Add($(Get-Content "$workingdir\scripts\start.ps1").replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)"))
|
||||||
|
|
||||||
Update-Progress "Adding: Functions" 20
|
Update-Progress "Adding: Functions" 20
|
||||||
Get-ChildItem .\functions -Recurse -File | ForEach-Object {
|
Get-ChildItem "$workingdir\functions" -Recurse -File | ForEach-Object {
|
||||||
$script_content.Add($(Get-Content $psitem.FullName))
|
$script_content.Add($(Get-Content $psitem.FullName))
|
||||||
}
|
}
|
||||||
Update-Progress "Adding: Config *.json" 40
|
Update-Progress "Adding: Config *.json" 40
|
||||||
Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
|
Get-ChildItem "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
|
||||||
|
|
||||||
$json = (Get-Content $psitem.FullName).replace("'","''")
|
$json = (Get-Content $psitem.FullName).replace("'","''")
|
||||||
|
|
||||||
@ -65,15 +78,15 @@ Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-
|
|||||||
# Use **HTML decimal/hex codes instead**, as using HTML Entity Codes will result in XML parse Error when running the compiled script.
|
# Use **HTML decimal/hex codes instead**, as using HTML Entity Codes will result in XML parse Error when running the compiled script.
|
||||||
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
|
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
|
||||||
$firstLevelName = $firstLevelJsonList[$i]
|
$firstLevelName = $firstLevelJsonList[$i]
|
||||||
if ($jsonAsObject.$firstLevelName.content -ne $null) {
|
if ($jsonAsObject.$firstLevelName.content -ne $null) {
|
||||||
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—')
|
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—')
|
||||||
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
|
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
|
||||||
}
|
}
|
||||||
if ($jsonAsObject.$firstLevelName.description -ne $null) {
|
if ($jsonAsObject.$firstLevelName.description -ne $null) {
|
||||||
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—')
|
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—')
|
||||||
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
|
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add 'WPFInstall' as a prefix to every entry-name in 'applications.json' file
|
# Add 'WPFInstall' as a prefix to every entry-name in 'applications.json' file
|
||||||
if ($psitem.Name -eq "applications.json") {
|
if ($psitem.Name -eq "applications.json") {
|
||||||
@ -95,10 +108,10 @@ Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-
|
|||||||
$script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" ))
|
$script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" ))
|
||||||
}
|
}
|
||||||
|
|
||||||
$xaml = (Get-Content .\xaml\inputXML.xaml).replace("'","''")
|
$xaml = (Get-Content "$workingdir\xaml\inputXML.xaml").replace("'","''")
|
||||||
|
|
||||||
# Dot-source the Get-TabXaml function
|
# Dot-source the Get-TabXaml function
|
||||||
. .\functions\private\Get-TabXaml.ps1
|
. "$workingdir\functions\private\Get-TabXaml.ps1"
|
||||||
|
|
||||||
Update-Progress "Building: Xaml " 75
|
Update-Progress "Building: Xaml " 75
|
||||||
$appXamlContent = Get-TabXaml "applications" 5
|
$appXamlContent = Get-TabXaml "applications" 5
|
||||||
@ -114,30 +127,28 @@ $xaml = $xaml -replace "{{InstallPanel_features}}", $featuresXamlContent
|
|||||||
|
|
||||||
$script_content.Add($(Write-output "`$inputXML = '$xaml'"))
|
$script_content.Add($(Write-output "`$inputXML = '$xaml'"))
|
||||||
|
|
||||||
$script_content.Add($(Get-Content .\scripts\main.ps1))
|
$script_content.Add($(Get-Content "$workingdir\scripts\main.ps1"))
|
||||||
|
|
||||||
if ($Debug){
|
if ($Debug) {
|
||||||
Update-Progress "Writing debug files" 95
|
Update-Progress "Writing debug files" 95
|
||||||
$appXamlContent | Out-File -FilePath ".\xaml\inputApp.xaml" -Encoding ascii
|
$appXamlContent | Out-File -FilePath "$workingdir\xaml\inputApp.xaml" -Encoding ascii
|
||||||
$tweaksXamlContent | Out-File -FilePath ".\xaml\inputTweaks.xaml" -Encoding ascii
|
$tweaksXamlContent | Out-File -FilePath "$workingdir\xaml\inputTweaks.xaml" -Encoding ascii
|
||||||
$featuresXamlContent | Out-File -FilePath ".\xaml\inputFeatures.xaml" -Encoding ascii
|
$featuresXamlContent | Out-File -FilePath "$workingdir\xaml\inputFeatures.xaml" -Encoding ascii
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Update-Progress "Removing temporary files" 99
|
Update-Progress "Removing temporary files" 99
|
||||||
Remove-Item ".\xaml\inputApp.xaml" -ErrorAction SilentlyContinue
|
Remove-Item "$workingdir\xaml\inputApp.xaml" -ErrorAction SilentlyContinue
|
||||||
Remove-Item ".\xaml\inputTweaks.xaml" -ErrorAction SilentlyContinue
|
Remove-Item "$workingdir\xaml\inputTweaks.xaml" -ErrorAction SilentlyContinue
|
||||||
Remove-Item ".\xaml\inputFeatures.xaml" -ErrorAction SilentlyContinue
|
Remove-Item "$workingdir\xaml\inputFeatures.xaml" -ErrorAction SilentlyContinue
|
||||||
}
|
}
|
||||||
|
|
||||||
Set-Content -Path $scriptname -Value ($script_content -join "`r`n") -Encoding ascii
|
Set-Content -Path "$workingdir\$scriptname" -Value ($script_content -join "`r`n") -Encoding ascii
|
||||||
Write-Progress -Activity "Compiling" -Completed
|
Write-Progress -Activity "Compiling" -Completed
|
||||||
|
|
||||||
if ($run){
|
if ($run) {
|
||||||
try {
|
try {
|
||||||
Start-Process -FilePath "pwsh" -ArgumentList ".\$scriptname"
|
Start-Process -FilePath "pwsh" -ArgumentList "$workingdir\$scriptname"
|
||||||
}
|
} catch {
|
||||||
catch {
|
Start-Process -FilePath "powershell" -ArgumentList "$workingdir\$scriptname"
|
||||||
Start-Process -FilePath "powershell" -ArgumentList ".\$scriptname"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
516
IntegratedServicesRegionPolicySet.json
Normal file
516
IntegratedServicesRegionPolicySet.json
Normal file
@ -0,0 +1,516 @@
|
|||||||
|
{
|
||||||
|
"$schema": "schemas/IntegratedServicesRegionPolicySet.Schema.1.1.0.json",
|
||||||
|
"version": "1.0",
|
||||||
|
"policies": [
|
||||||
|
{
|
||||||
|
"$comment": "Edge is uninstallable.",
|
||||||
|
"guid": "{1bca278a-5d11-4acf-ad2f-f9ab6d7f93a6}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "User can disable web search.",
|
||||||
|
"guid": "{6002ce31-b807-4f82-820c-2b92e716ab76}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Narrator scripting extensions are enabled.",
|
||||||
|
"guid": "{6033b294-79ff-47eb-bbde-97b4c6479217}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "File Explorer Search is third party extensible.",
|
||||||
|
"guid": "{63ef7a1e-95a1-4f7b-9d4c-b5ed8e72fe10}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "First party File Explorer Search is allowed.",
|
||||||
|
"guid": "{ad2d9176-ef16-42de-ba5e-5f6e5a07abca}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "SetAppAsDefault Public API exception for setting Edge as default",
|
||||||
|
"guid": "{50db02cb-3f22-465b-9205-0e722c2caf0c}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["CN", "HK", "MO", "TW"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Third party search providers show in search.",
|
||||||
|
"guid": "{f2775604-739c-4cd2-8463-eb040f7e8bf7}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Third party search highlight content in search zero input.",
|
||||||
|
"guid": "{e462341d-48bf-4a7f-9585-5a4e5b90a079}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "First party search highlight content in search zero input.",
|
||||||
|
"guid": "{13feefcf-0f8a-4df0-b85c-417cbcc68d27}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "V2: Third parties can customize the Taskbar Gleam.",
|
||||||
|
"guid": "{7de951fb-a68f-4cb0-b67b-ae6fbdec83ed}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Third parties can customize the Taskbar Gleam.",
|
||||||
|
"guid": "{9a9f7273-6d5d-4da8-a8e6-bc3243b84d21}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "V2: First party Taskbar Gleam customization is shown.",
|
||||||
|
"guid": "{17bcdbb5-6003-4b4a-8da8-db163a9869d5}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "First party Taskbar Gleam customization is shown.",
|
||||||
|
"guid": "{61bf5046-c5db-4cd3-b6bf-929e5b421a6a}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Search MRU shows third party provider.",
|
||||||
|
"guid": "{407a6a2a-4c34-4945-bd24-cd194635abae}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Edge is required for web search.",
|
||||||
|
"guid": "{5436f3c3-803e-447d-9bd2-b533888df09f}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "System components are differentiated from apps.",
|
||||||
|
"guid": "{b162c44a-5d51-4fb4-aadd-6b8bf3ea4648}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Backup options are restricted.",
|
||||||
|
"guid": "{4492387d-5ea5-4e72-9ca0-69067d19502c}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Show files from the MS Office MRU redommendation provider.",
|
||||||
|
"guid": "{c053478a-fd9a-4bbf-a794-4ebef4bbf764}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Third party feed is shown in Widgets.",
|
||||||
|
"guid": "{16d2b50e-fa7c-4bb1-ab17-01d766530b3b}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Third party Widgets are shown in Widgets feed.",
|
||||||
|
"guid": "{93f5099b-feeb-42c1-984b-c34851e100aa}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "First party Widget feed can be disabled.",
|
||||||
|
"guid": "{92ca7dcf-f422-4a4b-892e-7883a3ca8d70}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Use default web protocol for Widget links.",
|
||||||
|
"guid": "{3d0c862c-bfd8-4350-af2f-4c42884cc3a8}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Restrict Widgets data sharing.",
|
||||||
|
"guid": "{0dcb52b1-6b3f-4e95-8049-bf2281ae2eda}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Restrict third-party Widgets data sharing.",
|
||||||
|
"guid": "{4323bb73-d394-4c3a-b9df-224ab359844f}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "UTC events should be tagged restricted.",
|
||||||
|
"guid": "{dd5d7e7c-3ad7-4e38-b11b-a566f1510d00}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "XBox performance fit data sharing.",
|
||||||
|
"guid": "{cd69e9e4-3778-4418-ba1d-bf0116eeeebe}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Shared ODD consent.",
|
||||||
|
"guid": "{1f5403a8-5d44-40b9-a002-dda7ce7b0d01}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Windows CoPilot",
|
||||||
|
"guid": "{4ac54d32-0799-405f-9bf4-1fe094cd859c}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Automatic app sign-in",
|
||||||
|
"guid": "{1d290cdb-499c-4d42-938a-9b8dceffe998}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Notifications on the taskbar for Widgets.",
|
||||||
|
"guid": "{37bae007-d2ac-41e8-b1bb-848f04e7858f}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Show recent web searches in search zero input.",
|
||||||
|
"guid": "{3ffae667-623e-408e-bb30-9f670707c346}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Show website items in start recommendations.",
|
||||||
|
"guid": "{1ee2eff2-27f6-4103-b593-6e7d656a54df}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Widget sign-in is restricted to default account.",
|
||||||
|
"guid": "{1b4085de-aab1-43f6-9385-c5774b824be9}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Widget third-party taskbar badges are enabled.",
|
||||||
|
"guid": "{0446522c-1359-4a68-9e11-e7e46459b2e7}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Widgets should be restricted to static recommendations.",
|
||||||
|
"guid": "{263054fb-c39e-41d5-b712-23f340806ca8}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "First-party Widgets have optimized frame and taskbar integration.",
|
||||||
|
"guid": "{9f39df42-5d54-46fc-aa50-9ae3b1ecd663}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "News & Interest settings are shown.",
|
||||||
|
"guid": "{3b6022db-defd-4b4a-b6cf-6004dd657f3c}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Full screen user setup promotional surfaces are allowed.",
|
||||||
|
"guid": "{b5113273-5a79-4488-a7b4-0a4fc5d5b194}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Individual promotional pages within larger user setup flows are allowed.",
|
||||||
|
"guid": "{75b09d11-2e0d-4029-bd88-b91ec9a229bb}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Windows and first-party apps are allowed to access web browser user profile IDs.",
|
||||||
|
"guid": "{874ed11b-2ab7-4f1e-b275-6032092e3dda}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Promotion and direct launch of Edge instead of the default browser from campaigns is allowed",
|
||||||
|
"guid": "{2bf706de-6dbb-4692-b7ef-84d80c47e927}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Campaign segment targeting is allowed",
|
||||||
|
"guid": "{36996754-e327-483a-902f-523e2ba03239}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Widgets is shown as a Status app on Lock Screen",
|
||||||
|
"guid": "{f7281e17-d7eb-4224-89d0-8aa12a403410}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Third party apps can be expedited via UO infrastructure",
|
||||||
|
"guid": "{0d8903d8-84f5-4048-af3f-547476d83c3c}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Windows Copilot chat provider extensibility",
|
||||||
|
"guid": "{a9aacd21-327a-4747-adc1-9d8f1d0f6704}",
|
||||||
|
"defaultState": "disabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"enabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Full screen user setup promotional surfaces are allowed.",
|
||||||
|
"guid": "{b5113273-5a79-4488-a7b4-0a4fc5d5b194}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Individual promotional pages within larger user setup flows are allowed.",
|
||||||
|
"guid": "{75b09d11-2e0d-4029-bd88-b91ec9a229bb}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Windows and first-party apps are allowed to access web browser user profile IDs.",
|
||||||
|
"guid": "{874ed11b-2ab7-4f1e-b275-6032092e3dda}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Promotion and direct launch of Edge instead of the default browser from campaigns is allowed",
|
||||||
|
"guid": "{2bf706de-6dbb-4692-b7ef-84d80c47e927}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Campaign segment targeting is allowed",
|
||||||
|
"guid": "{36996754-e327-483a-902f-523e2ba03239}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$comment": "Show Copilot on taskbar by default when definitive answer is not received from Bing on user eligibility",
|
||||||
|
"guid": "{ff9e2d65-8af9-4235-a8c0-e4126475fb99}",
|
||||||
|
"defaultState": "enabled",
|
||||||
|
"conditions": {
|
||||||
|
"region": {
|
||||||
|
"disabled": ["CN", "RU" , "BY", "IR", "CU", "KP", "SY"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -52,7 +52,7 @@ If you have Issues, refer to [Known Issues](https://christitustech.github.io/win
|
|||||||
|
|
||||||
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/GregoryNavasarkian"><img src="https://github.com/GregoryNavasarkian.png" width="60px" alt="Gregory Navasarkian" /></a><a href="https://github.com/ysaito8015"><img src="https://github.com/ysaito8015.png" width="60px" alt="Yusuke Saito" /></a><a href="https://github.com/TriHydera"><img src="https://github.com/TriHydera.png" width="60px" alt="TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://github.com/jozozovko.png" width="60px" alt="" /></a><a href="https://github.com/DelDongo"><img src="https://github.com/DelDongo.png" width="60px" alt="" /></a><a href="https://github.com/markamos"><img src="https://github.com/markamos.png" width="60px" alt="Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="" /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="" /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://github.com/AlanTristar.png" width="60px" alt="" /></a><a href="https://github.com/JennJones89"><img src="https://github.com/JennJones89.png" width="60px" alt="" /></a><a href="https://github.com/zepled112"><img src="https://github.com/zepled112.png" width="60px" alt="wyatt" /></a><a href="https://github.com/Cube707"><img src="https://github.com/Cube707.png" width="60px" alt="Jan Wille" /></a><a href="https://github.com/Owen-3456"><img src="https://github.com/Owen-3456.png" width="60px" alt="Owen" /></a><a href="https://github.com/altugtekiner"><img src="https://github.com/altugtekiner.png" width="60px" alt="" /></a><a href="https://github.com/getsmor"><img src="https://github.com/getsmor.png" width="60px" alt="" /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="" /></a><a href="https://github.com/jeffnesbit"><img src="https://github.com/jeffnesbit.png" width="60px" alt="" /></a><a href="https://github.com/mmomega"><img src="https://github.com/mmomega.png" width="60px" alt="" /></a><a href="https://github.com/KenichiQaz"><img src="https://github.com/KenichiQaz.png" width="60px" alt="Stefan" /></a><a href="https://github.com/thaddl"><img src="https://github.com/thaddl.png" width="60px" alt="thaddl" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="Anthony Mendez" /></a><!-- sponsors -->
|
<!-- sponsors --><a href="https://github.com/GregoryNavasarkian"><img src="https://github.com/GregoryNavasarkian.png" width="60px" alt="Gregory Navasarkian" /></a><a href="https://github.com/ysaito8015"><img src="https://github.com/ysaito8015.png" width="60px" alt="Yusuke Saito" /></a><a href="https://github.com/TriHydera"><img src="https://github.com/TriHydera.png" width="60px" alt="TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://github.com/jozozovko.png" width="60px" alt="" /></a><a href="https://github.com/DelDongo"><img src="https://github.com/DelDongo.png" width="60px" alt="" /></a><a href="https://github.com/markamos"><img src="https://github.com/markamos.png" width="60px" alt="Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="" /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="" /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://github.com/AlanTristar.png" width="60px" alt="" /></a><a href="https://github.com/JennJones89"><img src="https://github.com/JennJones89.png" width="60px" alt="" /></a><a href="https://github.com/zepled112"><img src="https://github.com/zepled112.png" width="60px" alt="wyatt" /></a><a href="https://github.com/Owen-3456"><img src="https://github.com/Owen-3456.png" width="60px" alt="Owen" /></a><a href="https://github.com/altugtekiner"><img src="https://github.com/altugtekiner.png" width="60px" alt="" /></a><a href="https://github.com/getsmor"><img src="https://github.com/getsmor.png" width="60px" alt="" /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="" /></a><a href="https://github.com/jeffnesbit"><img src="https://github.com/jeffnesbit.png" width="60px" alt="" /></a><a href="https://github.com/mmomega"><img src="https://github.com/mmomega.png" width="60px" alt="" /></a><a href="https://github.com/KenichiQaz"><img src="https://github.com/KenichiQaz.png" width="60px" alt="Stefan" /></a><a href="https://github.com/thaddl"><img src="https://github.com/thaddl.png" width="60px" alt="thaddl" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="Anthony Mendez" /></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 🍻.
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -47,4 +47,4 @@
|
|||||||
"Primary6": "2a10:50c0::bad1:ff",
|
"Primary6": "2a10:50c0::bad1:ff",
|
||||||
"Secondary6": "2a10:50c0::bad2:ff"
|
"Secondary6": "2a10:50c0::bad2:ff"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1580,6 +1580,162 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"WPFTweaksEdgeDebloat": {
|
||||||
|
"Content": "Debloat Edge",
|
||||||
|
"Description": "Disables various telemetry options, popups, and other annoyances in Edge.",
|
||||||
|
"category": "Essential Tweaks",
|
||||||
|
"panel": "1",
|
||||||
|
"Order": "a016_",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\EdgeUpdate",
|
||||||
|
"Name": "CreateDesktopShortcutDefault",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "EdgeEnhanceImagesEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "PersonalizationReportingEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "ShowRecommendationsEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "HideFirstRunExperience",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "UserFeedbackAllowed",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "ConfigureDoNotTrack",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "AlternateErrorPagesEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "EdgeCollectionsEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "EdgeFollowEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "EdgeShoppingAssistantEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "MicrosoftEdgeInsiderPromotionEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "PersonalizationReportingEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "ShowMicrosoftRewards",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "WebWidgetAllowed",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "DiagnosticData",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "EdgeAssetDeliveryServiceEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "EdgeCollectionsEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "CryptoWalletEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "ConfigureDoNotTrack",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
|
"Name": "WalletDonationEnabled",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"WPFTweaksConsumerFeatures":{
|
"WPFTweaksConsumerFeatures":{
|
||||||
"Content": "Disable ConsumerFeatures",
|
"Content": "Disable ConsumerFeatures",
|
||||||
"Description": "Windows 10 will not automatically install any games, third-party apps, or application links from the Windows Store for the signed-in user. Some default Apps will be inaccessible (eg. Phone Link)",
|
"Description": "Windows 10 will not automatically install any games, third-party apps, or application links from the Windows Store for the signed-in user. Some default Apps will be inaccessible (eg. Phone Link)",
|
||||||
@ -2172,11 +2328,10 @@
|
|||||||
"microsoft.windowscommunicationsapps",
|
"microsoft.windowscommunicationsapps",
|
||||||
"Microsoft.WindowsFeedbackHub",
|
"Microsoft.WindowsFeedbackHub",
|
||||||
"Microsoft.WindowsMaps",
|
"Microsoft.WindowsMaps",
|
||||||
"Microsoft.WindowsPhone",
|
"Microsoft.YourPhone",
|
||||||
"Microsoft.WindowsSoundRecorder",
|
"Microsoft.WindowsSoundRecorder",
|
||||||
"Microsoft.XboxApp",
|
"Microsoft.XboxApp",
|
||||||
"Microsoft.ConnectivityStore",
|
"Microsoft.ConnectivityStore",
|
||||||
"Microsoft.CommsPhone",
|
|
||||||
"Microsoft.ScreenSketch",
|
"Microsoft.ScreenSketch",
|
||||||
"Microsoft.Xbox.TCUI",
|
"Microsoft.Xbox.TCUI",
|
||||||
"Microsoft.XboxGameOverlay",
|
"Microsoft.XboxGameOverlay",
|
||||||
@ -2277,7 +2432,7 @@
|
|||||||
|
|
||||||
# Check if the SystemRestorePointCreationFrequency value exists
|
# Check if the SystemRestorePointCreationFrequency value exists
|
||||||
$exists = Get-ItemProperty -path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\" -Name \"SystemRestorePointCreationFrequency\" -ErrorAction SilentlyContinue
|
$exists = Get-ItemProperty -path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\" -Name \"SystemRestorePointCreationFrequency\" -ErrorAction SilentlyContinue
|
||||||
if($null -eq $exists){
|
if($null -eq $exists) {
|
||||||
write-host 'Changing system to allow multiple restore points per day'
|
write-host 'Changing system to allow multiple restore points per day'
|
||||||
Set-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\" -Name \"SystemRestorePointCreationFrequency\" -Value \"0\" -Type DWord -Force -ErrorAction Stop | Out-Null
|
Set-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\" -Name \"SystemRestorePointCreationFrequency\" -Value \"0\" -Type DWord -Force -ErrorAction Stop | Out-Null
|
||||||
}
|
}
|
||||||
@ -2381,22 +2536,20 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"WPFTweaksRemoveEdge": {
|
"WPFTweaksRemoveEdge": {
|
||||||
"Content": "Remove Microsoft Edge - NOT RECOMMENDED",
|
"Content": "Remove Microsoft Edge",
|
||||||
"Description": "Removes MS Edge when it gets reinstalled by updates. Credit: AveYo",
|
"Description": "Removes MS Edge when it gets reinstalled by updates. Credit: Techie Jack",
|
||||||
"category": "z__Advanced Tweaks - CAUTION",
|
"category": "z__Advanced Tweaks - CAUTION",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a029_",
|
"Order": "a029_",
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"
|
"
|
||||||
#:: Standalone script by AveYo Source: https://raw.githubusercontent.com/AveYo/fox/main/Edge_Removal.bat
|
Uninstall-WinUtilEdgeBrowser
|
||||||
Invoke-WebRequest -Uri \"https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/edgeremoval.bat\" -OutFile \"$ENV:TEMP\\edgeremoval.bat\"
|
|
||||||
Start-Process $ENV:temp\\edgeremoval.bat
|
|
||||||
"
|
"
|
||||||
],
|
],
|
||||||
"UndoScript": [
|
"UndoScript": [
|
||||||
"
|
"
|
||||||
Write-Host \"Install Microsoft Edge\"
|
Write-Host \"Install Microsoft Edge\"
|
||||||
Start-Process -FilePath winget -ArgumentList \"install -e --accept-source-agreements --accept-package-agreements --silent Microsoft.Edge \" -NoNewWindow -Wait
|
Start-Process -FilePath winget -ArgumentList \"install --force -e --accept-source-agreements --accept-package-agreements --silent Microsoft.Edge \" -NoNewWindow -Wait
|
||||||
"
|
"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -2511,17 +2664,16 @@
|
|||||||
$OneDrivePath = $($env:OneDrive)
|
$OneDrivePath = $($env:OneDrive)
|
||||||
Write-Host \"Removing OneDrive\"
|
Write-Host \"Removing OneDrive\"
|
||||||
$regPath = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OneDriveSetup.exe\"
|
$regPath = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OneDriveSetup.exe\"
|
||||||
if (Test-Path $regPath){
|
if (Test-Path $regPath) {
|
||||||
$OneDriveUninstallString = Get-ItemPropertyValue \"$regPath\" -Name \"UninstallString\"
|
$OneDriveUninstallString = Get-ItemPropertyValue \"$regPath\" -Name \"UninstallString\"
|
||||||
$OneDriveExe, $OneDriveArgs = $OneDriveUninstallString.Split(\" \")
|
$OneDriveExe, $OneDriveArgs = $OneDriveUninstallString.Split(\" \")
|
||||||
Start-Process -FilePath $OneDriveExe -ArgumentList \"$OneDriveArgs /silent\" -NoNewWindow -Wait
|
Start-Process -FilePath $OneDriveExe -ArgumentList \"$OneDriveArgs /silent\" -NoNewWindow -Wait
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
Write-Host \"Onedrive dosn't seem to be installed anymore\" -ForegroundColor Red
|
Write-Host \"Onedrive dosn't seem to be installed anymore\" -ForegroundColor Red
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
# Check if OneDrive got Uninstalled
|
# Check if OneDrive got Uninstalled
|
||||||
if (-not (Test-Path $regPath)){
|
if (-not (Test-Path $regPath)) {
|
||||||
Write-Host \"Copy downloaded Files from the OneDrive Folder to Root UserProfile\"
|
Write-Host \"Copy downloaded Files from the OneDrive Folder to Root UserProfile\"
|
||||||
Start-Process -FilePath powershell -ArgumentList \"robocopy '$($OneDrivePath)' '$($env:USERPROFILE.TrimEnd())\\' /mov /e /xj\" -NoNewWindow -Wait
|
Start-Process -FilePath powershell -ArgumentList \"robocopy '$($OneDrivePath)' '$($env:USERPROFILE.TrimEnd())\\' /mov /e /xj\" -NoNewWindow -Wait
|
||||||
|
|
||||||
@ -2583,8 +2735,7 @@
|
|||||||
Write-Host \"Please Note - The OneDrive folder at $OneDrivePath may still have items in it. You must manually delete it, but all the files should already be copied to the base user folder.\"
|
Write-Host \"Please Note - The OneDrive folder at $OneDrivePath may still have items in it. You must manually delete it, but all the files should already be copied to the base user folder.\"
|
||||||
Write-Host \"If there are Files missing afterwards, please Login to Onedrive.com and Download them manually\" -ForegroundColor Yellow
|
Write-Host \"If there are Files missing afterwards, please Login to Onedrive.com and Download them manually\" -ForegroundColor Yellow
|
||||||
Start-Sleep 5
|
Start-Sleep 5
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
Write-Host \"Something went Wrong during the Unistallation of OneDrive\" -ForegroundColor Red
|
Write-Host \"Something went Wrong during the Unistallation of OneDrive\" -ForegroundColor Red
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
@ -2784,8 +2935,7 @@
|
|||||||
try {
|
try {
|
||||||
Invoke-WebRequest -Uri $remoteHostsUrl -OutFile $tempHostsPath
|
Invoke-WebRequest -Uri $remoteHostsUrl -OutFile $tempHostsPath
|
||||||
Write-Output \"Downloaded the remote HOSTS file to a temporary location.\"
|
Write-Output \"Downloaded the remote HOSTS file to a temporary location.\"
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Error \"Failed to download the HOSTS file. Error: $_\"
|
Write-Error \"Failed to download the HOSTS file. Error: $_\"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2811,8 +2961,7 @@
|
|||||||
$combinedContent | Set-Content $localHostsPath -Encoding ASCII
|
$combinedContent | Set-Content $localHostsPath -Encoding ASCII
|
||||||
Write-Output \"Successfully added the AdobeNetBlock.\"
|
Write-Output \"Successfully added the AdobeNetBlock.\"
|
||||||
}
|
}
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Error \"Error during processing: $_\"
|
Write-Error \"Error during processing: $_\"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2823,8 +2972,7 @@
|
|||||||
try {
|
try {
|
||||||
Invoke-Expression \"ipconfig /flushdns\"
|
Invoke-Expression \"ipconfig /flushdns\"
|
||||||
Write-Output \"DNS cache flushed successfully.\"
|
Write-Output \"DNS cache flushed successfully.\"
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Error \"Failed to flush DNS cache. Error: $_\"
|
Write-Error \"Failed to flush DNS cache. Error: $_\"
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
@ -2837,8 +2985,7 @@
|
|||||||
# Load the content of the HOSTS file
|
# Load the content of the HOSTS file
|
||||||
try {
|
try {
|
||||||
$hostsContent = Get-Content $localHostsPath -ErrorAction Stop
|
$hostsContent = Get-Content $localHostsPath -ErrorAction Stop
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Error \"Failed to load the HOSTS file. Error: $_\"
|
Write-Error \"Failed to load the HOSTS file. Error: $_\"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -2864,8 +3011,7 @@
|
|||||||
try {
|
try {
|
||||||
$newContent | Set-Content $localHostsPath -Encoding ASCII
|
$newContent | Set-Content $localHostsPath -Encoding ASCII
|
||||||
Write-Output \"Successfully removed the AdobeNetBlock section from the HOSTS file.\"
|
Write-Output \"Successfully removed the AdobeNetBlock section from the HOSTS file.\"
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Error \"Failed to write back to the HOSTS file. Error: $_\"
|
Write-Error \"Failed to write back to the HOSTS file. Error: $_\"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2873,8 +3019,7 @@
|
|||||||
try {
|
try {
|
||||||
Invoke-Expression \"ipconfig /flushdns\"
|
Invoke-Expression \"ipconfig /flushdns\"
|
||||||
Write-Output \"DNS cache flushed successfully.\"
|
Write-Output \"DNS cache flushed successfully.\"
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Error \"Failed to flush DNS cache. Error: $_\"
|
Write-Error \"Failed to flush DNS cache. Error: $_\"
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
@ -176,4 +176,4 @@ Get-Service -Name "XboxGipSvc" | Set-Service -StartupType Automatic
|
|||||||
7. **ISO File Integrity:**
|
7. **ISO File Integrity:**
|
||||||
Ensure that the ISO file you are trying to mount is uncorrupted. Try mounting a different ISO file to see if the issue persists.
|
Ensure that the ISO file you are trying to mount is uncorrupted. Try mounting a different ISO file to see if the issue persists.
|
||||||
|
|
||||||
* If the problem persists after trying these steps, additional troubleshooting is required. Consider seeking assistance from Microsoft support or community forums for more specific guidance based on your system configuration and the software you use to mount the ISO.
|
* If the problem persists after trying these steps, additional troubleshooting is required. Consider seeking assistance from Microsoft support or community forums for more specific guidance based on your system configuration and the software you use to mount the ISO.
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
```ps1
|
```ps1
|
||||||
irm christitus.com/windev | iex
|
irm christitus.com/windev | iex
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! bug "Keep in mind"
|
!!! bug "Keep in mind"
|
||||||
|
|
||||||
This is a pre-release and should be treated as such. It exists for developers to test the utility and report or fix bugs before they get added to the stable release. Don't use it in production!
|
This is a pre-release and should be treated as such. It exists for developers to test the utility and report or fix bugs before they get added to the stable release. Don't use it in production!
|
||||||
@ -46,18 +46,20 @@
|
|||||||
### Overview
|
### Overview
|
||||||
|
|
||||||
``` mermaid
|
``` mermaid
|
||||||
graph LR
|
%%{init: {"flowchart": {"curve": "cardinal"}} }%%
|
||||||
|
graph TD
|
||||||
A[Fork Project] --> B[Clone Repository];
|
A[Fork Project] --> B[Clone Repository];
|
||||||
B --> C[Create New Branch];
|
B --> C[Create New Branch];
|
||||||
C --> D[Make Changes];
|
C --> D[Make Changes];
|
||||||
D --> G[Test Changes];
|
D --> G[Test Changes];
|
||||||
G --> H{Tests Passed?};
|
G --> H{Tests Passed?};
|
||||||
H -->|Yes| E[Commit Changes];
|
H -->|Yes| E[Commit Changes];
|
||||||
E --> F[Push Branch];
|
|
||||||
H -->|No| J[Fix Issues];
|
H -->|No| J[Fix Issues];
|
||||||
|
J --> G;
|
||||||
|
E --> F[Push Branch];
|
||||||
F --> K[Create Pull Request];
|
F --> K[Create Pull Request];
|
||||||
K --> L[Fill out PR template];
|
K --> L[Fill out PR template];
|
||||||
J --> G;
|
classDef default stroke:#333,stroke-width:4px,font-size:12pt;
|
||||||
```
|
```
|
||||||
!!! info
|
!!! info
|
||||||
|
|
||||||
@ -65,8 +67,10 @@ graph LR
|
|||||||
|
|
||||||
### Fork the Repo
|
### Fork the Repo
|
||||||
* Fork the WinUtil Repository [here](https://github.com/ChrisTitusTech/winutil) to create a copy that will be available in your repository list.
|
* Fork the WinUtil Repository [here](https://github.com/ChrisTitusTech/winutil) to create a copy that will be available in your repository list.
|
||||||
|
|
||||||
![Fork Image](assets/Fork-Button-Dark.png#only-dark)
|
![Fork Image](assets/Fork-Button-Dark.png#only-dark)
|
||||||
![FOrk Image](assets/Fork-Button-Light.png#only-light)
|
|
||||||
|
![Fork Image](assets/Fork-Button-Light.png#only-light)
|
||||||
|
|
||||||
### Clone the Fork
|
### Clone the Fork
|
||||||
!!! tip
|
!!! tip
|
||||||
@ -89,18 +93,25 @@ graph LR
|
|||||||
* `cd {path to the folder with the compile.ps1}`
|
* `cd {path to the folder with the compile.ps1}`
|
||||||
* Run the following command to compile and run WinUtil:
|
* Run the following command to compile and run WinUtil:
|
||||||
* `.\Compile.ps1 -run`
|
* `.\Compile.ps1 -run`
|
||||||
* ![Compile](assets/Compile.png)
|
|
||||||
|
![Compile](assets/Compile.png)
|
||||||
|
|
||||||
* After seeing that your changes work properly, feel free to commit the changes to the repository and make a PR. For help on that, follow the documentation below.
|
* After seeing that your changes work properly, feel free to commit the changes to the repository and make a PR. For help on that, follow the documentation below.
|
||||||
|
|
||||||
### Committing the changes
|
### Committing the changes
|
||||||
* Before committing your changes, please discard changes made to the `winutil.ps1` file, like the following:
|
* Before committing your changes, please discard changes made to the `winutil.ps1` file, like the following:
|
||||||
- ![Push Commit Image](assets/Discard-GHD.png)
|
|
||||||
|
![Push Commit Image](assets/Discard-GHD.png)
|
||||||
|
|
||||||
* Now, commit your changes once you are happy with the result.
|
* Now, commit your changes once you are happy with the result.
|
||||||
|
|
||||||
![Commit Image](assets/Commit-GHD.png)
|
![Commit Image](assets/Commit-GHD.png)
|
||||||
|
|
||||||
* Push the changes to upload them to your fork on github.com.
|
* Push the changes to upload them to your fork on github.com.
|
||||||
|
|
||||||
![Push Commit Image](assets/Push-Commit.png)
|
![Push Commit Image](assets/Push-Commit.png)
|
||||||
|
|
||||||
### Making a PR
|
### Making a PR
|
||||||
* To make a PR on your repo under a new branch linking to the main branch, a button will show and say Preview and Create pull request. Click that button and fill in all the information that is provided on the template. Once all the information is filled in correctly, check your PR to make sure there is not a WinUtil.ps1 file attached to the PR. Once everything is good, make the PR and wait for Chris (the maintainer) to accept or deny your PR. Once it is accepted by Chris, you will be able to see your changes in the "/windev" build.
|
* To make a PR on your repo under a new branch linking to the main branch, a button will show and say Preview and Create pull request. Click that button and fill in all the information that is provided on the template. Once all the information is filled in correctly, check your PR to make sure there is not a WinUtil.ps1 file attached to the PR. Once everything is good, make the PR and wait for Chris (the maintainer) to accept or deny your PR. Once it is accepted by Chris, you will be able to see your changes in the "/windev" build.
|
||||||
* If you do not see your feature in the main "/win" build, that is fine. All new changes go into the /windev build to make sure everything is working OK before going fully public.
|
* If you do not see your feature in the main "/win" build, that is fine. All new changes go into the /windev build to make sure everything is working OK before going fully public.
|
||||||
* Congratulations! You just submitted your first PR. Thank you so much for contributing to WinUtil.
|
* Congratulations! You just submitted your first PR. Thank you so much for contributing to WinUtil.
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
[![Version](https://img.shields.io/github/v/release/ChrisTitusTech/winutil?color=%230567ff&label=Latest%20Release&style=for-the-badge)](https://github.com/ChrisTitusTech/winutil/releases/latest)
|
[![Version](https://img.shields.io/github/v/release/ChrisTitusTech/winutil?color=%230567ff&label=Latest%20Release&style=for-the-badge)](https://github.com/ChrisTitusTech/winutil/releases/latest)
|
||||||
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/winutil.ps1?label=Total%20Downloads&style=for-the-badge)
|
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/winutil.ps1?label=Total%20Downloads&style=for-the-badge)
|
||||||
|
|
||||||
[![Discord Community Server](https://dcbadge.limes.pink/api/server/https://discord.gg/RUbZUZyByQ)](https://discord.gg/RUbZUZyByQ)
|
[![Discord Community Server](https://dcbadge.limes.pink/api/server/https://discord.gg/RUbZUZyByQ)](https://discord.gg/RUbZUZyByQ)
|
||||||
|
|
||||||
Welcome to the official documentation for WinUtil, your go-to utility for optimizing and managing your Windows environment. Whether you’re an IT professional, power user, or regular user, WinUtil provides a comprehensive set of tools to enhance your Windows experience.
|
Welcome to the official documentation for WinUtil, your go-to utility for optimizing and managing your Windows environment. Whether you’re an IT professional, power user, or regular user, WinUtil provides a comprehensive set of tools to enhance your Windows experience.
|
||||||
@ -17,4 +16,4 @@ Welcome to the official documentation for WinUtil, your go-to utility for optimi
|
|||||||
|
|
||||||
!!! info
|
!!! info
|
||||||
|
|
||||||
WinUtil is updated weekly as of the time of writing. Consequently, features and functionalities may evolve, and the documentation may not always reflect the most current images or information.
|
WinUtil is updated weekly as of the time of writing. Consequently, features and functionalities may evolve, and the documentation may not always reflect the most current images or information.
|
||||||
|
236
edgeremoval.bat
236
edgeremoval.bat
@ -1,236 +0,0 @@
|
|||||||
@(set "0=%~f0"^)#) & powershell -nop -c iex([io.file]::ReadAllText($env:0)) & exit /b
|
|
||||||
#:: made by AveYo source: https://raw.githubusercontent.com/AveYo/fox/main/Edge_Removal.bat
|
|
||||||
sp 'HKCU:\Volatile Environment' 'Edge_Removal' @'
|
|
||||||
|
|
||||||
$also_remove_webview = 0
|
|
||||||
|
|
||||||
$host.ui.RawUI.WindowTitle = 'Edge Removal - AveYo, 2023.09.09'
|
|
||||||
$remove_win32 = @("Microsoft Edge","Microsoft Edge Update"); $remove_appx = @("MicrosoftEdge"); $skip = @() # @("DevTools")
|
|
||||||
if ($also_remove_webview -eq 1) {$remove_win32 += "Microsoft EdgeWebView"; $remove_appx += "WebExperience","Win32WebViewHost"}
|
|
||||||
|
|
||||||
## 1 bonus! enter into powershell console: firefox / edge / webview to install a browser / reinstall edge or webview after removal
|
|
||||||
function global:firefox { $url = 'https://download.mozilla.org/?product=firefox-stub'
|
|
||||||
$setup = "$((new-object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path)\Firefox Installer.exe"
|
|
||||||
write-host $url; Invoke-WebRequest $url -OutFile $setup; start $setup
|
|
||||||
}
|
|
||||||
function global:edge { $url = 'https://go.microsoft.com/fwlink/?linkid=2108834&Channel=Stable&language=en'
|
|
||||||
$setup = "$((new-object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path)\MicrosoftEdgeSetup.exe"
|
|
||||||
write-host $url; Invoke-WebRequest $url -OutFile $setup; prepare_edge; start $setup
|
|
||||||
}
|
|
||||||
function global:webview { $url = 'https://go.microsoft.com/fwlink/p/?LinkId=2124703'
|
|
||||||
$setup = "$((new-object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path)\MicrosoftEdgeWebview2Setup.exe"
|
|
||||||
write-host $url; Invoke-WebRequest $url -OutFile $setup; prepare_webview; start $setup
|
|
||||||
}
|
|
||||||
## helper for set-itemproperty remove-itemproperty new-item remove-item with auto test-path
|
|
||||||
function global:sp_test_path { if (test-path $args[0]) {Microsoft.PowerShell.Management\Set-ItemProperty @args} else {
|
|
||||||
Microsoft.PowerShell.Management\New-Item $args[0] -force -ea 0 >''; Microsoft.PowerShell.Management\Set-ItemProperty @args} }
|
|
||||||
function global:rp_test_path { if (test-path $args[0]) {Microsoft.PowerShell.Management\Remove-ItemProperty @args} }
|
|
||||||
function global:ni_test_path { if (-not (test-path $args[0])) {Microsoft.PowerShell.Management\New-Item @args} }
|
|
||||||
function global:ri_test_path { if (test-path $args[0]) {Microsoft.PowerShell.Management\Remove-Item @args} }
|
|
||||||
foreach ($f in 'sp','rp','ni','ri') {set-alias -Name $f -Value "${f}_test_path" -Scope Local -Option AllScope -force -ea 0}
|
|
||||||
## helper for edge reinstall - remove bundled OpenWebSearch redirector and edgeupdate policies
|
|
||||||
function global:prepare_edge {
|
|
||||||
foreach ($f in 'ni','ri','sp','rp') {set-alias -Name $f -Value "${f}_test_path" -Scope Local -Option AllScope -force -ea 0}
|
|
||||||
$MS=($env:ProgramFiles,${env:ProgramFiles(x86)})[[Environment]::Is64BitOperatingSystem]+'\Microsoft\Edge\Application\msedge.exe'
|
|
||||||
ri "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe" -recurse -force -ea 0
|
|
||||||
ri "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ie_to_edge_stub.exe" -recurse -force -ea 0
|
|
||||||
ri 'Registry::HKEY_Users\S-1-5-21*\Software\Classes\microsoft-edge' -recurse -force -ea 0
|
|
||||||
ri 'Registry::HKEY_Users\S-1-5-21*\Software\Classes\MSEdgeHTM' -recurse -force -ea 0
|
|
||||||
ni "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" -force -ea 0 >''
|
|
||||||
sp "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" '(Default)' "`"$MS`" --single-argument %%1" -force -ea 0
|
|
||||||
ni "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" -force -ea 0 >''
|
|
||||||
sp "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" '(Default)' "`"$MS`" --single-argument %%1" -force -ea 0
|
|
||||||
foreach ($p in 'HKLM:\SOFTWARE\Policies','HKLM:\SOFTWARE','HKLM:\SOFTWARE\WOW6432Node') {
|
|
||||||
rp "$p\Microsoft\EdgeUpdate" 'InstallDefault' -force -ea 0
|
|
||||||
rp "$p\Microsoft\EdgeUpdate" 'Install{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}' -force -ea 0
|
|
||||||
rp "$p\Microsoft\EdgeUpdate" 'Install{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}' -force -ea 0
|
|
||||||
}
|
|
||||||
$edgeupdate='Microsoft\EdgeUpdate\Clients\{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}'
|
|
||||||
$webvupdate='Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
|
|
||||||
$on_actions='on-os-upgrade','on-logon','on-logon-autolaunch','on-logon-startup-boost'
|
|
||||||
foreach ($p in 'HKLM:\SOFTWARE','HKLM:\SOFTWARE\Wow6432Node') { foreach ($launch in $on_actions) {
|
|
||||||
ri "$p\$edgeupdate\Commands\$launch" -force -ea 0; ri "$p\$webvupdate\Commands\$launch" -force -ea 0
|
|
||||||
}}
|
|
||||||
}
|
|
||||||
## helper for webview reinstall - restore webexperience (widgets) if available
|
|
||||||
function global:prepare_webview {
|
|
||||||
$cfg = @{Register=$true; ForceApplicationShutdown=$true; ForceUpdateFromAnyVersion=$true; DisableDevelopmentMode=$true}
|
|
||||||
dir "$env:ProgramFiles\WindowsApps\MicrosoftWindows.Client.WebExperience*\AppxManifest.xml" -rec -ea 0 | Add-AppxPackage @cfg
|
|
||||||
dir "$env:SystemRoot\SystemApps\Microsoft.Win32WebViewHost*\AppxManifest.xml" -rec -ea 0 | Add-AppxPackage @cfg
|
|
||||||
kill -name explorer -ea 0; if ((get-process -name 'explorer' -ea 0) -eq $null) {start explorer}
|
|
||||||
}
|
|
||||||
|
|
||||||
## 2 enable admin privileges
|
|
||||||
$D1=[uri].module.gettype('System.Diagnostics.Process')."GetM`ethods"(42) |where {$_.Name -eq 'SetPrivilege'} #`:no-ev-warn
|
|
||||||
'SeSecurityPrivilege','SeTakeOwnershipPrivilege','SeBackupPrivilege','SeRestorePrivilege'|foreach {$D1.Invoke($null, @("$_",2))}
|
|
||||||
|
|
||||||
## 3 shut edge & webview clone stuff down and gather install paths
|
|
||||||
$shut = 'explorer','Widgets','widgetservice','msedgewebview2','MicrosoftEdge*','chredge','msedge','edge'
|
|
||||||
$shut+= 'msteams','msfamily','WebViewHost','Clipchamp'
|
|
||||||
cd $env:systemdrive; taskkill /im explorer.exe /f 2>&1 >''; foreach ($p in $shut) {kill -name $p -force -ea 0}
|
|
||||||
prepare_edge
|
|
||||||
## clear win32 uninstall block
|
|
||||||
foreach ($hk in 'HKCU:','HKLM:') { foreach ($wow in '','\Wow6432Node') { foreach ($i in $remove_win32) {
|
|
||||||
rp "$hk\SOFTWARE${wow}\Microsoft\Windows\CurrentVersion\Uninstall\$i" 'NoRemove' -force -ea 0
|
|
||||||
ni "$hk\SOFTWARE${wow}\Microsoft\EdgeUpdateDev" -force >''
|
|
||||||
sp "$hk\SOFTWARE${wow}\Microsoft\EdgeUpdateDev" 'AllowUninstall' 1 -type Dword -force
|
|
||||||
}}}
|
|
||||||
## find all Edge setup.exe and gather BHO paths for OpenWebSearch / MSEdgeRedirect usage
|
|
||||||
$edges = @(); $bho = @(); 'LocalApplicationData','ProgramFilesX86','ProgramFiles' |foreach {
|
|
||||||
$folder = [Environment]::GetFolderPath($_); $bho += dir "$folder\Microsoft\Edge*\ie_to_edge_stub.exe" -rec -ea 0
|
|
||||||
if ($also_remove_webview -eq 1) {$edges += dir "$folder\Microsoft\Edge*\setup.exe" -rec -ea 0 |where {$_ -like '*EdgeWebView*'}}
|
|
||||||
$edges += dir "$folder\Microsoft\Edge*\setup.exe" -rec -ea 0 |where {$_ -notlike '*EdgeWebView*'}
|
|
||||||
}
|
|
||||||
## use dedicated C:\Scripts path to save OpenWebSearch (due to Sigma rules FUD)
|
|
||||||
$DIR = "$env:SystemDrive\Scripts"; mkdir $DIR -ea 0 >''
|
|
||||||
## export OpenWebSearch innovative redirector - used by MSEdgeRedirect as well
|
|
||||||
foreach ($b in $bho) { if (test-path $b) { try {copy $b "$DIR\ie_to_edge_stub.exe" -force -ea 0} catch{} } }
|
|
||||||
|
|
||||||
## 4 remove found *Edge* appx packages with unblock tricks
|
|
||||||
$provisioned = get-appxprovisionedpackage -online; $appxpackage = get-appxpackage -allusers; $eol = @()
|
|
||||||
$store = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore'
|
|
||||||
$users = @('S-1-5-18'); if (test-path $store) {$users += $((dir $store -ea 0 |where {$_ -like '*S-1-5-21*'}).PSChildName)}
|
|
||||||
foreach ($choice in $remove_appx) { if ('' -eq $choice.Trim()) {continue}
|
|
||||||
foreach ($appx in $($provisioned |where {$_.PackageName -like "*$choice*"})) {
|
|
||||||
$next = !1; foreach ($no in $skip) {if ($appx.PackageName -like "*$no*") {$next = !0}} ; if ($next) {continue}
|
|
||||||
$PackageName = $appx.PackageName; $PackageFamilyName = ($appxpackage |where {$_.Name -eq $appx.DisplayName}).PackageFamilyName
|
|
||||||
ni "$store\Deprovisioned\$PackageFamilyName" -force >''; $PackageFamilyName
|
|
||||||
foreach ($sid in $users) {ni "$store\EndOfLife\$sid\$PackageName" -force >''} ; $eol += $PackageName
|
|
||||||
dism /online /set-nonremovableapppolicy /packagefamily:$PackageFamilyName /nonremovable:0 >''
|
|
||||||
remove-appxprovisionedpackage -packagename $PackageName -online -allusers >''
|
|
||||||
}
|
|
||||||
foreach ($appx in $($appxpackage |where {$_.PackageFullName -like "*$choice*"})) {
|
|
||||||
$next = !1; foreach ($no in $skip) {if ($appx.PackageFullName -like "*$no*") {$next = !0}} ; if ($next) {continue}
|
|
||||||
$PackageFullName = $appx.PackageFullName;
|
|
||||||
ni "$store\Deprovisioned\$appx.PackageFamilyName" -force >''; $PackageFullName
|
|
||||||
foreach ($sid in $users) {ni "$store\EndOfLife\$sid\$PackageFullName" -force >''} ; $eol += $PackageFullName
|
|
||||||
dism /online /set-nonremovableapppolicy /packagefamily:$PackageFamilyName /nonremovable:0 >''
|
|
||||||
remove-appxpackage -package $PackageFullName -allusers >''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
## 5 run found *Edge* setup.exe with uninstall args and wait in-between
|
|
||||||
foreach ($setup in $edges) { if (test-path $setup) {
|
|
||||||
if ($setup -like '*EdgeWebView*') {$target = "--msedgewebview"} else {$target = "--msedge"}
|
|
||||||
$removal = "--uninstall $target --system-level --verbose-logging --force-uninstall"
|
|
||||||
try {write-host $setup $removal; start -wait $setup -args $removal} catch {}
|
|
||||||
do {sleep 3} while ((get-process -name 'setup','MicrosoftEdge*' -ea 0).Path -like '*\Microsoft\Edge*')
|
|
||||||
}}
|
|
||||||
|
|
||||||
## 6 extra cleanup
|
|
||||||
foreach ($PF in $env:ProgramFiles,${env:ProgramFiles(x86)}) { if (test-path "$PF\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe") {
|
|
||||||
write-host "$PF\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe /uninstall"
|
|
||||||
start -wait "$PF\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe" -args '/uninstall'
|
|
||||||
do {sleep 3} while ((get-process -name 'setup','MicrosoftEdge*' -ea 0).Path -like '*\Microsoft\Edge*')
|
|
||||||
if ($also_remove_webview -eq 1) { foreach ($hk in 'HKCU:','HKLM:') { foreach ($wow in '','\Wow6432Node') {
|
|
||||||
ri "$hk\SOFTWARE${wow}\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" -rec -force -ea 0 }}
|
|
||||||
ri "$PF\Microsoft\EdgeUpdate" -rec -force -ea 0; Unregister-ScheduledTask -TaskName MicrosoftEdgeUpdate* -Confirm:$false -ea 0
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
$appdata = $([Environment]::GetFolderPath('ApplicationData'))
|
|
||||||
ri "$appdata\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Tombstones\Microsoft Edge.lnk" -force
|
|
||||||
ri "$appdata\Microsoft\Internet Explorer\Quick Launch\Microsoft Edge.lnk" -force
|
|
||||||
|
|
||||||
## undo eol unblock trick to prevent latest cumulative update (LCU) failing
|
|
||||||
foreach ($sid in $users) { foreach ($PackageName in $eol) {ri "$store\EndOfLife\$sid\$PackageName" -force >''} }
|
|
||||||
|
|
||||||
## set (almost) useless policies to prevent unsolicited reinstalls
|
|
||||||
foreach ($p in 'HKLM:\SOFTWARE\Policies','HKLM:\SOFTWARE','HKLM:\SOFTWARE\WOW6432Node') {
|
|
||||||
ni "$p\Microsoft\EdgeUpdate" -force >''
|
|
||||||
sp "$p\Microsoft\EdgeUpdate" 'InstallDefault' 0 -type Dword -force
|
|
||||||
sp "$p\Microsoft\EdgeUpdate" 'Install{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}' 0 -type Dword -force
|
|
||||||
sp "$p\Microsoft\EdgeUpdate" 'Install{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}' 1 -type Dword -force
|
|
||||||
sp "$p\Microsoft\EdgeUpdate" 'DoNotUpdateToEdgeWithChromium' 1 -type Dword -force
|
|
||||||
}
|
|
||||||
$edgeupdate='Microsoft\EdgeUpdate\Clients\{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}'
|
|
||||||
$webvupdate='Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
|
|
||||||
$on_actions='on-os-upgrade','on-logon','on-logon-autolaunch','on-logon-startup-boost'
|
|
||||||
foreach ($p in 'HKLM:\SOFTWARE','HKLM:\SOFTWARE\Wow6432Node') { foreach ($launch in $on_actions) {
|
|
||||||
ni "$p\$edgeupdate\Commands\$launch" -force >''; sp "$p\$edgeupdate\Commands\$launch" 'CommandLine' 'systray.exe' -force
|
|
||||||
ni "$p\$webvupdate\Commands\$launch" -force >''; sp "$p\$webvupdate\Commands\$launch" 'CommandLine' 'systray.exe' -force
|
|
||||||
}}
|
|
||||||
|
|
||||||
## 7 add bundled OpenWebSearch script to redirect microsoft-edge: anti-competitive links to the default browser
|
|
||||||
$MSEP = ($env:ProgramFiles,${env:ProgramFiles(x86)})[[Environment]::Is64BitOperatingSystem] + '\Microsoft\Edge\Application'
|
|
||||||
$IFEO = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options'
|
|
||||||
$MIN = ('--headless','--width 1 --height 1')[([environment]::OSVersion.Version.Build) -gt 25179]
|
|
||||||
$CMD = "$env:systemroot\system32\conhost.exe $MIN" # AveYo: minimize prompt - see Terminal issue #13914
|
|
||||||
ni "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" -force >''
|
|
||||||
sp "HKLM:\SOFTWARE\Classes\microsoft-edge" '(Default)' 'URL:microsoft-edge' -force
|
|
||||||
sp "HKLM:\SOFTWARE\Classes\microsoft-edge" 'URL Protocol' '' -force
|
|
||||||
sp "HKLM:\SOFTWARE\Classes\microsoft-edge" 'NoOpenWith' '' -force
|
|
||||||
sp "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" '(Default)' "`"$DIR\ie_to_edge_stub.exe`" %1" -force
|
|
||||||
ni "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" -force >''
|
|
||||||
sp "HKLM:\SOFTWARE\Classes\MSEdgeHTM" 'NoOpenWith' '' -force
|
|
||||||
sp "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" '(Default)' "`"$DIR\ie_to_edge_stub.exe`" %1" -force
|
|
||||||
ni "$IFEO\ie_to_edge_stub.exe\0" -force >''
|
|
||||||
sp "$IFEO\ie_to_edge_stub.exe" 'UseFilter' 1 -type Dword -force
|
|
||||||
sp "$IFEO\ie_to_edge_stub.exe\0" 'FilterFullPath' "$DIR\ie_to_edge_stub.exe" -force
|
|
||||||
sp "$IFEO\ie_to_edge_stub.exe\0" 'Debugger' "$CMD $DIR\OpenWebSearch.cmd" -force
|
|
||||||
ni "$IFEO\msedge.exe\0" -force >''
|
|
||||||
sp "$IFEO\msedge.exe" 'UseFilter' 1 -type Dword -force
|
|
||||||
sp "$IFEO\msedge.exe\0" 'FilterFullPath' "$MSEP\msedge.exe" -force
|
|
||||||
sp "$IFEO\msedge.exe\0" 'Debugger' "$CMD $DIR\OpenWebSearch.cmd" -force
|
|
||||||
|
|
||||||
$OpenWebSearch = @$
|
|
||||||
@title OpenWebSearch Redux & echo off & set ?= open start menu web search, widgets links or help in your chosen browser - by AveYo
|
|
||||||
for /f %%E in ('"prompt $E$S& for %%e in (1) do rem"') do echo;%%E[2t 2>nul & rem AveYo: minimize prompt
|
|
||||||
call :reg_var "HKCU\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice" ProgID ProgID
|
|
||||||
if /i "%ProgID%" equ "MSEdgeHTM" echo;Default browser is set to Edge! Change it or remove OpenWebSearch script. & pause & exit /b
|
|
||||||
call :reg_var "HKCR\%ProgID%\shell\open\command" "" Browser
|
|
||||||
set Choice=& for %%. in (%Browser%) do if not defined Choice set "Choice=%%~."
|
|
||||||
call :reg_var "HKCR\MSEdgeMHT\shell\open\command" "" FallBack
|
|
||||||
set "Edge=" & for %%. in (%FallBack%) do if not defined Edge set "Edge=%%~."
|
|
||||||
set "URI=" & set "URL=" & set "NOOP=" & set "PassTrough=%Edge:msedge=edge%"
|
|
||||||
set "CLI=%CMDCMDLINE:"=``% "
|
|
||||||
if defined CLI set "CLI=%CLI:*ie_to_edge_stub.exe`` =%"
|
|
||||||
if defined CLI set "CLI=%CLI:*ie_to_edge_stub.exe =%"
|
|
||||||
if defined CLI set "CLI=%CLI:*msedge.exe`` =%"
|
|
||||||
if defined CLI set "CLI=%CLI:*msedge.exe =%"
|
|
||||||
set "FIX=%CLI:~-1%"
|
|
||||||
if defined CLI if "%FIX%"==" " set "CLI=%CLI:~0,-1%"
|
|
||||||
if defined CLI set "RED=%CLI:microsoft-edge=%"
|
|
||||||
if defined CLI set "URL=%CLI:http=%"
|
|
||||||
if defined CLI set "ARG=%CLI:``="%"
|
|
||||||
if "%CLI%" equ "%RED%" (set NOOP=1) else if "%CLI%" equ "%URL%" (set NOOP=1)
|
|
||||||
if defined NOOP if exist "%PassTrough%" start "" "%PassTrough%" %ARG%
|
|
||||||
if defined NOOP exit /b
|
|
||||||
set "URL=%CLI:*microsoft-edge=%"
|
|
||||||
set "URL=http%URL:*http=%"
|
|
||||||
set "FIX=%URL:~-2%"
|
|
||||||
if defined URL if "%FIX%"=="``" set "URL=%URL:~0,-2%"
|
|
||||||
call :dec_url
|
|
||||||
start "" "%Choice%" "%URL%"
|
|
||||||
exit
|
|
||||||
|
|
||||||
:reg_var [USAGE] call :reg_var "HKCU\Volatile Environment" value-or-"" variable [extra options]
|
|
||||||
set {var}=& set {reg}=reg query "%~1" /v %2 /z /se "," /f /e& if %2=="" set {reg}=reg query "%~1" /ve /z /se "," /f /e
|
|
||||||
for /f "skip=2 tokens=* delims=" %%V in ('%{reg}% %4 %5 %6 %7 %8 %9 2^>nul') do if not defined {var} set "{var}=%%V"
|
|
||||||
if not defined {var} (set {reg}=& set "%~3="& exit /b) else if %2=="" set "{var}=%{var}:*) =%"& rem AveYo: v3
|
|
||||||
if not defined {var} (set {reg}=& set "%~3="& exit /b) else set {reg}=& set "%~3=%{var}:*) =%"& set {var}=& exit /b
|
|
||||||
|
|
||||||
:dec_url brute url percent decoding by AveYo
|
|
||||||
set ".=%URL:!=}%"&setlocal enabledelayedexpansion& rem brute url percent decoding
|
|
||||||
set ".=!.:%%={!" &set ".=!.:{3A=:!" &set ".=!.:{2F=/!" &set ".=!.:{3F=?!" &set ".=!.:{23=#!" &set ".=!.:{5B=[!" &set ".=!.:{5D=]!"
|
|
||||||
set ".=!.:{40=@!"&set ".=!.:{21=}!" &set ".=!.:{24=$!" &set ".=!.:{26=&!" &set ".=!.:{27='!" &set ".=!.:{28=(!" &set ".=!.:{29=)!"
|
|
||||||
set ".=!.:{2A=*!"&set ".=!.:{2B=+!" &set ".=!.:{2C=,!" &set ".=!.:{3B=;!" &set ".=!.:{3D==!" &set ".=!.:{25=%%!"&set ".=!.:{20= !"
|
|
||||||
set ".=!.:{=%%!" &rem set ",=!.:%%=!" & if "!,!" neq "!.!" endlocal& set "URL=%.:}=!%" & call :dec_url
|
|
||||||
endlocal& set "URL=%.:}=!%" & exit /b
|
|
||||||
rem done
|
|
||||||
|
|
||||||
$@
|
|
||||||
[io.file]::WriteAllText("$DIR\OpenWebSearch.cmd", $OpenWebSearch)
|
|
||||||
|
|
||||||
## 8 done
|
|
||||||
$done = gp 'Registry::HKEY_Users\S-1-5-21*\Volatile*' Edge_Removal -ea 0; if ($done) {rp $done.PSPath Edge_Removal -force -ea 0}
|
|
||||||
if ((get-process -name 'explorer' -ea 0) -eq $null) {start explorer}
|
|
||||||
|
|
||||||
## 9 bonus enter into powershell console: firefox / edge / webview to install a browser / reinstall edge or webview after removal
|
|
||||||
${.} = [char]27; $firefox = "${.}[38;2;255;165;0m firefox"; $edge = "${.}[94m edge${.}[97m"; $webview = "${.}[94mwebview ${.}[97m"
|
|
||||||
write-host "`n${.}[40;32m EDGE REMOVED! ${.}[97m -GET-ANOTHER-BROWSER? ENTER:$firefox ${.}[97m -REINSTALL? ENTER:$edge / $webview"
|
|
||||||
|
|
||||||
## 0 ask to run script as admin
|
|
||||||
'@.replace("$@","'@").replace("@$","@'") -force -ea 0; $code='gp ''Registry::HKEY_Users\S-1-5-21*\Volatile*'' Edge_Removal -ea 0'
|
|
||||||
start powershell -args "-nop -noe -c & {iex(($code)[0].Edge_Removal)}" -verb runas
|
|
||||||
$_Press_Enter
|
|
||||||
#::
|
|
349
edgeremoval.ps1
349
edgeremoval.ps1
@ -1,253 +1,138 @@
|
|||||||
# Script Metadata
|
$msedgeProcess = Get-Process -Name "msedge" -ErrorAction SilentlyContinue
|
||||||
# Created by AveYo, source: https://raw.githubusercontent.com/AveYo/fox/main/Edge_Removal.bat
|
$widgetsProcess = Get-Process -Name "widgets" -ErrorAction SilentlyContinue
|
||||||
# Powershell Conversion and Refactor done by Chris Titus Tech
|
# Checking if Microsoft Edge is running
|
||||||
|
if ($msedgeProcess) {
|
||||||
# Initial Configuration
|
Stop-Process -Name "msedge" -Force
|
||||||
$host.ui.RawUI.WindowTitle = 'Edge Removal - Chris Titus Tech 2023.05.10'
|
} else {
|
||||||
$remove_win32 = @("Microsoft Edge", "Microsoft Edge Update")
|
Write-Output "msedge process is not running."
|
||||||
$remove_appx = @("MicrosoftEdge")
|
}
|
||||||
$skip = @() # Optional: @("DevTools")
|
# Checking if Widgets is running
|
||||||
|
if ($widgetsProcess) {
|
||||||
$also_remove_webview = 0
|
Stop-Process -Name "widgets" -Force
|
||||||
if ($also_remove_webview -eq 1) {
|
} else {
|
||||||
$remove_win32 += "Microsoft EdgeWebView"
|
Write-Output "widgets process is not running."
|
||||||
$remove_appx += "WebExperience", "Win32WebViewHost"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Administrative Privileges Check
|
function Uninstall-Process {
|
||||||
$privileges = @(
|
param (
|
||||||
'SeSecurityPrivilege',
|
[Parameter(Mandatory = $true)]
|
||||||
'SeTakeOwnershipPrivilege',
|
[string]$Key
|
||||||
'SeBackupPrivilege',
|
)
|
||||||
'SeRestorePrivilege'
|
|
||||||
)
|
|
||||||
|
|
||||||
foreach ($privilege in $privileges) {
|
$originalNation = [microsoft.win32.registry]::GetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', [Microsoft.Win32.RegistryValueKind]::String)
|
||||||
[System.Diagnostics.Process]::SetPrivilege($privilege, 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Edge Removal Procedures
|
# Set Nation to 84 (France) temporarily
|
||||||
$processesToShutdown = @(
|
[microsoft.win32.registry]::SetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', 68, [Microsoft.Win32.RegistryValueKind]::String) | Out-Null
|
||||||
'explorer', 'Widgets', 'widgetservice', 'msedgewebview2', 'MicrosoftEdge*', 'chredge',
|
|
||||||
'msedge', 'edge', 'msteams', 'msfamily', 'WebViewHost', 'Clipchamp'
|
|
||||||
)
|
|
||||||
|
|
||||||
Stop-Process -Name "explorer" -Force -ErrorAction SilentlyContinue
|
# credits to he3als for the Acl commands
|
||||||
$processesToShutdown | ForEach-Object {
|
$fileName = "IntegratedServicesRegionPolicySet.json"
|
||||||
Stop-Process -Name $_ -Force -ErrorAction SilentlyContinue
|
$pathISRPS = [Environment]::SystemDirectory + "\" + $fileName
|
||||||
}
|
$aclISRPS = Get-Acl -Path $pathISRPS
|
||||||
|
$aclISRPSBackup = [System.Security.AccessControl.FileSecurity]::new()
|
||||||
$MS = ($env:ProgramFiles, ${env:ProgramFiles(x86)})[[Environment]::Is64BitOperatingSystem] + '\Microsoft\Edge\Application\msedge.exe'
|
$aclISRPSBackup.SetSecurityDescriptorSddlForm($acl.Sddl)
|
||||||
|
if (Test-Path -Path $pathISRPS) {
|
||||||
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe" -Recurse -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ie_to_edge_stub.exe" -Recurse -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path 'Registry::HKEY_Users\S-1-5-21*\Software\Classes\microsoft-edge' -Recurse -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path 'Registry::HKEY_Users\S-1-5-21*\Software\Classes\MSEdgeHTM' -Recurse -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
New-Item -Path "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" -Force -ErrorAction SilentlyContinue
|
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" -Name '(Default)' -Value "`"$MS`" --single-argument %%1" -Force -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
New-Item -Path "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" -Force -ErrorAction SilentlyContinue
|
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" -Name '(Default)' -Value "`"$MS`" --single-argument %%1" -Force -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
$registryPaths = @('HKLM:\SOFTWARE\Policies', 'HKLM:\SOFTWARE', 'HKLM:\SOFTWARE\WOW6432Node')
|
|
||||||
$edgeProperties = @('InstallDefault', 'Install{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}', 'Install{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}')
|
|
||||||
foreach ($path in $registryPaths) {
|
|
||||||
foreach ($prop in $edgeProperties) {
|
|
||||||
Remove-ItemProperty -Path "$path\Microsoft\EdgeUpdate" -Name $prop -Force -ErrorAction SilentlyContinue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$edgeupdate = 'Microsoft\EdgeUpdate\Clients\{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}'
|
|
||||||
$webvupdate = 'Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
|
|
||||||
$on_actions = @('on-os-upgrade', 'on-logon', 'on-logon-autolaunch', 'on-logon-startup-boost')
|
|
||||||
$registryBases = @('HKLM:\SOFTWARE', 'HKLM:\SOFTWARE\Wow6432Node')
|
|
||||||
foreach ($base in $registryBases) {
|
|
||||||
foreach ($launch in $on_actions) {
|
|
||||||
Remove-Item -Path "$base\$edgeupdate\Commands\$launch" -Force -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path "$base\$webvupdate\Commands\$launch" -Force -ErrorAction SilentlyContinue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$registryPaths = @('HKCU:', 'HKLM:')
|
|
||||||
$nodes = @('', '\Wow6432Node')
|
|
||||||
foreach ($regPath in $registryPaths) {
|
|
||||||
foreach ($node in $nodes) {
|
|
||||||
foreach ($i in $remove_win32) {
|
|
||||||
Remove-ItemProperty -Path "$regPath\SOFTWARE${node}\Microsoft\Windows\CurrentVersion\Uninstall\$i" -Name 'NoRemove' -Force -ErrorAction SilentlyContinue
|
|
||||||
New-Item -Path "$regPath\SOFTWARE${node}\Microsoft\EdgeUpdateDev" -Force | Out-Null
|
|
||||||
Set-ItemProperty -Path "$regPath\SOFTWARE${node}\Microsoft\EdgeUpdateDev" -Name 'AllowUninstall' -Value 1 -Type Dword -Force
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$foldersToSearch = @('LocalApplicationData', 'ProgramFilesX86', 'ProgramFiles') | ForEach-Object {
|
|
||||||
[Environment]::GetFolderPath($_)
|
|
||||||
}
|
|
||||||
|
|
||||||
$edges = @()
|
|
||||||
$bhoFiles = @()
|
|
||||||
|
|
||||||
foreach ($folder in $foldersToSearch) {
|
|
||||||
$bhoFiles += Get-ChildItem -Path "$folder\Microsoft\Edge*\ie_to_edge_stub.exe" -Recurse -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
$edges += Get-ChildItem -Path "$folder\Microsoft\Edge*\setup.exe" -Recurse -ErrorAction SilentlyContinue |
|
|
||||||
Where-Object { $_.FullName -notlike '*EdgeWebView*' }
|
|
||||||
}
|
|
||||||
|
|
||||||
$destinationDir = "$env:SystemDrive\Scripts"
|
|
||||||
New-Item -Path $destinationDir -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
|
|
||||||
|
|
||||||
foreach ($bhoFile in $bhoFiles) {
|
|
||||||
if (Test-Path $bhoFile) {
|
|
||||||
try {
|
try {
|
||||||
Copy-Item -Path $bhoFile -Destination "$destinationDir\ie_to_edge_stub.exe" -Force
|
$admin = [System.Security.Principal.NTAccount]$(New-Object System.Security.Principal.SecurityIdentifier('S-1-5-32-544')).Translate([System.Security.Principal.NTAccount]).Value
|
||||||
} catch { }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
## Work on Appx Removals
|
$aclISRPS.SetOwner($admin)
|
||||||
$provisioned = Get-AppxProvisionedPackage -Online
|
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admin, 'FullControl', 'Allow')
|
||||||
$appxpackage = Get-AppxPackage -AllUsers
|
$aclISRPS.AddAccessRule($rule)
|
||||||
$eol = @()
|
Set-Acl -Path $pathISRPS -AclObject $aclISRPS
|
||||||
|
|
||||||
$store = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Store'
|
Rename-Item -Path $pathISRPS -NewName ($fileName + '.bak') -Force
|
||||||
$storeP = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Store\InstalledApplications'
|
|
||||||
foreach ($app in $appxpackage) {
|
|
||||||
$name = $app.Name
|
|
||||||
if ($app.Name -eq "Microsoft.Edge") {
|
|
||||||
$eol += $name
|
|
||||||
} elseif ($app.Name -eq "Microsoft.EdgeBeta" -or $app.Name -eq "Microsoft.EdgeDev" -or $app.Name -eq "Microsoft.EdgeCanary" -or $app.Name -eq "Microsoft.MicrosoftEdge") {
|
|
||||||
$eol += $name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$eolApps = $provisioned | Where-Object { $eol -contains $_.DisplayName }
|
|
||||||
|
|
||||||
foreach ($edge in $eolApps) {
|
|
||||||
$edgeName = $edge.DisplayName
|
|
||||||
if (-not ($skip -contains $edgeName)) {
|
|
||||||
try {
|
|
||||||
Remove-AppxProvisionedPackage -Online -PackageName $edgeName -ErrorAction SilentlyContinue
|
|
||||||
} catch { }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($edge in $appxpackage) {
|
|
||||||
$edgeName = $edge.Name
|
|
||||||
if ($eol -contains $edgeName) {
|
|
||||||
if (-not ($skip -contains $edgeName)) {
|
|
||||||
try {
|
|
||||||
Remove-AppxPackage -Package $edgeName -AllUsers -ErrorAction SilentlyContinue
|
|
||||||
} catch { }
|
|
||||||
}
|
}
|
||||||
}
|
catch {
|
||||||
}
|
Write-Error "[$Mode] Failed to set owner for $pathISRPS"
|
||||||
|
|
||||||
## Redirect shortcuts
|
|
||||||
$shortcut_path = "$env:Public\Desktop"
|
|
||||||
$shortcut_file = 'Microsoft Edge.lnk'
|
|
||||||
$full_path = Join-Path -Path $shortcut_path -ChildPath $shortcut_file
|
|
||||||
|
|
||||||
if (Test-Path $full_path) {
|
|
||||||
Remove-Item -Path $full_path -Force -ErrorAction SilentlyContinue
|
|
||||||
}
|
|
||||||
|
|
||||||
$shortcut_path = "$env:ProgramData\Microsoft\Windows\Start Menu\Programs"
|
|
||||||
$shortcut_file = 'Microsoft Edge.lnk'
|
|
||||||
$full_path = Join-Path -Path $shortcut_path -ChildPath $shortcut_file
|
|
||||||
|
|
||||||
if (Test-Path $full_path) {
|
|
||||||
Remove-Item -Path $full_path -Force -ErrorAction SilentlyContinue
|
|
||||||
}
|
|
||||||
|
|
||||||
$edgePolicy = 'HKLM:\SOFTWARE\Policies\Microsoft\Edge'
|
|
||||||
if (-not (Test-Path $edgePolicy)) {
|
|
||||||
New-Item -Path $edgePolicy -Force | Out-Null
|
|
||||||
}
|
|
||||||
|
|
||||||
$edgePrefs = @{
|
|
||||||
'Dword' = @{
|
|
||||||
'BrowserReplacementEnabled' = 1
|
|
||||||
'HideFirstRunExperience' = 1
|
|
||||||
'HideImportEdgeFavoritesPrompt' = 1
|
|
||||||
'HideSyncSetupExperience' = 1
|
|
||||||
'FavoritesBarVisibility' = 1
|
|
||||||
}
|
|
||||||
'String' = @{
|
|
||||||
'AutoplayAllowed' = 'AllowOnce'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($entryType in $edgePrefs.Keys) {
|
|
||||||
foreach ($prefName in $edgePrefs[$entryType].Keys) {
|
|
||||||
Set-ItemProperty -Path $edgePolicy -Name $prefName -Value $edgePrefs[$entryType][$prefName] -Type $entryType -Force
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Output Results
|
|
||||||
Write-Host "Edge Removal Complete" -ForegroundColor Green
|
|
||||||
|
|
||||||
# Define constants and initial configuration
|
|
||||||
$ScriptVersion = "2023.05.10"
|
|
||||||
$EdgeProcessesToShutdown = @('explorer', 'Widgets', 'widgetservice', 'msedgewebview2', 'MicrosoftEdge*', 'chredge', 'msedge', 'edge', 'msteams', 'msfamily', 'WebViewHost', 'Clipchamp')
|
|
||||||
$EdgeRemovalOptions = @{
|
|
||||||
RemoveWin32 = @("Microsoft Edge", "Microsoft Edge Update")
|
|
||||||
RemoveAppx = @("MicrosoftEdge")
|
|
||||||
Skip = @() # Optional: @("DevTools")
|
|
||||||
AlsoRemoveWebView = $false
|
|
||||||
}
|
|
||||||
|
|
||||||
# Define main function to remove Microsoft Edge components
|
|
||||||
function Remove-MicrosoftEdge {
|
|
||||||
[CmdletBinding()]
|
|
||||||
param()
|
|
||||||
|
|
||||||
# Function to shutdown processes related to Microsoft Edge
|
|
||||||
function Stop-EdgeProcesses {
|
|
||||||
$EdgeProcessesToShutdown | ForEach-Object {
|
|
||||||
Stop-Process -Name $_ -Force -ErrorAction SilentlyContinue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to remove registry entries related to Microsoft Edge
|
$baseKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate'
|
||||||
function Remove-EdgeRegistryEntries {
|
$registryPath = $baseKey + '\ClientState\' + $Key
|
||||||
# Clean up certain registry entries
|
|
||||||
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe" -Recurse -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ie_to_edge_stub.exe" -Recurse -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path 'Registry::HKEY_Users\S-1-5-21*\Software\Classes\microsoft-edge' -Recurse -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path 'Registry::HKEY_Users\S-1-5-21*\Software\Classes\MSEdgeHTM' -Recurse -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
# Create new registry entries
|
if (!(Test-Path -Path $registryPath)) {
|
||||||
$EdgeExecutablePath = ($env:ProgramFiles, ${env:ProgramFiles(x86)})[[Environment]::Is64BitOperatingSystem] + '\Microsoft\Edge\Application\msedge.exe'
|
Write-Host "[$Mode] Registry key not found: $registryPath"
|
||||||
New-Item -Path "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" -Force -ErrorAction SilentlyContinue
|
return
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\microsoft-edge\shell\open\command" -Name '(Default)' -Value "`"$EdgeExecutablePath`" --single-argument %%1" -Force -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
New-Item -Path "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" -Force -ErrorAction SilentlyContinue
|
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Classes\MSEdgeHTM\shell\open\command" -Name '(Default)' -Value "`"$EdgeExecutablePath`" --single-argument %%1" -Force -ErrorAction SilentlyContinue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to remove Microsoft Edge AppX packages
|
Remove-ItemProperty -Path $registryPath -Name "experiment_control_labels" -ErrorAction SilentlyContinue | Out-Null
|
||||||
function Remove-EdgeAppxPackages {
|
|
||||||
$EdgeRemovalOptions.RemoveAppx | ForEach-Object {
|
|
||||||
# Remove provisioned packages
|
|
||||||
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like "*$_*" -and $EdgeRemovalOptions.Skip -notcontains $_.PackageName } | Remove-AppxProvisionedPackage -Online -AllUsers -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
# Remove installed packages
|
$uninstallString = (Get-ItemProperty -Path $registryPath).UninstallString
|
||||||
Get-AppxPackage -AllUsers | Where-Object { $_.PackageFullName -like "*$_*" -and $EdgeRemovalOptions.Skip -notcontains $_.PackageFullName } | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
|
$uninstallArguments = (Get-ItemProperty -Path $registryPath).UninstallArguments
|
||||||
}
|
|
||||||
|
if ([string]::IsNullOrEmpty($uninstallString) -or [string]::IsNullOrEmpty($uninstallArguments)) {
|
||||||
|
Write-Host "[$Mode] Cannot find uninstall methods for $Mode"
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to remove Microsoft Edge processes, registry entries, and AppX packages
|
$uninstallArguments += " --force-uninstall --delete-profile"
|
||||||
try {
|
|
||||||
Stop-EdgeProcesses
|
# $uninstallCommand = "`"$uninstallString`"" + $uninstallArguments
|
||||||
Remove-EdgeRegistryEntries
|
if (!(Test-Path -Path $uninstallString)) {
|
||||||
Remove-EdgeAppxPackages
|
Write-Host "[$Mode] setup.exe not found at: $uninstallString"
|
||||||
Write-Output "Microsoft Edge components have been successfully removed."
|
return
|
||||||
} catch {
|
}
|
||||||
Write-Error "Failed to remove Microsoft Edge components: $_"
|
Start-Process -FilePath $uninstallString -ArgumentList $uninstallArguments -Wait -NoNewWindow -Verbose
|
||||||
|
|
||||||
|
# Restore Acl
|
||||||
|
if (Test-Path -Path ($pathISRPS + '.bak')) {
|
||||||
|
Rename-Item -Path ($pathISRPS + '.bak') -NewName $fileName -Force
|
||||||
|
Set-Acl -Path $pathISRPS -AclObject $aclISRPSBackup
|
||||||
|
}
|
||||||
|
|
||||||
|
# Restore Nation
|
||||||
|
[microsoft.win32.registry]::SetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', $originalNation, [Microsoft.Win32.RegistryValueKind]::String) | Out-Null
|
||||||
|
|
||||||
|
if ((Get-ItemProperty -Path $baseKey).IsEdgeStableUninstalled -eq 1) {
|
||||||
|
Write-Host "[$Mode] Edge Stable has been successfully uninstalled"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Execute the main function
|
function Uninstall-Edge {
|
||||||
Remove-MicrosoftEdge
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
|
||||||
|
[microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdateDev", "AllowUninstall", 1, [Microsoft.Win32.RegistryValueKind]::DWord) | Out-Null
|
||||||
|
|
||||||
|
Uninstall-Process -Key '{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}'
|
||||||
|
|
||||||
|
@( "$env:ProgramData\Microsoft\Windows\Start Menu\Programs",
|
||||||
|
"$env:PUBLIC\Desktop",
|
||||||
|
"$env:USERPROFILE\Desktop" ) | ForEach-Object {
|
||||||
|
$shortcutPath = Join-Path -Path $_ -ChildPath "Microsoft Edge.lnk"
|
||||||
|
if (Test-Path -Path $shortcutPath) {
|
||||||
|
Remove-Item -Path $shortcutPath -Force
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function Uninstall-WebView {
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
|
||||||
|
# Force to use system-wide WebView2
|
||||||
|
# [microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder", "*", "%%SystemRoot%%\System32\Microsoft-Edge-WebView")
|
||||||
|
|
||||||
|
Uninstall-Process -Key '{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
|
||||||
|
}
|
||||||
|
|
||||||
|
function Uninstall-EdgeUpdate {
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
|
||||||
|
$registryPath = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate'
|
||||||
|
if (!(Test-Path -Path $registryPath)) {
|
||||||
|
Write-Host "Registry key not found: $registryPath"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
$uninstallCmdLine = (Get-ItemProperty -Path $registryPath).UninstallCmdLine
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($uninstallCmdLine)) {
|
||||||
|
Write-Host "Cannot find uninstall methods for $Mode"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Output "Uninstalling: $uninstallCmdLine"
|
||||||
|
Start-Process cmd.exe "/c $uninstallCmdLine" -WindowStyle Hidden -Wait
|
||||||
|
}
|
||||||
|
|
||||||
|
Uninstall-Edge
|
||||||
|
# "WebView" { Uninstall-WebView }
|
||||||
|
# "EdgeUpdate" { Uninstall-EdgeUpdate }
|
||||||
|
@ -57,9 +57,9 @@ function ConvertTo-Icon {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory=$true, position=0)]
|
[Parameter(Mandatory, position=0)]
|
||||||
[string]$bitmapPath,
|
[string]$bitmapPath,
|
||||||
[Parameter(Mandatory=$true, position=1)]
|
[Parameter(Mandatory, position=1)]
|
||||||
[string]$iconPath,
|
[string]$iconPath,
|
||||||
[Parameter(position=2)]
|
[Parameter(position=2)]
|
||||||
[bool]$overrideIconFile = $true
|
[bool]$overrideIconFile = $true
|
||||||
@ -86,8 +86,7 @@ function ConvertTo-Icon {
|
|||||||
$icon.Save($file)
|
$icon.Save($file)
|
||||||
$file.Close()
|
$file.Close()
|
||||||
$icon.Dispose()
|
$icon.Dispose()
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw [System.IO.FileNotFoundException] "[ConvertTo-Icon] The provided bitmap File Path is not found at '$bitmapPath'."
|
throw [System.IO.FileNotFoundException] "[ConvertTo-Icon] The provided bitmap File Path is not found at '$bitmapPath'."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,39 +10,34 @@ function Copy-Files {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
param (
|
param (
|
||||||
[string] $Path,
|
[string]$Path,
|
||||||
[string] $Destination,
|
[string]$Destination,
|
||||||
[switch] $Recurse = $false,
|
[switch]$Recurse = $false,
|
||||||
[switch] $Force = $false
|
[switch]$Force = $false
|
||||||
)
|
)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$files = Get-ChildItem -Path $path -Recurse:$recurse
|
$files = Get-ChildItem -Path $path -Recurse:$recurse
|
||||||
Write-Host "Copy $($files.Count)(s) from $path to $destination"
|
Write-Host "Copy $($files.Count)(s) from $path to $destination"
|
||||||
|
|
||||||
foreach($file in $files)
|
foreach ($file in $files) {
|
||||||
{
|
|
||||||
$status = "Copy files {0} on {1}: {2}" -f $counter, $files.Count, $file.Name
|
$status = "Copy files {0} on {1}: {2}" -f $counter, $files.Count, $file.Name
|
||||||
Write-Progress -Activity "Copy Windows files" -Status $status -PercentComplete ($counter++/$files.count*100)
|
Write-Progress -Activity "Copy Windows files" -Status $status -PercentComplete ($counter++/$files.count*100)
|
||||||
$restpath = $file.FullName -Replace $path, ''
|
$restpath = $file.FullName -Replace $path, ''
|
||||||
|
|
||||||
if($file.PSIsContainer -eq $true)
|
if ($file.PSIsContainer -eq $true) {
|
||||||
{
|
|
||||||
Write-Debug "Creating $($destination + $restpath)"
|
Write-Debug "Creating $($destination + $restpath)"
|
||||||
New-Item ($destination+$restpath) -Force:$force -Type Directory -ErrorAction SilentlyContinue
|
New-Item ($destination+$restpath) -Force:$force -Type Directory -ErrorAction SilentlyContinue
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
Write-Debug "Copy from $($file.FullName) to $($destination+$restpath)"
|
Write-Debug "Copy from $($file.FullName) to $($destination+$restpath)"
|
||||||
Copy-Item $file.FullName ($destination+$restpath) -ErrorAction SilentlyContinue -Force:$force
|
Copy-Item $file.FullName ($destination+$restpath) -ErrorAction SilentlyContinue -Force:$force
|
||||||
Set-ItemProperty -Path ($destination+$restpath) -Name IsReadOnly -Value $false
|
Set-ItemProperty -Path ($destination+$restpath) -Name IsReadOnly -Value $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Write-Progress -Activity "Copy Windows files" -Status "Ready" -Completed
|
Write-Progress -Activity "Copy Windows files" -Status "Ready" -Completed
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to Copy all the files due to unhandled exception"
|
Write-Warning "Unable to Copy all the files due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,4 +31,4 @@ function Get-LocalizedYesNo {
|
|||||||
# Return the array of characters
|
# Return the array of characters
|
||||||
return $charactersArray
|
return $charactersArray
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
function Get-Oscdimg {
|
function Get-Oscdimg {
|
||||||
<#
|
<#
|
||||||
|
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This function will download oscdimg file from github Release folders and put it into env:temp folder
|
This function will download oscdimg file from github Release folders and put it into env:temp folder
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-Oscdimg
|
Get-Oscdimg
|
||||||
#>
|
#>
|
||||||
param( [Parameter(Mandatory=$true)]
|
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory, position=0)]
|
||||||
[string]$oscdimgPath
|
[string]$oscdimgPath
|
||||||
)
|
)
|
||||||
|
|
||||||
$oscdimgPath = "$env:TEMP\oscdimg.exe"
|
$oscdimgPath = "$env:TEMP\oscdimg.exe"
|
||||||
$downloadUrl = "https://github.com/ChrisTitusTech/winutil/raw/main/releases/oscdimg.exe"
|
$downloadUrl = "https://github.com/ChrisTitusTech/winutil/raw/main/releases/oscdimg.exe"
|
||||||
Invoke-RestMethod -Uri $downloadUrl -OutFile $oscdimgPath
|
Invoke-RestMethod -Uri $downloadUrl -OutFile $oscdimgPath
|
||||||
|
@ -1,19 +1,23 @@
|
|||||||
function Get-TabXaml {
|
function Get-TabXaml {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Generates XAML for a tab in the WinUtil GUI
|
Generates XAML for a tab in the WinUtil GUI
|
||||||
This function is used to generate the XAML for the applications tab in the WinUtil GUI
|
This function is used to generate the XAML for the applications tab in the WinUtil GUI
|
||||||
It takes the tabname and the number of columns to display the applications in as input and returns the XAML for the tab as output
|
It takes the tabname and the number of columns to display the applications in as input and returns the XAML for the tab as output
|
||||||
.PARAMETER tabname
|
|
||||||
The name of the tab to generate XAML for
|
.PARAMETER tabname
|
||||||
Note: the 'tabname' parameter must equal one of the json files found in $sync.configs variable
|
The name of the tab to generate XAML for
|
||||||
Otherwise, it'll throw an exception
|
Note: the 'tabname' parameter must equal one of the json files found in $sync.configs variable
|
||||||
.PARAMETER columncount
|
Otherwise, it'll throw an exception
|
||||||
The number of columns to display the applications in, default is 0
|
|
||||||
.OUTPUTS
|
.PARAMETER columncount
|
||||||
The XAML for the tab
|
The number of columns to display the applications in, default is 0
|
||||||
.EXAMPLE
|
|
||||||
Get-TabXaml "applications" 3
|
.OUTPUTS
|
||||||
|
The XAML for the tab
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Get-TabXaml "applications" 3
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
|
||||||
@ -115,7 +119,7 @@ function Get-TabXaml {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Dot-source the Get-WPFObjectName function
|
# Dot-source the Get-WPFObjectName function
|
||||||
. .\functions\private\Get-WPFObjectName
|
. "$($sync.PSScriptRoot)\functions\private\Get-WPFObjectName.ps1"
|
||||||
|
|
||||||
$categorycontent = $($category -replace '^.__', '')
|
$categorycontent = $($category -replace '^.__', '')
|
||||||
$categoryname = Get-WPFObjectName -type "Label" -name $categorycontent
|
$categoryname = Get-WPFObjectName -type "Label" -name $categorycontent
|
||||||
@ -188,7 +192,7 @@ function Get-TabXaml {
|
|||||||
|
|
||||||
# else it is a checkbox
|
# else it is a checkbox
|
||||||
default {
|
default {
|
||||||
$checkedStatus = If ($appInfo.Checked -eq $null) {""} Else {" IsChecked=""$($appInfo.Checked)"""}
|
$checkedStatus = If ($appInfo.Checked -eq $null) {""} else {" IsChecked=""$($appInfo.Checked)"""}
|
||||||
if ($appInfo.Link -eq $null) {
|
if ($appInfo.Link -eq $null) {
|
||||||
$blockXml += $precal_indent +
|
$blockXml += $precal_indent +
|
||||||
"<CheckBox Name=""$($appInfo.Name)"" Content=""$($appInfo.Content)""$($checkedStatus) Margin=""5,0""" + " " +
|
"<CheckBox Name=""$($appInfo.Name)"" Content=""$($appInfo.Content)""$($checkedStatus) Margin=""5,0""" + " " +
|
||||||
|
@ -1,27 +1,31 @@
|
|||||||
function Get-WPFObjectName {
|
function Get-WPFObjectName {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
This is a helper function that generates an objectname with the prefix WPF that can be used as a Powershell Variable after compilation.
|
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.
|
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
|
.PARAMETER type
|
||||||
Get-WPFObjectName -type Label -name "Microsoft Tools"
|
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=$true)]
|
param(
|
||||||
$type,
|
[Parameter(Mandatory, position=0)]
|
||||||
$name
|
[string]$type,
|
||||||
)
|
|
||||||
|
|
||||||
$Output = $("WPF"+$type+$name) -replace '[^a-zA-Z0-9]', ''
|
[Parameter(position=1)]
|
||||||
|
[string]$name
|
||||||
|
)
|
||||||
|
|
||||||
return $Output
|
$Output = $("WPF"+$type+$name) -replace '[^a-zA-Z0-9]', ''
|
||||||
|
return $Output
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,11 @@ function Get-WinUtilInstallerProcess {
|
|||||||
|
|
||||||
param($Process)
|
param($Process)
|
||||||
|
|
||||||
if ($Null -eq $Process){
|
if ($Null -eq $Process) {
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
if (Get-Process -Id $Process.Id -ErrorAction SilentlyContinue){
|
if (Get-Process -Id $Process.Id -ErrorAction SilentlyContinue) {
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
|
@ -13,125 +13,112 @@ Function Get-WinUtilToggleStatus {
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
Param($ToggleSwitch)
|
Param($ToggleSwitch)
|
||||||
if($ToggleSwitch -eq "WPFToggleDarkMode"){
|
if($ToggleSwitch -eq "WPFToggleDarkMode") {
|
||||||
$app = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').AppsUseLightTheme
|
$app = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').AppsUseLightTheme
|
||||||
$system = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').SystemUsesLightTheme
|
$system = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').SystemUsesLightTheme
|
||||||
if($app -eq 0 -and $system -eq 0){
|
if($app -eq 0 -and $system -eq 0) {
|
||||||
return $true
|
return $true
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($ToggleSwitch -eq "WPFToggleBingSearch"){
|
if($ToggleSwitch -eq "WPFToggleBingSearch") {
|
||||||
$bingsearch = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Search').BingSearchEnabled
|
$bingsearch = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Search').BingSearchEnabled
|
||||||
if($bingsearch -eq 0){
|
if($bingsearch -eq 0) {
|
||||||
return $false
|
return $false
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($ToggleSwitch -eq "WPFToggleNumLock"){
|
if($ToggleSwitch -eq "WPFToggleNumLock") {
|
||||||
$numlockvalue = (Get-ItemProperty -path 'HKCU:\Control Panel\Keyboard').InitialKeyboardIndicators
|
$numlockvalue = (Get-ItemProperty -path 'HKCU:\Control Panel\Keyboard').InitialKeyboardIndicators
|
||||||
if($numlockvalue -eq 2){
|
if($numlockvalue -eq 2) {
|
||||||
return $true
|
return $true
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($ToggleSwitch -eq "WPFToggleVerboseLogon"){
|
if($ToggleSwitch -eq "WPFToggleVerboseLogon") {
|
||||||
$VerboseStatusvalue = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System').VerboseStatus
|
$VerboseStatusvalue = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System').VerboseStatus
|
||||||
if($VerboseStatusvalue -eq 1){
|
if($VerboseStatusvalue -eq 1) {
|
||||||
return $true
|
return $true
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($ToggleSwitch -eq "WPFToggleShowExt"){
|
if($ToggleSwitch -eq "WPFToggleShowExt") {
|
||||||
$hideextvalue = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').HideFileExt
|
$hideextvalue = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').HideFileExt
|
||||||
if($hideextvalue -eq 0){
|
if($hideextvalue -eq 0) {
|
||||||
return $true
|
return $true
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($ToggleSwitch -eq "WPFToggleSnapWindow"){
|
if($ToggleSwitch -eq "WPFToggleSnapWindow") {
|
||||||
$hidesnap = (Get-ItemProperty -path 'HKCU:\Control Panel\Desktop').WindowArrangementActive
|
$hidesnap = (Get-ItemProperty -path 'HKCU:\Control Panel\Desktop').WindowArrangementActive
|
||||||
if($hidesnap -eq 0){
|
if($hidesnap -eq 0) {
|
||||||
return $false
|
return $false
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($ToggleSwitch -eq "WPFToggleSnapFlyout"){
|
if($ToggleSwitch -eq "WPFToggleSnapFlyout") {
|
||||||
$hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').EnableSnapAssistFlyout
|
$hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').EnableSnapAssistFlyout
|
||||||
if($hidesnap -eq 0){
|
if($hidesnap -eq 0) {
|
||||||
return $false
|
return $false
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($ToggleSwitch -eq "WPFToggleSnapSuggestion"){
|
if($ToggleSwitch -eq "WPFToggleSnapSuggestion") {
|
||||||
$hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').SnapAssist
|
$hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').SnapAssist
|
||||||
if($hidesnap -eq 0){
|
if($hidesnap -eq 0) {
|
||||||
return $false
|
return $false
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($ToggleSwitch -eq "WPFToggleMouseAcceleration"){
|
if($ToggleSwitch -eq "WPFToggleMouseAcceleration") {
|
||||||
$MouseSpeed = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseSpeed
|
$MouseSpeed = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseSpeed
|
||||||
$MouseThreshold1 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold1
|
$MouseThreshold1 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold1
|
||||||
$MouseThreshold2 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold2
|
$MouseThreshold2 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold2
|
||||||
|
|
||||||
if($MouseSpeed -eq 1 -and $MouseThreshold1 -eq 6 -and $MouseThreshold2 -eq 10){
|
if($MouseSpeed -eq 1 -and $MouseThreshold1 -eq 6 -and $MouseThreshold2 -eq 10) {
|
||||||
return $true
|
return $true
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($ToggleSwitch -eq "WPFToggleTaskbarSearch"){
|
if($ToggleSwitch -eq "WPFToggleTaskbarSearch") {
|
||||||
$SearchButton = (Get-ItemProperty -path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search").SearchboxTaskbarMode
|
$SearchButton = (Get-ItemProperty -path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search").SearchboxTaskbarMode
|
||||||
if($SearchButton -eq 0){
|
if($SearchButton -eq 0) {
|
||||||
return $false
|
return $false
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($ToggleSwitch -eq "WPFToggleStickyKeys") {
|
if ($ToggleSwitch -eq "WPFToggleStickyKeys") {
|
||||||
$StickyKeys = (Get-ItemProperty -path 'HKCU:\Control Panel\Accessibility\StickyKeys').Flags
|
$StickyKeys = (Get-ItemProperty -path 'HKCU:\Control Panel\Accessibility\StickyKeys').Flags
|
||||||
if($StickyKeys -eq 58){
|
if($StickyKeys -eq 58) {
|
||||||
return $false
|
return $false
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($ToggleSwitch -eq "WPFToggleTaskView") {
|
if ($ToggleSwitch -eq "WPFToggleTaskView") {
|
||||||
$TaskView = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').ShowTaskViewButton
|
$TaskView = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').ShowTaskViewButton
|
||||||
if($TaskView -eq 0){
|
if($TaskView -eq 0) {
|
||||||
return $false
|
return $false
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ToggleSwitch -eq "WPFToggleHiddenFiles") {
|
if ($ToggleSwitch -eq "WPFToggleHiddenFiles") {
|
||||||
$HiddenFiles = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').Hidden
|
$HiddenFiles = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').Hidden
|
||||||
if($HiddenFiles -eq 0){
|
if($HiddenFiles -eq 0) {
|
||||||
return $false
|
return $false
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -140,8 +127,7 @@ Function Get-WinUtilToggleStatus {
|
|||||||
$TaskbarWidgets = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskBarDa
|
$TaskbarWidgets = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskBarDa
|
||||||
if($TaskbarWidgets -eq 0) {
|
if($TaskbarWidgets -eq 0) {
|
||||||
return $false
|
return $false
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -149,8 +135,7 @@ Function Get-WinUtilToggleStatus {
|
|||||||
$TaskbarAlignment = (Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskbarAl
|
$TaskbarAlignment = (Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskbarAl
|
||||||
if($TaskbarAlignment -eq 0) {
|
if($TaskbarAlignment -eq 0) {
|
||||||
return $false
|
return $false
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -158,8 +143,7 @@ Function Get-WinUtilToggleStatus {
|
|||||||
$DetailedBSoD = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisplayParameters
|
$DetailedBSoD = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisplayParameters
|
||||||
if($DetailedBSoD -eq 0) {
|
if($DetailedBSoD -eq 0) {
|
||||||
return $false
|
return $false
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,13 +14,12 @@ function Get-WinUtilVariables {
|
|||||||
$keys = ($sync.keys).where{ $_ -like "WPF*" }
|
$keys = ($sync.keys).where{ $_ -like "WPF*" }
|
||||||
if ($Type) {
|
if ($Type) {
|
||||||
$output = $keys | ForEach-Object {
|
$output = $keys | ForEach-Object {
|
||||||
Try {
|
try {
|
||||||
$objType = $sync["$psitem"].GetType().Name
|
$objType = $sync["$psitem"].GetType().Name
|
||||||
if ($Type -contains $objType) {
|
if ($Type -contains $objType) {
|
||||||
Write-Output $psitem
|
Write-Output $psitem
|
||||||
}
|
}
|
||||||
}
|
} catch {
|
||||||
Catch {
|
|
||||||
<#I am here so errors don't get outputted for a couple variables that don't have the .GetType() attribute#>
|
<#I am here so errors don't get outputted for a couple variables that don't have the .GetType() attribute#>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ function Get-WinUtilWingetLatest {
|
|||||||
# Invoke-WebRequest is notoriously slow when the byte progress is displayed. The following lines disable the progress bar and reset them at the end of the function
|
# Invoke-WebRequest is notoriously slow when the byte progress is displayed. The following lines disable the progress bar and reset them at the end of the function
|
||||||
$PreviousProgressPreference = $ProgressPreference
|
$PreviousProgressPreference = $ProgressPreference
|
||||||
$ProgressPreference = "silentlyContinue"
|
$ProgressPreference = "silentlyContinue"
|
||||||
Try{
|
try {
|
||||||
# Grabs the latest release of Winget from the Github API for the install process.
|
# Grabs the latest release of Winget from the Github API for the install process.
|
||||||
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/Winget-cli/releases/latest" -Method Get -ErrorAction Stop
|
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/Winget-cli/releases/latest" -Method Get -ErrorAction Stop
|
||||||
$latestVersion = $response.tag_name #Stores version number of latest release.
|
$latestVersion = $response.tag_name #Stores version number of latest release.
|
||||||
@ -19,8 +19,7 @@ function Get-WinUtilWingetLatest {
|
|||||||
Invoke-WebRequest -Uri $licenseWingetUrl -OutFile $ENV:TEMP\License1.xml
|
Invoke-WebRequest -Uri $licenseWingetUrl -OutFile $ENV:TEMP\License1.xml
|
||||||
# The only pain is that the msixbundle for winget-cli is 246MB. In some situations this can take a bit, with slower connections.
|
# The only pain is that the msixbundle for winget-cli is 246MB. In some situations this can take a bit, with slower connections.
|
||||||
Invoke-WebRequest -Uri $assetUrl -OutFile $ENV:TEMP\Microsoft.DesktopAppInstaller.msixbundle
|
Invoke-WebRequest -Uri $assetUrl -OutFile $ENV:TEMP\Microsoft.DesktopAppInstaller.msixbundle
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
throw [WingetFailedInstall]::new('Failed to get latest Winget release and license')
|
throw [WingetFailedInstall]::new('Failed to get latest Winget release and license')
|
||||||
}
|
}
|
||||||
$ProgressPreference = $PreviousProgressPreference
|
$ProgressPreference = $PreviousProgressPreference
|
||||||
|
@ -17,13 +17,12 @@ function Get-WinUtilWingetPrerequisites {
|
|||||||
$fileUIXaml = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v${versionUIXamlPatch}/Microsoft.UI.Xaml.${versionUIXamlMinor}.x64.appx"
|
$fileUIXaml = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v${versionUIXamlPatch}/Microsoft.UI.Xaml.${versionUIXamlMinor}.x64.appx"
|
||||||
# Write-Host "$fileUIXaml"
|
# Write-Host "$fileUIXaml"
|
||||||
|
|
||||||
Try{
|
try {
|
||||||
Write-Host "Downloading Microsoft.VCLibs Dependency..."
|
Write-Host "Downloading Microsoft.VCLibs Dependency..."
|
||||||
Invoke-WebRequest -Uri $fileVCLibs -OutFile $ENV:TEMP\Microsoft.VCLibs.x64.Desktop.appx
|
Invoke-WebRequest -Uri $fileVCLibs -OutFile $ENV:TEMP\Microsoft.VCLibs.x64.Desktop.appx
|
||||||
Write-Host "Downloading Microsoft.UI.Xaml Dependency...`n"
|
Write-Host "Downloading Microsoft.UI.Xaml Dependency...`n"
|
||||||
Invoke-WebRequest -Uri $fileUIXaml -OutFile $ENV:TEMP\Microsoft.UI.Xaml.x64.appx
|
Invoke-WebRequest -Uri $fileUIXaml -OutFile $ENV:TEMP\Microsoft.UI.Xaml.x64.appx
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
throw [WingetFailedInstall]::new('Failed to install prerequsites')
|
throw [WingetFailedInstall]::new('Failed to install prerequsites')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,7 @@ function Install-WinUtilChoco {
|
|||||||
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop
|
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop
|
||||||
powershell choco feature enable -n allowGlobalConfirmation
|
powershell choco feature enable -n allowGlobalConfirmation
|
||||||
|
|
||||||
}
|
} catch {
|
||||||
Catch {
|
|
||||||
Write-Host "===========================================" -Foregroundcolor Red
|
Write-Host "===========================================" -Foregroundcolor Red
|
||||||
Write-Host "-- Chocolatey failed to install ---" -Foregroundcolor Red
|
Write-Host "-- Chocolatey failed to install ---" -Foregroundcolor Red
|
||||||
Write-Host "===========================================" -Foregroundcolor Red
|
Write-Host "===========================================" -Foregroundcolor Red
|
||||||
|
@ -33,26 +33,26 @@ function Install-WinUtilProgramChoco {
|
|||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
Write-Host "-- Configuring Chocolatey pacakages ---"
|
Write-Host "-- Configuring Chocolatey pacakages ---"
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
Foreach ($Program in $ProgramsToInstall){
|
Foreach ($Program in $ProgramsToInstall) {
|
||||||
Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.choco) $($x + 1) of $count" -PercentComplete $($x/$count*100)
|
Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.choco) $($x + 1) of $count" -PercentComplete $($x/$count*100)
|
||||||
if($manage -eq "Installing"){
|
if($manage -eq "Installing") {
|
||||||
write-host "Starting install of $($Program.choco) with Chocolatey."
|
write-host "Starting install of $($Program.choco) with Chocolatey."
|
||||||
try{
|
try {
|
||||||
$tryUpgrade = $false
|
$tryUpgrade = $false
|
||||||
$installOutputFilePath = "$env:TEMP\Install-WinUtilProgramChoco.install-command.output.txt"
|
$installOutputFilePath = "$env:TEMP\Install-WinUtilProgramChoco.install-command.output.txt"
|
||||||
New-Item -ItemType File -Path $installOutputFilePath
|
New-Item -ItemType File -Path $installOutputFilePath
|
||||||
$chocoInstallStatus = $(Start-Process -FilePath "choco" -ArgumentList "install $($Program.choco) -y" -Wait -PassThru -RedirectStandardOutput $installOutputFilePath).ExitCode
|
$chocoInstallStatus = $(Start-Process -FilePath "choco" -ArgumentList "install $($Program.choco) -y" -Wait -PassThru -RedirectStandardOutput $installOutputFilePath).ExitCode
|
||||||
if(($chocoInstallStatus -eq 0) -AND (Test-Path -Path $installOutputFilePath)) {
|
if(($chocoInstallStatus -eq 0) -AND (Test-Path -Path $installOutputFilePath)) {
|
||||||
$keywordsFound = Get-Content -Path $installOutputFilePath | Where-Object {$_ -match "reinstall" -OR $_ -match "already installed"}
|
$keywordsFound = Get-Content -Path $installOutputFilePath | Where-Object {$_ -match "reinstall" -OR $_ -match "already installed"}
|
||||||
if ($keywordsFound) {
|
if ($keywordsFound) {
|
||||||
$tryUpgrade = $true
|
$tryUpgrade = $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# TODO: Implement the Upgrade part using 'choco upgrade' command, this will make choco consistent with WinGet, as WinGet tries to Upgrade when you use the install command.
|
# TODO: Implement the Upgrade part using 'choco upgrade' command, this will make choco consistent with WinGet, as WinGet tries to Upgrade when you use the install command.
|
||||||
if ($tryUpgrade) {
|
if ($tryUpgrade) {
|
||||||
throw "Automatic Upgrade for Choco isn't implemented yet, a feature to make it consistent with WinGet, the install command using choco simply failed because $($Program.choco) is already installed."
|
throw "Automatic Upgrade for Choco isn't implemented yet, a feature to make it consistent with WinGet, the install command using choco simply failed because $($Program.choco) is already installed."
|
||||||
}
|
}
|
||||||
if(($chocoInstallStatus -eq 0) -AND ($tryUpgrade -eq $false)){
|
if(($chocoInstallStatus -eq 0) -AND ($tryUpgrade -eq $false)) {
|
||||||
Write-Host "$($Program.choco) installed successfully using Chocolatey."
|
Write-Host "$($Program.choco) installed successfully using Chocolatey."
|
||||||
$X++
|
$X++
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value ($x/$count) })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value ($x/$count) })
|
||||||
@ -69,13 +69,13 @@ function Install-WinUtilProgramChoco {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($manage -eq "Uninstalling"){
|
if($manage -eq "Uninstalling") {
|
||||||
write-host "Starting uninstall of $($Program.choco) with Chocolatey."
|
write-host "Starting uninstall of $($Program.choco) with Chocolatey."
|
||||||
try{
|
try {
|
||||||
$uninstallOutputFilePath = "$env:TEMP\Install-WinUtilProgramChoco.uninstall-command.output.txt"
|
$uninstallOutputFilePath = "$env:TEMP\Install-WinUtilProgramChoco.uninstall-command.output.txt"
|
||||||
New-Item -ItemType File -Path $uninstallOutputFilePath
|
New-Item -ItemType File -Path $uninstallOutputFilePath
|
||||||
$chocoUninstallStatus = $(Start-Process -FilePath "choco" -ArgumentList "uninstall $($Program.choco) -y" -Wait -PassThru).ExitCode
|
$chocoUninstallStatus = $(Start-Process -FilePath "choco" -ArgumentList "uninstall $($Program.choco) -y" -Wait -PassThru).ExitCode
|
||||||
if($chocoUninstallStatus -eq 0){
|
if($chocoUninstallStatus -eq 0) {
|
||||||
Write-Host "$($Program.choco) uninstalled successfully using Chocolatey."
|
Write-Host "$($Program.choco) uninstalled successfully using Chocolatey."
|
||||||
$x++
|
$x++
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value ($x/$count) })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value ($x/$count) })
|
||||||
@ -90,13 +90,13 @@ function Install-WinUtilProgramChoco {
|
|||||||
$x++
|
$x++
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Write-Progress -Activity "$manage Applications" -Status "Finished" -Completed
|
Write-Progress -Activity "$manage Applications" -Status "Finished" -Completed
|
||||||
|
|
||||||
# Cleanup leftovers files
|
# Cleanup leftovers files
|
||||||
if(Test-Path -Path $installOutputFilePath){ Remove-Item -Path $installOutputFilePath }
|
if(Test-Path -Path $installOutputFilePath) { Remove-Item -Path $installOutputFilePath }
|
||||||
if(Test-Path -Path $uninstallOutputFilePath){ Remove-Item -Path $uninstallOutputFilePath }
|
if(Test-Path -Path $uninstallOutputFilePath) { Remove-Item -Path $uninstallOutputFilePath }
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ function Install-WinUtilWinget {
|
|||||||
#>
|
#>
|
||||||
$isWingetInstalled = Test-WinUtilPackageManager -winget
|
$isWingetInstalled = Test-WinUtilPackageManager -winget
|
||||||
|
|
||||||
Try {
|
try {
|
||||||
if ($isWingetInstalled -eq "installed") {
|
if ($isWingetInstalled -eq "installed") {
|
||||||
Write-Host "`nWinget is already installed.`r" -ForegroundColor Green
|
Write-Host "`nWinget is already installed.`r" -ForegroundColor Green
|
||||||
return
|
return
|
||||||
@ -21,7 +21,7 @@ function Install-WinUtilWinget {
|
|||||||
|
|
||||||
|
|
||||||
# Gets the computer's information
|
# Gets the computer's information
|
||||||
if ($null -eq $sync.ComputerInfo){
|
if ($null -eq $sync.ComputerInfo) {
|
||||||
$ComputerInfo = Get-ComputerInfo -ErrorAction Stop
|
$ComputerInfo = Get-ComputerInfo -ErrorAction Stop
|
||||||
} else {
|
} else {
|
||||||
$ComputerInfo = $sync.ComputerInfo
|
$ComputerInfo = $sync.ComputerInfo
|
||||||
@ -41,8 +41,8 @@ function Install-WinUtilWinget {
|
|||||||
Get-WinUtilWingetLatest
|
Get-WinUtilWingetLatest
|
||||||
Write-Host "Installing Winget w/ Prerequsites`r"
|
Write-Host "Installing Winget w/ Prerequsites`r"
|
||||||
Add-AppxProvisionedPackage -Online -PackagePath $ENV:TEMP\Microsoft.DesktopAppInstaller.msixbundle -DependencyPackagePath $ENV:TEMP\Microsoft.VCLibs.x64.Desktop.appx, $ENV:TEMP\Microsoft.UI.Xaml.x64.appx -LicensePath $ENV:TEMP\License1.xml
|
Add-AppxProvisionedPackage -Online -PackagePath $ENV:TEMP\Microsoft.DesktopAppInstaller.msixbundle -DependencyPackagePath $ENV:TEMP\Microsoft.VCLibs.x64.Desktop.appx, $ENV:TEMP\Microsoft.UI.Xaml.x64.appx -LicensePath $ENV:TEMP\License1.xml
|
||||||
Write-Host "Manually adding Winget Sources, from Winget CDN."
|
Write-Host "Manually adding Winget Sources, from Winget CDN."
|
||||||
Add-AppxPackage -Path https://cdn.winget.microsoft.com/cache/source.msix #Seems some installs of Winget don't add the repo source, this should makes sure that it's installed every time.
|
Add-AppxPackage -Path https://cdn.winget.microsoft.com/cache/source.msix #Seems some installs of Winget don't add the repo source, this should makes sure that it's installed every time.
|
||||||
Write-Host "Winget Installed" -ForegroundColor Green
|
Write-Host "Winget Installed" -ForegroundColor Green
|
||||||
Write-Host "Enabling NuGet and Module..."
|
Write-Host "Enabling NuGet and Module..."
|
||||||
Install-PackageProvider -Name NuGet -Force
|
Install-PackageProvider -Name NuGet -Force
|
||||||
@ -50,17 +50,17 @@ function Install-WinUtilWinget {
|
|||||||
# Winget only needs a refresh of the environment variables to be used.
|
# Winget only needs a refresh of the environment variables to be used.
|
||||||
Write-Output "Refreshing Environment Variables...`n"
|
Write-Output "Refreshing Environment Variables...`n"
|
||||||
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
||||||
} Catch {
|
} catch {
|
||||||
Write-Host "Failure detected while installing via GitHub method. Continuing with Chocolatey method as fallback." -ForegroundColor Red
|
Write-Host "Failure detected while installing via GitHub method. Continuing with Chocolatey method as fallback." -ForegroundColor Red
|
||||||
# In case install fails via GitHub method.
|
# In case install fails via GitHub method.
|
||||||
Try {
|
try {
|
||||||
# Install Choco if not already present
|
# Install Choco if not already present
|
||||||
Install-WinUtilChoco
|
Install-WinUtilChoco
|
||||||
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget-cli"
|
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget-cli"
|
||||||
Write-Host "Winget Installed" -ForegroundColor Green
|
Write-Host "Winget Installed" -ForegroundColor Green
|
||||||
Write-Output "Refreshing Environment Variables...`n"
|
Write-Output "Refreshing Environment Variables...`n"
|
||||||
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
||||||
} Catch {
|
} catch {
|
||||||
throw [WingetFailedInstall]::new('Failed to install!')
|
throw [WingetFailedInstall]::new('Failed to install!')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -9,26 +9,22 @@ function Invoke-WinUtilBingSearch {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Bing Search"
|
Write-Host "Enabling Bing Search"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Bing Search"
|
Write-Host "Disabling Bing Search"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
}
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search"
|
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search"
|
||||||
Set-ItemProperty -Path $Path -Name BingSearchEnabled -Value $value
|
Set-ItemProperty -Path $Path -Name BingSearchEnabled -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ Function Invoke-WinUtilCurrentSystem {
|
|||||||
$CheckBox
|
$CheckBox
|
||||||
)
|
)
|
||||||
|
|
||||||
if ($checkbox -eq "winget"){
|
if ($checkbox -eq "winget") {
|
||||||
|
|
||||||
$originalEncoding = [Console]::OutputEncoding
|
$originalEncoding = [Console]::OutputEncoding
|
||||||
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
|
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
|
||||||
@ -31,9 +31,9 @@ Function Invoke-WinUtilCurrentSystem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($CheckBox -eq "tweaks"){
|
if($CheckBox -eq "tweaks") {
|
||||||
|
|
||||||
if(!(Test-Path 'HKU:\')){New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS}
|
if(!(Test-Path 'HKU:\')) {New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS}
|
||||||
$ScheduledTasks = Get-ScheduledTask
|
$ScheduledTasks = Get-ScheduledTask
|
||||||
|
|
||||||
$sync.configs.tweaks | Get-Member -MemberType NoteProperty | ForEach-Object {
|
$sync.configs.tweaks | Get-Member -MemberType NoteProperty | ForEach-Object {
|
||||||
@ -44,59 +44,57 @@ Function Invoke-WinUtilCurrentSystem {
|
|||||||
$scheduledtaskKeys = $sync.configs.tweaks.$Config.scheduledtask
|
$scheduledtaskKeys = $sync.configs.tweaks.$Config.scheduledtask
|
||||||
$serviceKeys = $sync.configs.tweaks.$Config.service
|
$serviceKeys = $sync.configs.tweaks.$Config.service
|
||||||
|
|
||||||
if($registryKeys -or $scheduledtaskKeys -or $serviceKeys){
|
if($registryKeys -or $scheduledtaskKeys -or $serviceKeys) {
|
||||||
$Values = @()
|
$Values = @()
|
||||||
|
|
||||||
|
|
||||||
Foreach ($tweaks in $registryKeys){
|
Foreach ($tweaks in $registryKeys) {
|
||||||
Foreach($tweak in $tweaks){
|
Foreach($tweak in $tweaks) {
|
||||||
|
|
||||||
if(test-path $tweak.Path){
|
if(test-path $tweak.Path) {
|
||||||
$actualValue = Get-ItemProperty -Name $tweak.Name -Path $tweak.Path -ErrorAction SilentlyContinue | Select-Object -ExpandProperty $($tweak.Name)
|
$actualValue = Get-ItemProperty -Name $tweak.Name -Path $tweak.Path -ErrorAction SilentlyContinue | Select-Object -ExpandProperty $($tweak.Name)
|
||||||
$expectedValue = $tweak.Value
|
$expectedValue = $tweak.Value
|
||||||
if ($expectedValue -notlike $actualValue){
|
if ($expectedValue -notlike $actualValue) {
|
||||||
$values += $False
|
$values += $False
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$values += $False
|
$values += $False
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Foreach ($tweaks in $scheduledtaskKeys){
|
Foreach ($tweaks in $scheduledtaskKeys) {
|
||||||
Foreach($tweak in $tweaks){
|
Foreach($tweak in $tweaks) {
|
||||||
$task = $ScheduledTasks | Where-Object {$($psitem.TaskPath + $psitem.TaskName) -like "\$($tweak.name)"}
|
$task = $ScheduledTasks | Where-Object {$($psitem.TaskPath + $psitem.TaskName) -like "\$($tweak.name)"}
|
||||||
|
|
||||||
if($task){
|
if($task) {
|
||||||
$actualValue = $task.State
|
$actualValue = $task.State
|
||||||
$expectedValue = $tweak.State
|
$expectedValue = $tweak.State
|
||||||
if ($expectedValue -ne $actualValue){
|
if ($expectedValue -ne $actualValue) {
|
||||||
$values += $False
|
$values += $False
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Foreach ($tweaks in $serviceKeys){
|
Foreach ($tweaks in $serviceKeys) {
|
||||||
Foreach($tweak in $tweaks){
|
Foreach($tweak in $tweaks) {
|
||||||
$Service = Get-Service -Name $tweak.Name
|
$Service = Get-Service -Name $tweak.Name
|
||||||
|
|
||||||
if($Service){
|
if($Service) {
|
||||||
$actualValue = $Service.StartType
|
$actualValue = $Service.StartType
|
||||||
$expectedValue = $tweak.StartupType
|
$expectedValue = $tweak.StartupType
|
||||||
if ($expectedValue -ne $actualValue){
|
if ($expectedValue -ne $actualValue) {
|
||||||
$values += $False
|
$values += $False
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($values -notcontains $false){
|
if($values -notcontains $false) {
|
||||||
Write-Output $Config
|
Write-Output $Config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,12 +9,11 @@ Function Invoke-WinUtilDarkMode {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
Param($DarkMoveEnabled)
|
Param($DarkMoveEnabled)
|
||||||
Try{
|
try {
|
||||||
if ($DarkMoveEnabled -eq $false){
|
if ($DarkMoveEnabled -eq $false) {
|
||||||
Write-Host "Enabling Dark Mode"
|
Write-Host "Enabling Dark Mode"
|
||||||
$DarkMoveValue = 0
|
$DarkMoveValue = 0
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Dark Mode"
|
Write-Host "Disabling Dark Mode"
|
||||||
$DarkMoveValue = 1
|
$DarkMoveValue = 1
|
||||||
}
|
}
|
||||||
@ -22,15 +21,12 @@ Function Invoke-WinUtilDarkMode {
|
|||||||
$Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
|
$Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
|
||||||
Set-ItemProperty -Path $Path -Name AppsUseLightTheme -Value $DarkMoveValue
|
Set-ItemProperty -Path $Path -Name AppsUseLightTheme -Value $DarkMoveValue
|
||||||
Set-ItemProperty -Path $Path -Name SystemUsesLightTheme -Value $DarkMoveValue
|
Set-ItemProperty -Path $Path -Name SystemUsesLightTheme -Value $DarkMoveValue
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,31 +4,27 @@ Function Invoke-WinUtilDetailedBSoD {
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Enables/Disables Detailed BSoD
|
Enables/Disables Detailed BSoD
|
||||||
(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'DisplayParameters').DisplayParameters
|
(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'DisplayParameters').DisplayParameters
|
||||||
|
|
||||||
|
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Detailed BSoD"
|
Write-Host "Enabling Detailed BSoD"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Detailed BSoD"
|
Write-Host "Disabling Detailed BSoD"
|
||||||
$value =0
|
$value =0
|
||||||
}
|
}
|
||||||
|
|
||||||
$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl"
|
$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl"
|
||||||
Set-ItemProperty -Path $Path -Name DisplayParameters -Value $value
|
Set-ItemProperty -Path $Path -Name DisplayParameters -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,19 +13,16 @@ function Invoke-WinUtilFeatureInstall {
|
|||||||
$x = 0
|
$x = 0
|
||||||
|
|
||||||
$CheckBox | ForEach-Object {
|
$CheckBox | ForEach-Object {
|
||||||
if($sync.configs.feature.$psitem.feature){
|
if($sync.configs.feature.$psitem.feature) {
|
||||||
Foreach( $feature in $sync.configs.feature.$psitem.feature ){
|
Foreach( $feature in $sync.configs.feature.$psitem.feature ) {
|
||||||
Try{
|
try {
|
||||||
Write-Host "Installing $feature"
|
Write-Host "Installing $feature"
|
||||||
Enable-WindowsOptionalFeature -Online -FeatureName $feature -All -NoRestart
|
Enable-WindowsOptionalFeature -Online -FeatureName $feature -All -NoRestart
|
||||||
}
|
} catch {
|
||||||
Catch{
|
if ($psitem.Exception.Message -like "*requires elevation*") {
|
||||||
if ($psitem.Exception.Message -like "*requires elevation*"){
|
|
||||||
Write-Warning "Unable to Install $feature due to permissions. Are you running as admin?"
|
Write-Warning "Unable to Install $feature due to permissions. Are you running as admin?"
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" })
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else{
|
|
||||||
|
|
||||||
Write-Warning "Unable to Install $feature due to unhandled exception"
|
Write-Warning "Unable to Install $feature due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
@ -33,21 +30,18 @@ function Invoke-WinUtilFeatureInstall {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($sync.configs.feature.$psitem.InvokeScript){
|
if($sync.configs.feature.$psitem.InvokeScript) {
|
||||||
Foreach( $script in $sync.configs.feature.$psitem.InvokeScript ){
|
Foreach( $script in $sync.configs.feature.$psitem.InvokeScript ) {
|
||||||
Try{
|
try {
|
||||||
$Scriptblock = [scriptblock]::Create($script)
|
$Scriptblock = [scriptblock]::Create($script)
|
||||||
|
|
||||||
Write-Host "Running Script for $psitem"
|
Write-Host "Running Script for $psitem"
|
||||||
Invoke-Command $scriptblock -ErrorAction stop
|
Invoke-Command $scriptblock -ErrorAction stop
|
||||||
}
|
} catch {
|
||||||
Catch{
|
if ($psitem.Exception.Message -like "*requires elevation*") {
|
||||||
if ($psitem.Exception.Message -like "*requires elevation*"){
|
|
||||||
Write-Warning "Unable to Install $feature due to permissions. Are you running as admin?"
|
Write-Warning "Unable to Install $feature due to permissions. Are you running as admin?"
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" })
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else{
|
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" })
|
||||||
Write-Warning "Unable to Install $feature due to unhandled exception"
|
Write-Warning "Unable to Install $feature due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
|
@ -11,11 +11,11 @@ function Invoke-WinUtilGPU {
|
|||||||
)
|
)
|
||||||
|
|
||||||
foreach ($gpu in $gpuInfo) {
|
foreach ($gpu in $gpuInfo) {
|
||||||
foreach ($gpuPattern in $lowPowerGPUs){
|
foreach ($gpuPattern in $lowPowerGPUs) {
|
||||||
if ($gpu.Name -like $gpuPattern) {
|
if ($gpu.Name -like $gpuPattern) {
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
|
@ -9,25 +9,21 @@ function Invoke-WinUtilHiddenFiles {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Hidden Files"
|
Write-Host "Enabling Hidden Files"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Hidden Files"
|
Write-Host "Disabling Hidden Files"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
}
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
||||||
Set-ItemProperty -Path $Path -Name Hidden -Value $value
|
Set-ItemProperty -Path $Path -Name Hidden -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
|
@ -9,14 +9,13 @@ Function Invoke-WinUtilMouseAcceleration {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
Param($MouseAccelerationEnabled)
|
Param($MouseAccelerationEnabled)
|
||||||
Try{
|
try {
|
||||||
if ($MouseAccelerationEnabled -eq $false){
|
if ($MouseAccelerationEnabled -eq $false) {
|
||||||
Write-Host "Enabling Mouse Acceleration"
|
Write-Host "Enabling Mouse Acceleration"
|
||||||
$MouseSpeed = 1
|
$MouseSpeed = 1
|
||||||
$MouseThreshold1 = 6
|
$MouseThreshold1 = 6
|
||||||
$MouseThreshold2 = 10
|
$MouseThreshold2 = 10
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Mouse Acceleration"
|
Write-Host "Disabling Mouse Acceleration"
|
||||||
$MouseSpeed = 0
|
$MouseSpeed = 0
|
||||||
$MouseThreshold1 = 0
|
$MouseThreshold1 = 0
|
||||||
@ -28,15 +27,12 @@ Function Invoke-WinUtilMouseAcceleration {
|
|||||||
Set-ItemProperty -Path $Path -Name MouseSpeed -Value $MouseSpeed
|
Set-ItemProperty -Path $Path -Name MouseSpeed -Value $MouseSpeed
|
||||||
Set-ItemProperty -Path $Path -Name MouseThreshold1 -Value $MouseThreshold1
|
Set-ItemProperty -Path $Path -Name MouseThreshold1 -Value $MouseThreshold1
|
||||||
Set-ItemProperty -Path $Path -Name MouseThreshold2 -Value $MouseThreshold2
|
Set-ItemProperty -Path $Path -Name MouseThreshold2 -Value $MouseThreshold2
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,27 +6,26 @@ function Invoke-WinUtilNumLock {
|
|||||||
Indicates whether to enable or disable Numlock on startup
|
Indicates whether to enable or disable Numlock on startup
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Numlock on startup"
|
Write-Host "Enabling Numlock on startup"
|
||||||
$value = 2
|
$value = 2
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Numlock on startup"
|
Write-Host "Disabling Numlock on startup"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
}
|
||||||
New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS
|
New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS
|
||||||
$Path = "HKU:\.Default\Control Panel\Keyboard"
|
$HKUPath = "HKU:\.Default\Control Panel\Keyboard"
|
||||||
Set-ItemProperty -Path $Path -Name InitialKeyboardIndicators -Value $value
|
$HKCUPath = "HKCU:\Control Panel\Keyboard"
|
||||||
|
Set-ItemProperty -Path $HKUPath -Name InitialKeyboardIndicators -Value $value
|
||||||
|
Set-ItemProperty -Path $HKCUPath -Name InitialKeyboardIndicators -Value $value
|
||||||
}
|
}
|
||||||
Catch [System.Security.SecurityException] {
|
Catch [System.Security.SecurityException] {
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,30 +20,25 @@ function Invoke-WinUtilScript {
|
|||||||
[scriptblock]$scriptblock
|
[scriptblock]$scriptblock
|
||||||
)
|
)
|
||||||
|
|
||||||
Try {
|
try {
|
||||||
Write-Host "Running Script for $name"
|
Write-Host "Running Script for $name"
|
||||||
Invoke-Command $scriptblock -ErrorAction Stop
|
Invoke-Command $scriptblock -ErrorAction Stop
|
||||||
}
|
} catch [System.Management.Automation.CommandNotFoundException] {
|
||||||
Catch [System.Management.Automation.CommandNotFoundException] {
|
|
||||||
Write-Warning "The specified command was not found."
|
Write-Warning "The specified command was not found."
|
||||||
Write-Warning $PSItem.Exception.message
|
Write-Warning $PSItem.Exception.message
|
||||||
}
|
} catch [System.Management.Automation.RuntimeException] {
|
||||||
Catch [System.Management.Automation.RuntimeException] {
|
|
||||||
Write-Warning "A runtime exception occurred."
|
Write-Warning "A runtime exception occurred."
|
||||||
Write-Warning $PSItem.Exception.message
|
Write-Warning $PSItem.Exception.message
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "A security exception occurred."
|
Write-Warning "A security exception occurred."
|
||||||
Write-Warning $PSItem.Exception.message
|
Write-Warning $PSItem.Exception.message
|
||||||
}
|
} catch [System.UnauthorizedAccessException] {
|
||||||
Catch [System.UnauthorizedAccessException] {
|
|
||||||
Write-Warning "Access denied. You do not have permission to perform this operation."
|
Write-Warning "Access denied. You do not have permission to perform this operation."
|
||||||
Write-Warning $PSItem.Exception.message
|
Write-Warning $PSItem.Exception.message
|
||||||
}
|
} catch {
|
||||||
Catch {
|
|
||||||
# Generic catch block to handle any other type of exception
|
# Generic catch block to handle any other type of exception
|
||||||
Write-Warning "Unable to run script for $name due to unhandled exception"
|
Write-Warning "Unable to run script for $name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,26 +6,22 @@ function Invoke-WinUtilShowExt {
|
|||||||
Indicates whether to enable or disable Show file extentions
|
Indicates whether to enable or disable Show file extentions
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Showing file extentions"
|
Write-Host "Showing file extentions"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "hiding file extensions"
|
Write-Host "hiding file extensions"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
}
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
||||||
Set-ItemProperty -Path $Path -Name HideFileExt -Value $value
|
Set-ItemProperty -Path $Path -Name HideFileExt -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,27 +6,23 @@ function Invoke-WinUtilSnapFlyout {
|
|||||||
Indicates whether to enable or disable Snap Assist Flyout on startup
|
Indicates whether to enable or disable Snap Assist Flyout on startup
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Snap Assist Flyout On startup"
|
Write-Host "Enabling Snap Assist Flyout On startup"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Snap Assist Flyout On startup"
|
Write-Host "Disabling Snap Assist Flyout On startup"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
||||||
Set-ItemProperty -Path $Path -Name EnableSnapAssistFlyout -Value $value
|
Set-ItemProperty -Path $Path -Name EnableSnapAssistFlyout -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,27 +6,23 @@ function Invoke-WinUtilSnapSuggestion {
|
|||||||
Indicates whether to enable or disable Snap Assist Suggestions on startup
|
Indicates whether to enable or disable Snap Assist Suggestions on startup
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Snap Assist Suggestion On startup"
|
Write-Host "Enabling Snap Assist Suggestion On startup"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Snap Assist Suggestion On startup"
|
Write-Host "Disabling Snap Assist Suggestion On startup"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
}
|
||||||
# taskkill.exe /F /IM "explorer.exe"
|
# taskkill.exe /F /IM "explorer.exe"
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
||||||
Set-ItemProperty -Path $Path -Name SnapAssist -Value $value
|
Set-ItemProperty -Path $Path -Name SnapAssist -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,26 +6,22 @@ function Invoke-WinUtilSnapWindow {
|
|||||||
Indicates whether to enable or disable Snapping Windows on startup
|
Indicates whether to enable or disable Snapping Windows on startup
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Snap Windows On startup | Relogin Required"
|
Write-Host "Enabling Snap Windows On startup | Relogin Required"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Snap Windows On startup | Relogin Required"
|
Write-Host "Disabling Snap Windows On startup | Relogin Required"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
}
|
||||||
$Path = "HKCU:\Control Panel\Desktop"
|
$Path = "HKCU:\Control Panel\Desktop"
|
||||||
Set-ItemProperty -Path $Path -Name WindowArrangementActive -Value $value
|
Set-ItemProperty -Path $Path -Name WindowArrangementActive -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,8 @@ Function Invoke-WinUtilSponsors {
|
|||||||
|
|
||||||
# Return the sponsors
|
# Return the sponsors
|
||||||
return $sponsors
|
return $sponsors
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Error "An error occurred while fetching or processing the sponsors: $_"
|
Write-Error "An error occurred while fetching or processing the sponsors: $_"
|
||||||
return $null
|
return $null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,26 +6,22 @@ Function Invoke-WinUtilStickyKeys {
|
|||||||
Indicates whether to enable or disable Sticky Keys on startup
|
Indicates whether to enable or disable Sticky Keys on startup
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try {
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Sticky Keys On startup"
|
Write-Host "Enabling Sticky Keys On startup"
|
||||||
$value = 510
|
$value = 510
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Sticky Keys On startup"
|
Write-Host "Disabling Sticky Keys On startup"
|
||||||
$value = 58
|
$value = 58
|
||||||
}
|
}
|
||||||
$Path = "HKCU:\Control Panel\Accessibility\StickyKeys"
|
$Path = "HKCU:\Control Panel\Accessibility\StickyKeys"
|
||||||
Set-ItemProperty -Path $Path -Name Flags -Value $value
|
Set-ItemProperty -Path $Path -Name Flags -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,25 +9,21 @@ function Invoke-WinUtilTaskView {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Task View"
|
Write-Host "Enabling Task View"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Task View"
|
Write-Host "Disabling Task View"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
}
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
||||||
Set-ItemProperty -Path $Path -Name ShowTaskViewButton -Value $value
|
Set-ItemProperty -Path $Path -Name ShowTaskViewButton -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
|
@ -9,25 +9,21 @@ function Invoke-WinUtilTaskbarAlignment {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Making Taskbar Alignment to the Center"
|
Write-Host "Making Taskbar Alignment to the Center"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Making Taskbar Alignment to the Left"
|
Write-Host "Making Taskbar Alignment to the Left"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
}
|
||||||
$Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
$Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
||||||
Set-ItemProperty -Path $Path -Name "TaskbarAl" -Value $value
|
Set-ItemProperty -Path $Path -Name "TaskbarAl" -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
|
@ -9,25 +9,21 @@ function Invoke-WinUtilTaskbarSearch {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Search Button"
|
Write-Host "Enabling Search Button"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Search Button"
|
Write-Host "Disabling Search Button"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
}
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search\"
|
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search\"
|
||||||
Set-ItemProperty -Path $Path -Name SearchboxTaskbarMode -Value $value
|
Set-ItemProperty -Path $Path -Name SearchboxTaskbarMode -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
|
@ -9,25 +9,21 @@ function Invoke-WinUtilTaskbarWidgets {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Taskbar Widgets"
|
Write-Host "Enabling Taskbar Widgets"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Taskbar Widgets"
|
Write-Host "Disabling Taskbar Widgets"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
}
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
||||||
Set-ItemProperty -Path $Path -Name TaskbarDa -Value $value
|
Set-ItemProperty -Path $Path -Name TaskbarDa -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ function Invoke-WinUtilTweaks {
|
|||||||
)
|
)
|
||||||
|
|
||||||
Write-Debug "Tweaks: $($CheckBox)"
|
Write-Debug "Tweaks: $($CheckBox)"
|
||||||
if($undo){
|
if($undo) {
|
||||||
$Values = @{
|
$Values = @{
|
||||||
Registry = "OriginalValue"
|
Registry = "OriginalValue"
|
||||||
ScheduledTask = "OriginalState"
|
ScheduledTask = "OriginalState"
|
||||||
@ -30,8 +30,7 @@ function Invoke-WinUtilTweaks {
|
|||||||
ScriptType = "UndoScript"
|
ScriptType = "UndoScript"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} else {
|
||||||
Else{
|
|
||||||
$Values = @{
|
$Values = @{
|
||||||
Registry = "Value"
|
Registry = "Value"
|
||||||
ScheduledTask = "State"
|
ScheduledTask = "State"
|
||||||
@ -40,18 +39,18 @@ function Invoke-WinUtilTweaks {
|
|||||||
ScriptType = "InvokeScript"
|
ScriptType = "InvokeScript"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($sync.configs.tweaks.$CheckBox.ScheduledTask){
|
if($sync.configs.tweaks.$CheckBox.ScheduledTask) {
|
||||||
$sync.configs.tweaks.$CheckBox.ScheduledTask | ForEach-Object {
|
$sync.configs.tweaks.$CheckBox.ScheduledTask | ForEach-Object {
|
||||||
Write-Debug "$($psitem.Name) and state is $($psitem.$($values.ScheduledTask))"
|
Write-Debug "$($psitem.Name) and state is $($psitem.$($values.ScheduledTask))"
|
||||||
Set-WinUtilScheduledTask -Name $psitem.Name -State $psitem.$($values.ScheduledTask)
|
Set-WinUtilScheduledTask -Name $psitem.Name -State $psitem.$($values.ScheduledTask)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($sync.configs.tweaks.$CheckBox.service){
|
if($sync.configs.tweaks.$CheckBox.service) {
|
||||||
Write-Debug "KeepServiceStartup is $KeepServiceStartup"
|
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 memeber, which's the 'OriginalService' Property
|
# The check for !($undo) is required, without it the script will throw an error for accessing unavailable memeber, 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
|
||||||
@ -60,8 +59,7 @@ function Invoke-WinUtilTweaks {
|
|||||||
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))"
|
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] {
|
|
||||||
Write-Warning "Service $($psitem.Name) was not found"
|
Write-Warning "Service $($psitem.Name) was not found"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,13 +70,13 @@ function Invoke-WinUtilTweaks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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))"
|
Write-Debug "$($psitem.Name) and state is $($psitem.$($values.registry))"
|
||||||
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))"
|
Write-Debug "$($psitem) and state is $($psitem.$($values.ScriptType))"
|
||||||
$Scriptblock = [scriptblock]::Create($psitem)
|
$Scriptblock = [scriptblock]::Create($psitem)
|
||||||
@ -86,8 +84,8 @@ function Invoke-WinUtilTweaks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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)"
|
Write-Debug "UNDO $($psitem.Name)"
|
||||||
Remove-WinUtilAPPX -Name $psitem
|
Remove-WinUtilAPPX -Name $psitem
|
||||||
|
@ -6,26 +6,22 @@ function Invoke-WinUtilVerboseLogon {
|
|||||||
Indicates whether to enable or disable VerboseLogon messages
|
Indicates whether to enable or disable VerboseLogon messages
|
||||||
#>
|
#>
|
||||||
Param($Enabled)
|
Param($Enabled)
|
||||||
Try{
|
try {
|
||||||
if ($Enabled -eq $false){
|
if ($Enabled -eq $false) {
|
||||||
Write-Host "Enabling Verbose Logon Messages"
|
Write-Host "Enabling Verbose Logon Messages"
|
||||||
$value = 1
|
$value = 1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Disabling Verbose Logon Messages"
|
Write-Host "Disabling Verbose Logon Messages"
|
||||||
$value = 0
|
$value = 0
|
||||||
}
|
}
|
||||||
$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
|
$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
|
||||||
Set-ItemProperty -Path $Path -Name VerboseStatus -Value $value
|
Set-ItemProperty -Path $Path -Name VerboseStatus -Value $value
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,8 @@ Function Invoke-WinUtilWingetProgram {
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory, Position=0)]
|
[Parameter(Mandatory, Position=0)]$Programs,
|
||||||
$Programs,
|
|
||||||
|
|
||||||
[Parameter(Mandatory, Position=1)]
|
[Parameter(Mandatory, Position=1)]
|
||||||
[ValidateSet("Install", "Uninstall")]
|
[ValidateSet("Install", "Uninstall")]
|
||||||
[String]$Action
|
[String]$Action
|
||||||
@ -36,7 +35,7 @@ Function Invoke-WinUtilWingetProgram {
|
|||||||
|
|
||||||
.PARAMETER credential
|
.PARAMETER credential
|
||||||
The PSCredential Object of the user that should be used to run winget
|
The PSCredential Object of the user that should be used to run winget
|
||||||
|
|
||||||
.NOTES
|
.NOTES
|
||||||
Invoke Winget uses the public variable $Action defined outside the function to determine if a Program should be installed or removed
|
Invoke Winget uses the public variable $Action defined outside the function to determine if a Program should be installed or removed
|
||||||
#>
|
#>
|
||||||
@ -47,10 +46,9 @@ Function Invoke-WinUtilWingetProgram {
|
|||||||
)
|
)
|
||||||
|
|
||||||
$commonArguments = "--id $wingetId --silent"
|
$commonArguments = "--id $wingetId --silent"
|
||||||
$arguments = if ($Action -eq "Install"){
|
$arguments = if ($Action -eq "Install") {
|
||||||
"install $commonArguments --accept-source-agreements --accept-package-agreements $(if ($scope) {" --scope $scope"})"
|
"install $commonArguments --accept-source-agreements --accept-package-agreements $(if ($scope) {" --scope $scope"})"
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
"uninstall $commonArguments"
|
"uninstall $commonArguments"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,15 +63,15 @@ Function Invoke-WinUtilWingetProgram {
|
|||||||
if ($credential) {
|
if ($credential) {
|
||||||
$processParams.credential = $credential
|
$processParams.credential = $credential
|
||||||
}
|
}
|
||||||
|
|
||||||
return (Start-Process @processParams).ExitCode
|
return (Start-Process @processParams).ExitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
Function Invoke-Install {
|
Function Invoke-Install {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Contains the Install Logic and return code handling from winget
|
Contains the Install Logic and return code handling from winget
|
||||||
|
|
||||||
.PARAMETER Program
|
.PARAMETER Program
|
||||||
The Winget ID of the Program that should be installed
|
The Winget ID of the Program that should be installed
|
||||||
#>
|
#>
|
||||||
@ -119,14 +117,14 @@ Function Invoke-WinUtilWingetProgram {
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Contains the Uninstall Logic and return code handling from winget
|
Contains the Uninstall Logic and return code handling from winget
|
||||||
|
|
||||||
.PARAMETER Program
|
.PARAMETER Program
|
||||||
The Winget ID of the Program that should be uninstalled
|
The Winget ID of the Program that should be uninstalled
|
||||||
#>
|
#>
|
||||||
param (
|
param (
|
||||||
[psobject]$Program
|
[psobject]$Program
|
||||||
)
|
)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$status = Invoke-Winget -wingetId $Program
|
$status = Invoke-Winget -wingetId $Program
|
||||||
if ($status -eq 0) {
|
if ($status -eq 0) {
|
||||||
@ -144,21 +142,21 @@ Function Invoke-WinUtilWingetProgram {
|
|||||||
|
|
||||||
$count = $Programs.Count
|
$count = $Programs.Count
|
||||||
$failedPackages = @()
|
$failedPackages = @()
|
||||||
|
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
Write-Host "-- Configuring winget packages ---"
|
Write-Host "-- Configuring winget packages ---"
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
|
|
||||||
for ($i = 0; $i -lt $count; $i++) {
|
for ($i = 0; $i -lt $count; $i++) {
|
||||||
$Program = $Programs[$i]
|
$Program = $Programs[$i]
|
||||||
$result = $false
|
$result = $false
|
||||||
Set-WinUtilProgressBar -label "$Action $($Program)" -percent ($i / $count * 100)
|
Set-WinUtilProgressBar -label "$Action $($Program)" -percent ($i / $count * 100)
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($i / $count)})
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($i / $count)})
|
||||||
|
|
||||||
$result = switch ($Action) {
|
$result = switch ($Action) {
|
||||||
"Install" {Invoke-Install -Program $Program}
|
"Install" {Invoke-Install -Program $Program}
|
||||||
"Uninstall" {Invoke-Uninstall -Program $Program}
|
"Uninstall" {Invoke-Uninstall -Program $Program}
|
||||||
default {throw "[Install-WinUtilProgramWinget] Invalid action: $Action"}
|
default {throw "[Install-WinUtilProgramWinget] Invalid action: $Action"}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not $result) {
|
if (-not $result) {
|
||||||
|
@ -15,22 +15,19 @@ function Remove-WinUtilAPPX {
|
|||||||
$Name
|
$Name
|
||||||
)
|
)
|
||||||
|
|
||||||
Try {
|
try {
|
||||||
Write-Host "Removing $Name"
|
Write-Host "Removing $Name"
|
||||||
Get-AppxPackage "*$Name*" | Remove-AppxPackage -ErrorAction SilentlyContinue
|
Get-AppxPackage "*$Name*" | Remove-AppxPackage -ErrorAction SilentlyContinue
|
||||||
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like "*$Name*" | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
|
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like "*$Name*" | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
|
||||||
}
|
} catch [System.Exception] {
|
||||||
Catch [System.Exception] {
|
|
||||||
if ($psitem.Exception.Message -like "*The requested operation requires elevation*") {
|
if ($psitem.Exception.Message -like "*The requested operation requires elevation*") {
|
||||||
Write-Warning "Unable to uninstall $name due to a Security Exception"
|
Write-Warning "Unable to uninstall $name due to a Security Exception"
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Warning "Unable to uninstall $name due to unhandled exception"
|
Write-Warning "Unable to uninstall $name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to uninstall $name due to unhandled exception"
|
Write-Warning "Unable to uninstall $name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,24 +12,22 @@ function Set-WinUtilDNS {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
param($DNSProvider)
|
param($DNSProvider)
|
||||||
if($DNSProvider -eq "Default"){return}
|
if($DNSProvider -eq "Default") {return}
|
||||||
Try{
|
try {
|
||||||
$Adapters = Get-NetAdapter | Where-Object {$_.Status -eq "Up"}
|
$Adapters = Get-NetAdapter | Where-Object {$_.Status -eq "Up"}
|
||||||
Write-Host "Ensuring DNS is set to $DNSProvider on the following interfaces"
|
Write-Host "Ensuring DNS is set to $DNSProvider on the following interfaces"
|
||||||
Write-Host $($Adapters | Out-String)
|
Write-Host $($Adapters | Out-String)
|
||||||
|
|
||||||
Foreach ($Adapter in $Adapters){
|
Foreach ($Adapter in $Adapters) {
|
||||||
if($DNSProvider -eq "DHCP"){
|
if($DNSProvider -eq "DHCP") {
|
||||||
Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ResetServerAddresses
|
Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ResetServerAddresses
|
||||||
}
|
} else {
|
||||||
Else{
|
|
||||||
Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ServerAddresses ("$($sync.configs.dns.$DNSProvider.Primary)", "$($sync.configs.dns.$DNSProvider.Secondary)")
|
Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ServerAddresses ("$($sync.configs.dns.$DNSProvider.Primary)", "$($sync.configs.dns.$DNSProvider.Secondary)")
|
||||||
Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ServerAddresses ("$($sync.configs.dns.$DNSProvider.Primary6)", "$($sync.configs.dns.$DNSProvider.Secondary6)")
|
Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ServerAddresses ("$($sync.configs.dns.$DNSProvider.Primary6)", "$($sync.configs.dns.$DNSProvider.Secondary6)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set DNS Provider due to an unhandled exception"
|
Write-Warning "Unable to set DNS Provider due to an unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
function Set-WinUtilProgressbar{
|
function Set-WinUtilProgressbar{
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
This function is used to Update the Progress Bar displayed in the winutil GUI.
|
This function is used to Update the Progress Bar displayed in the winutil GUI.
|
||||||
It will be automatically hidden if the user clicks something and no process is running
|
It will be automatically hidden if the user clicks something and no process is running
|
||||||
.PARAMETER Label
|
.PARAMETER Label
|
||||||
The Text to be overlayed onto the Progress Bar
|
The Text to be overlayed onto the Progress Bar
|
||||||
.PARAMETER PERCENT
|
.PARAMETER PERCENT
|
||||||
The percentage of the Progress Bar that should be filled (0-100)
|
The percentage of the Progress Bar that should be filled (0-100)
|
||||||
.PARAMETER Hide
|
.PARAMETER Hide
|
||||||
If provided, the Progress Bar and the label will be hidden
|
If provided, the Progress Bar and the label will be hidden
|
||||||
#>
|
#>
|
||||||
@ -16,16 +16,15 @@ function Set-WinUtilProgressbar{
|
|||||||
[int]$Percent,
|
[int]$Percent,
|
||||||
$Hide
|
$Hide
|
||||||
)
|
)
|
||||||
if ($hide){
|
if ($hide) {
|
||||||
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Collapsed"})
|
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Collapsed"})
|
||||||
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Collapsed"})
|
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Collapsed"})
|
||||||
|
} else {
|
||||||
|
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Visible"})
|
||||||
|
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Visible"})
|
||||||
}
|
}
|
||||||
else{
|
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.Text = $label})
|
||||||
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Visible"})
|
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.ToolTip = $label})
|
||||||
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Visible"})
|
|
||||||
}
|
|
||||||
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.Text = $label})
|
|
||||||
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.ToolTip = $label})
|
|
||||||
$sync.form.Dispatcher.Invoke([action]{ $sync.ProgressBar.Value = $percent})
|
$sync.form.Dispatcher.Invoke([action]{ $sync.ProgressBar.Value = $percent})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,8 @@ function Set-WinUtilRegistry {
|
|||||||
$Value
|
$Value
|
||||||
)
|
)
|
||||||
|
|
||||||
Try{
|
try {
|
||||||
if(!(Test-Path 'HKU:\')){New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS}
|
if(!(Test-Path 'HKU:\')) {New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS}
|
||||||
|
|
||||||
If (!(Test-Path $Path)) {
|
If (!(Test-Path $Path)) {
|
||||||
Write-Host "$Path was not found, Creating..."
|
Write-Host "$Path was not found, Creating..."
|
||||||
@ -37,14 +37,11 @@ function Set-WinUtilRegistry {
|
|||||||
|
|
||||||
Write-Host "Set $Path\$Name to $Value"
|
Write-Host "Set $Path\$Name to $Value"
|
||||||
Set-ItemProperty -Path $Path -Name $Name -Type $Type -Value $Value -Force -ErrorAction Stop | Out-Null
|
Set-ItemProperty -Path $Path -Name $Name -Type $Type -Value $Value -Force -ErrorAction Stop | Out-Null
|
||||||
}
|
} catch [System.Security.SecurityException] {
|
||||||
Catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
}
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
Write-Warning $psitem.Exception.ErrorRecord
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
|
@ -19,27 +19,24 @@ function Set-WinUtilScheduledTask {
|
|||||||
$State
|
$State
|
||||||
)
|
)
|
||||||
|
|
||||||
Try{
|
try {
|
||||||
if($State -eq "Disabled"){
|
if($State -eq "Disabled") {
|
||||||
Write-Host "Disabling Scheduled Task $Name"
|
Write-Host "Disabling Scheduled Task $Name"
|
||||||
Disable-ScheduledTask -TaskName $Name -ErrorAction Stop
|
Disable-ScheduledTask -TaskName $Name -ErrorAction Stop
|
||||||
}
|
}
|
||||||
if($State -eq "Enabled"){
|
if($State -eq "Enabled") {
|
||||||
Write-Host "Enabling Scheduled Task $Name"
|
Write-Host "Enabling Scheduled Task $Name"
|
||||||
Enable-ScheduledTask -TaskName $Name -ErrorAction Stop
|
Enable-ScheduledTask -TaskName $Name -ErrorAction Stop
|
||||||
}
|
}
|
||||||
}
|
} catch [System.Exception] {
|
||||||
Catch [System.Exception]{
|
if($psitem.Exception.Message -like "*The system cannot find the file specified*") {
|
||||||
if($psitem.Exception.Message -like "*The system cannot find the file specified*"){
|
|
||||||
Write-Warning "Scheduled Task $name was not Found"
|
Write-Warning "Scheduled Task $name was not Found"
|
||||||
}
|
} else {
|
||||||
Else{
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.Message
|
Write-Warning $psitem.Exception.Message
|
||||||
}
|
}
|
||||||
}
|
} catch {
|
||||||
Catch{
|
|
||||||
Write-Warning "Unable to run script for $name due to unhandled exception"
|
Write-Warning "Unable to run script for $name due to unhandled exception"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,9 @@ Function Set-WinUtilService {
|
|||||||
|
|
||||||
# Service exists, proceed with changing properties
|
# Service exists, proceed with changing properties
|
||||||
$service | Set-Service -StartupType $StartupType -ErrorAction Stop
|
$service | Set-Service -StartupType $StartupType -ErrorAction Stop
|
||||||
}
|
} catch [System.ServiceProcess.ServiceNotFoundException] {
|
||||||
catch [System.ServiceProcess.ServiceNotFoundException] {
|
|
||||||
Write-Warning "Service $Name was not found"
|
Write-Warning "Service $Name was not found"
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||||
Write-Warning $_.Exception.Message
|
Write-Warning $_.Exception.Message
|
||||||
}
|
}
|
||||||
|
@ -83,4 +83,4 @@ function Set-WinUtilTaskbaritem {
|
|||||||
if ($description) {
|
if ($description) {
|
||||||
$sync["Form"].taskbarItemInfo.Description = $description
|
$sync["Form"].taskbarItemInfo.Description = $description
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,24 @@
|
|||||||
function Set-WinUtilUITheme {
|
function Set-WinUtilUITheme {
|
||||||
<#
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Sets the theme of the XAML file
|
||||||
|
|
||||||
.SYNOPSIS
|
.PARAMETER inputXML
|
||||||
Sets the theme of the XAML file
|
A string representing the XAML object to modify
|
||||||
|
|
||||||
.PARAMETER inputXML
|
.PARAMETER themeName
|
||||||
A string representing the XAML object to modify
|
The name of the theme to set the XAML to. Defaults to 'matrix'
|
||||||
|
|
||||||
.PARAMETER themeName
|
|
||||||
The name of the theme to set the XAML to. Defaults to 'matrix'
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Set-WinUtilUITheme -inputXAML $inputXAML
|
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Set-WinUtilUITheme -inputXAML $inputXAML
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param
|
param
|
||||||
(
|
(
|
||||||
[Parameter(Mandatory=$true, Position=0)]
|
[Parameter(Mandatory, position=0)]
|
||||||
[string] $inputXML,
|
[string]$inputXML,
|
||||||
[Parameter(Mandatory=$false, Position=1)]
|
[Parameter(position=1)]
|
||||||
[string] $themeName = 'matrix'
|
[string]$themeName = 'matrix'
|
||||||
)
|
)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -38,13 +37,11 @@ function Set-WinUtilUITheme {
|
|||||||
# Replace the key with the value in the input XML
|
# Replace the key with the value in the input XML
|
||||||
$inputXML = $inputXML.Replace($formattedKey, $value)
|
$inputXML = $inputXML.Replace($formattedKey, $value)
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "Theme '$themeName' not found."
|
Write-Host "Theme '$themeName' not found."
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Warning "Unable to apply theme"
|
Write-Warning "Unable to apply theme"
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Warning $psitem.Exception.StackTrace
|
||||||
}
|
}
|
||||||
|
@ -44,13 +44,14 @@ function Show-CustomDialog {
|
|||||||
Add-Type -AssemblyName PresentationFramework
|
Add-Type -AssemblyName PresentationFramework
|
||||||
|
|
||||||
# Define theme colors
|
# Define theme colors
|
||||||
$foregroundColor = [Windows.Media.Brushes]::White
|
$foregroundColor = $sync.configs.themes.$ctttheme.MainForegroundColor
|
||||||
$backgroundColor = [Windows.Media.Brushes]::Black
|
$backgroundColor = $sync.configs.themes.$ctttheme.MainBackgroundColor
|
||||||
$font = New-Object Windows.Media.FontFamily("Consolas")
|
$font = New-Object Windows.Media.FontFamily("Consolas")
|
||||||
$borderColor = [Windows.Media.Brushes]::Green
|
$borderColor = $sync.configs.themes.$ctttheme.BorderColor # ButtonInstallBackgroundColor
|
||||||
$buttonBackgroundColor = [Windows.Media.Brushes]::Black
|
$buttonBackgroundColor = $sync.configs.themes.$ctttheme.ButtonInstallBackgroundColor
|
||||||
$buttonForegroundColor = [Windows.Media.Brushes]::White
|
$buttonForegroundColor = $sync.configs.themes.$ctttheme.ButtonInstallForegroundColor
|
||||||
$shadowColor = [Windows.Media.ColorConverter]::ConvertFromString("#AAAAAAAA")
|
$shadowColor = [Windows.Media.ColorConverter]::ConvertFromString("#AAAAAAAA")
|
||||||
|
$logocolor = $sync.configs.themes.$ctttheme.ButtonBackgroundPressedColor
|
||||||
|
|
||||||
# Create a custom dialog window
|
# Create a custom dialog window
|
||||||
$dialog = New-Object Windows.Window
|
$dialog = New-Object Windows.Window
|
||||||
@ -180,7 +181,7 @@ $cttLogoPath = @"
|
|||||||
# Add SVG path
|
# Add SVG path
|
||||||
$svgPath = New-Object Windows.Shapes.Path
|
$svgPath = New-Object Windows.Shapes.Path
|
||||||
$svgPath.Data = [Windows.Media.Geometry]::Parse($cttLogoPath)
|
$svgPath.Data = [Windows.Media.Geometry]::Parse($cttLogoPath)
|
||||||
$svgPath.Fill = $foregroundColor # Set fill color to white
|
$svgPath.Fill = $logocolor # Set fill color to white
|
||||||
|
|
||||||
# Add SVG path to Viewbox
|
# Add SVG path to Viewbox
|
||||||
$viewbox.Child = $svgPath
|
$viewbox.Child = $svgPath
|
||||||
@ -192,7 +193,7 @@ $cttLogoPath = @"
|
|||||||
$winutilTextBlock = New-Object Windows.Controls.TextBlock
|
$winutilTextBlock = New-Object Windows.Controls.TextBlock
|
||||||
$winutilTextBlock.Text = "Winutil"
|
$winutilTextBlock.Text = "Winutil"
|
||||||
$winutilTextBlock.FontSize = $HeaderFontSize
|
$winutilTextBlock.FontSize = $HeaderFontSize
|
||||||
$winutilTextBlock.Foreground = $foregroundColor
|
$winutilTextBlock.Foreground = $logocolor
|
||||||
$winutilTextBlock.Margin = New-Object Windows.Thickness(10, 5, 10, 5) # Add margins around the text block
|
$winutilTextBlock.Margin = New-Object Windows.Thickness(10, 5, 10, 5) # Add margins around the text block
|
||||||
$stackPanel.Children.Add($winutilTextBlock)
|
$stackPanel.Children.Add($winutilTextBlock)
|
||||||
# Add TextBlock for information with text wrapping and margins
|
# Add TextBlock for information with text wrapping and margins
|
||||||
@ -219,18 +220,19 @@ $cttLogoPath = @"
|
|||||||
$hyperlink.NavigateUri = New-Object System.Uri($match.Groups[1].Value)
|
$hyperlink.NavigateUri = New-Object System.Uri($match.Groups[1].Value)
|
||||||
$hyperlink.Inlines.Add($match.Groups[2].Value)
|
$hyperlink.Inlines.Add($match.Groups[2].Value)
|
||||||
$hyperlink.TextDecorations = [Windows.TextDecorations]::None # Remove underline
|
$hyperlink.TextDecorations = [Windows.TextDecorations]::None # Remove underline
|
||||||
$hyperlink.Foreground = $foregroundColor
|
$hyperlink.Foreground = $sync.configs.themes.$ctttheme.LinkForegroundColor
|
||||||
|
|
||||||
$hyperlink.Add_Click({
|
$hyperlink.Add_Click({
|
||||||
param($sender, $args)
|
param($sender, $args)
|
||||||
Start-Process $sender.NavigateUri.AbsoluteUri
|
Start-Process $sender.NavigateUri.AbsoluteUri
|
||||||
})
|
})
|
||||||
$hyperlink.Add_MouseEnter({
|
$hyperlink.Add_MouseEnter({
|
||||||
param($sender, $args)
|
param($sender, $args)
|
||||||
$sender.Foreground = [Windows.Media.Brushes]::LightGray
|
$sender.Foreground = $sync.configs.themes.$ctttheme.LinkHoverForegroundColor
|
||||||
})
|
})
|
||||||
$hyperlink.Add_MouseLeave({
|
$hyperlink.Add_MouseLeave({
|
||||||
param($sender, $args)
|
param($sender, $args)
|
||||||
$sender.Foreground = $foregroundColor
|
$sender.Foreground = $sync.configs.themes.$ctttheme.LinkForegroundColor
|
||||||
})
|
})
|
||||||
|
|
||||||
$messageTextBlock.Inlines.Add($hyperlink)
|
$messageTextBlock.Inlines.Add($hyperlink)
|
||||||
|
@ -30,12 +30,12 @@ function Test-WinUtilPackageManager {
|
|||||||
} catch {
|
} catch {
|
||||||
Write-Warning "Winget was not found due to un-known reasons, The Stack Trace is:`n$($psitem.Exception.StackTrace)"
|
Write-Warning "Winget was not found due to un-known reasons, The Stack Trace is:`n$($psitem.Exception.StackTrace)"
|
||||||
$wingetExists = $false
|
$wingetExists = $false
|
||||||
}
|
}
|
||||||
|
|
||||||
# If Winget is available, Parse it's Version and give proper information to Terminal Output.
|
# If Winget is available, Parse it's Version and give proper information to Terminal Output.
|
||||||
# If it isn't available, the return of this funtion will be "not-installed", indicating that
|
# If it isn't available, the return of this funtion will be "not-installed", indicating that
|
||||||
# Winget isn't installed/available on The System.
|
# Winget isn't installed/available on The System.
|
||||||
if ($wingetExists) {
|
if ($wingetExists) {
|
||||||
# Check if Preview Version
|
# Check if Preview Version
|
||||||
if ($wingetVersionFull.Contains("-preview")) {
|
if ($wingetVersionFull.Contains("-preview")) {
|
||||||
$wingetVersion = $wingetVersionFull.Trim("-preview")
|
$wingetVersion = $wingetVersionFull.Trim("-preview")
|
||||||
@ -65,8 +65,7 @@ function Test-WinUtilPackageManager {
|
|||||||
if (!$wingetOutdated) {
|
if (!$wingetOutdated) {
|
||||||
Write-Host " - Winget is Up to Date" -ForegroundColor Green
|
Write-Host " - Winget is Up to Date" -ForegroundColor Green
|
||||||
$status = "installed"
|
$status = "installed"
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host " - Winget is Out of Date" -ForegroundColor Red
|
Write-Host " - Winget is Out of Date" -ForegroundColor Red
|
||||||
$status = "outdated"
|
$status = "outdated"
|
||||||
}
|
}
|
||||||
|
152
functions/private/Uninstall-WinUtilEdgeBrowser.ps1
Normal file
152
functions/private/Uninstall-WinUtilEdgeBrowser.ps1
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
Function Uninstall-WinUtilEdgeBrowser {
|
||||||
|
|
||||||
|
<#
|
||||||
|
|
||||||
|
.SYNOPSIS
|
||||||
|
This will uninstall edge by changing the region to Ireland and uninstalling edge the changing it back
|
||||||
|
|
||||||
|
#>
|
||||||
|
|
||||||
|
$msedgeProcess = Get-Process -Name "msedge" -ErrorAction SilentlyContinue
|
||||||
|
$widgetsProcess = Get-Process -Name "widgets" -ErrorAction SilentlyContinue
|
||||||
|
# Checking if Microsoft Edge is running
|
||||||
|
if ($msedgeProcess) {
|
||||||
|
Stop-Process -Name "msedge" -Force
|
||||||
|
} else {
|
||||||
|
Write-Output "msedge process is not running."
|
||||||
|
}
|
||||||
|
# Checking if Widgets is running
|
||||||
|
if ($widgetsProcess) {
|
||||||
|
Stop-Process -Name "widgets" -Force
|
||||||
|
} else {
|
||||||
|
Write-Output "widgets process is not running."
|
||||||
|
}
|
||||||
|
|
||||||
|
function Uninstall-Process {
|
||||||
|
param (
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$Key
|
||||||
|
)
|
||||||
|
|
||||||
|
$originalNation = [microsoft.win32.registry]::GetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', [Microsoft.Win32.RegistryValueKind]::String)
|
||||||
|
|
||||||
|
# Set Nation to 84 (France) temporarily
|
||||||
|
[microsoft.win32.registry]::SetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', 68, [Microsoft.Win32.RegistryValueKind]::String) | Out-Null
|
||||||
|
|
||||||
|
# credits to he3als for the Acl commands
|
||||||
|
$fileName = "IntegratedServicesRegionPolicySet.json"
|
||||||
|
$pathISRPS = [Environment]::SystemDirectory + "\" + $fileName
|
||||||
|
$aclISRPS = Get-Acl -Path $pathISRPS
|
||||||
|
$aclISRPSBackup = [System.Security.AccessControl.FileSecurity]::new()
|
||||||
|
$aclISRPSBackup.SetSecurityDescriptorSddlForm($acl.Sddl)
|
||||||
|
if (Test-Path -Path $pathISRPS) {
|
||||||
|
try {
|
||||||
|
$admin = [System.Security.Principal.NTAccount]$(New-Object System.Security.Principal.SecurityIdentifier('S-1-5-32-544')).Translate([System.Security.Principal.NTAccount]).Value
|
||||||
|
|
||||||
|
$aclISRPS.SetOwner($admin)
|
||||||
|
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admin, 'FullControl', 'Allow')
|
||||||
|
$aclISRPS.AddAccessRule($rule)
|
||||||
|
Set-Acl -Path $pathISRPS -AclObject $aclISRPS
|
||||||
|
|
||||||
|
Rename-Item -Path $pathISRPS -NewName ($fileName + '.bak') -Force
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
Write-Error "[$Mode] Failed to set owner for $pathISRPS"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$baseKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate'
|
||||||
|
$registryPath = $baseKey + '\ClientState\' + $Key
|
||||||
|
|
||||||
|
if (!(Test-Path -Path $registryPath)) {
|
||||||
|
Write-Host "[$Mode] Registry key not found: $registryPath"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Remove-ItemProperty -Path $registryPath -Name "experiment_control_labels" -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
|
||||||
|
$uninstallString = (Get-ItemProperty -Path $registryPath).UninstallString
|
||||||
|
$uninstallArguments = (Get-ItemProperty -Path $registryPath).UninstallArguments
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($uninstallString) -or [string]::IsNullOrEmpty($uninstallArguments)) {
|
||||||
|
Write-Host "[$Mode] Cannot find uninstall methods for $Mode"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
$uninstallArguments += " --force-uninstall --delete-profile"
|
||||||
|
|
||||||
|
# $uninstallCommand = "`"$uninstallString`"" + $uninstallArguments
|
||||||
|
if (!(Test-Path -Path $uninstallString)) {
|
||||||
|
Write-Host "[$Mode] setup.exe not found at: $uninstallString"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Start-Process -FilePath $uninstallString -ArgumentList $uninstallArguments -Wait -NoNewWindow -Verbose
|
||||||
|
|
||||||
|
# Restore Acl
|
||||||
|
if (Test-Path -Path ($pathISRPS + '.bak')) {
|
||||||
|
Rename-Item -Path ($pathISRPS + '.bak') -NewName $fileName -Force
|
||||||
|
Set-Acl -Path $pathISRPS -AclObject $aclISRPSBackup
|
||||||
|
}
|
||||||
|
|
||||||
|
# Restore Nation
|
||||||
|
[microsoft.win32.registry]::SetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', $originalNation, [Microsoft.Win32.RegistryValueKind]::String) | Out-Null
|
||||||
|
|
||||||
|
if ((Get-ItemProperty -Path $baseKey).IsEdgeStableUninstalled -eq 1) {
|
||||||
|
Write-Host "[$Mode] Edge Stable has been successfully uninstalled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Uninstall-Edge {
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
|
||||||
|
[microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdateDev", "AllowUninstall", 1, [Microsoft.Win32.RegistryValueKind]::DWord) | Out-Null
|
||||||
|
|
||||||
|
Uninstall-Process -Key '{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}'
|
||||||
|
|
||||||
|
@( "$env:ProgramData\Microsoft\Windows\Start Menu\Programs",
|
||||||
|
"$env:PUBLIC\Desktop",
|
||||||
|
"$env:USERPROFILE\Desktop" ) | ForEach-Object {
|
||||||
|
$shortcutPath = Join-Path -Path $_ -ChildPath "Microsoft Edge.lnk"
|
||||||
|
if (Test-Path -Path $shortcutPath) {
|
||||||
|
Remove-Item -Path $shortcutPath -Force
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function Uninstall-WebView {
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
|
||||||
|
# Force to use system-wide WebView2
|
||||||
|
# [microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder", "*", "%%SystemRoot%%\System32\Microsoft-Edge-WebView")
|
||||||
|
|
||||||
|
Uninstall-Process -Key '{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
|
||||||
|
}
|
||||||
|
|
||||||
|
function Uninstall-EdgeUpdate {
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
|
||||||
|
$registryPath = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate'
|
||||||
|
if (!(Test-Path -Path $registryPath)) {
|
||||||
|
Write-Host "Registry key not found: $registryPath"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
$uninstallCmdLine = (Get-ItemProperty -Path $registryPath).UninstallCmdLine
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($uninstallCmdLine)) {
|
||||||
|
Write-Host "Cannot find uninstall methods for $Mode"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Output "Uninstalling: $uninstallCmdLine"
|
||||||
|
Start-Process cmd.exe "/c $uninstallCmdLine" -WindowStyle Hidden -Wait
|
||||||
|
}
|
||||||
|
|
||||||
|
Uninstall-Edge
|
||||||
|
# "WebView" { Uninstall-WebView }
|
||||||
|
# "EdgeUpdate" { Uninstall-EdgeUpdate }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -18,4 +18,4 @@ Function Update-WinUtilProgramWinget {
|
|||||||
|
|
||||||
$global:WinGetInstall = Start-Process -Verb runas powershell -ArgumentList "-command invoke-command -scriptblock {$wingetinstall} -argumentlist '$($ProgramsToInstall -join ",")'" -PassThru
|
$global:WinGetInstall = Start-Process -Verb runas powershell -ArgumentList "-command invoke-command -scriptblock {$wingetinstall} -argumentlist '$($ProgramsToInstall -join ",")'" -PassThru
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,7 @@ function Invoke-ScratchDialog {
|
|||||||
$filePath = $Dialog.SelectedPath
|
$filePath = $Dialog.SelectedPath
|
||||||
Write-Host "No ISO is chosen+ $filePath"
|
Write-Host "No ISO is chosen+ $filePath"
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($filePath))
|
if ([string]::IsNullOrEmpty($filePath)) {
|
||||||
{
|
|
||||||
Write-Host "No Folder had chosen"
|
Write-Host "No Folder had chosen"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -14,12 +14,12 @@ function Invoke-WPFButton {
|
|||||||
|
|
||||||
# Use this to get the name of the button
|
# Use this to get the name of the button
|
||||||
#[System.Windows.MessageBox]::Show("$Button","Chris Titus Tech's Windows Utility","OK","Info")
|
#[System.Windows.MessageBox]::Show("$Button","Chris Titus Tech's Windows Utility","OK","Info")
|
||||||
if (-not $sync.ProcessRunning){
|
if (-not $sync.ProcessRunning) {
|
||||||
Set-WinUtilProgressBar -label "" -percent 0 -hide $true
|
Set-WinUtilProgressBar -label "" -percent 0 -hide $true
|
||||||
}
|
}
|
||||||
|
|
||||||
Switch -Wildcard ($Button){
|
Switch -Wildcard ($Button) {
|
||||||
|
|
||||||
"WPFTab?BT" {Invoke-WPFTab $Button}
|
"WPFTab?BT" {Invoke-WPFTab $Button}
|
||||||
"WPFinstall" {Invoke-WPFInstall}
|
"WPFinstall" {Invoke-WPFInstall}
|
||||||
"WPFuninstall" {Invoke-WPFUnInstall}
|
"WPFuninstall" {Invoke-WPFUnInstall}
|
||||||
@ -58,4 +58,4 @@ function Invoke-WPFButton {
|
|||||||
"WPFCloseButton" {Invoke-WPFCloseButton}
|
"WPFCloseButton" {Invoke-WPFCloseButton}
|
||||||
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
|
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,4 +9,4 @@ function Invoke-WPFCloseButton {
|
|||||||
#>
|
#>
|
||||||
$sync["Form"].Close()
|
$sync["Form"].Close()
|
||||||
Write-Host "Bye bye!"
|
Write-Host "Bye bye!"
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ function Invoke-WPFControlPanel {
|
|||||||
#>
|
#>
|
||||||
param($Panel)
|
param($Panel)
|
||||||
|
|
||||||
switch ($Panel){
|
switch ($Panel) {
|
||||||
"WPFPanelcontrol" {cmd /c control}
|
"WPFPanelcontrol" {cmd /c control}
|
||||||
"WPFPanelnetwork" {cmd /c ncpa.cpl}
|
"WPFPanelnetwork" {cmd /c ncpa.cpl}
|
||||||
"WPFPanelpower" {cmd /c powercfg.cpl}
|
"WPFPanelpower" {cmd /c powercfg.cpl}
|
||||||
@ -19,4 +19,4 @@ function Invoke-WPFControlPanel {
|
|||||||
"WPFPanelsystem" {cmd /c sysdm.cpl}
|
"WPFPanelsystem" {cmd /c sysdm.cpl}
|
||||||
"WPFPaneluser" {cmd /c "control userpasswords2"}
|
"WPFPaneluser" {cmd /c "control userpasswords2"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ function Invoke-WPFFeatureInstall {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
if($sync.ProcessRunning){
|
if($sync.ProcessRunning) {
|
||||||
$msg = "[Invoke-WPFFeatureInstall] Install process is currently running."
|
$msg = "[Invoke-WPFFeatureInstall] Install process is currently running."
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
@ -17,7 +17,7 @@ function Invoke-WPFFeatureInstall {
|
|||||||
Invoke-WPFRunspace -ArgumentList $Features -DebugPreference $DebugPreference -ScriptBlock {
|
Invoke-WPFRunspace -ArgumentList $Features -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
param($Features, $DebugPreference)
|
param($Features, $DebugPreference)
|
||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
if ($Features.count -eq 1){
|
if ($Features.count -eq 1) {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
||||||
} else {
|
} else {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
||||||
@ -33,4 +33,4 @@ function Invoke-WPFFeatureInstall {
|
|||||||
Write-Host "--- A Reboot may be required ---"
|
Write-Host "--- A Reboot may be required ---"
|
||||||
Write-Host "==================================="
|
Write-Host "==================================="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,4 +26,4 @@ function Invoke-WPFFixesNetwork {
|
|||||||
Write-Host "=========================================="
|
Write-Host "=========================================="
|
||||||
Write-Host "-- Network Configuration has been Reset --"
|
Write-Host "-- Network Configuration has been Reset --"
|
||||||
Write-Host "=========================================="
|
Write-Host "=========================================="
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ function Invoke-WPFFixesUpdate {
|
|||||||
).Trim()} catch {0}) `
|
).Trim()} catch {0}) `
|
||||||
<# And the current percentage is greater than the previous one #>`
|
<# And the current percentage is greater than the previous one #>`
|
||||||
-and $percent -gt $oldpercent
|
-and $percent -gt $oldpercent
|
||||||
){
|
) {
|
||||||
# Update the progress bar
|
# Update the progress bar
|
||||||
$oldpercent = $percent
|
$oldpercent = $percent
|
||||||
Write-Progress -Id 1 -ParentId 0 -Activity "Scanning for corruption" -Status "Running chkdsk... ($percent%)" -PercentComplete $percent
|
Write-Progress -Id 1 -ParentId 0 -Activity "Scanning for corruption" -Status "Running chkdsk... ($percent%)" -PercentComplete $percent
|
||||||
@ -93,7 +93,7 @@ function Invoke-WPFFixesUpdate {
|
|||||||
) -join ''
|
) -join ''
|
||||||
).TrimStart()} catch {0}
|
).TrimStart()} catch {0}
|
||||||
) -and $percent -gt $oldpercent
|
) -and $percent -gt $oldpercent
|
||||||
){
|
) {
|
||||||
# Update the progress bar
|
# Update the progress bar
|
||||||
$oldpercent = $percent
|
$oldpercent = $percent
|
||||||
Write-Progress -Id 1 -ParentId 0 -Activity "Scanning for corruption" -Status "Running SFC... ($percent%)" -PercentComplete $percent
|
Write-Progress -Id 1 -ParentId 0 -Activity "Scanning for corruption" -Status "Running SFC... ($percent%)" -PercentComplete $percent
|
||||||
@ -112,7 +112,7 @@ function Invoke-WPFFixesUpdate {
|
|||||||
[int]($_ -replace "\[" -replace "=" -replace " " -replace "%" -replace "\]")
|
[int]($_ -replace "\[" -replace "=" -replace " " -replace "%" -replace "\]")
|
||||||
} catch {0}) `
|
} catch {0}) `
|
||||||
-and $percent -gt $oldpercent
|
-and $percent -gt $oldpercent
|
||||||
){
|
) {
|
||||||
# Update the progress bar
|
# Update the progress bar
|
||||||
$oldpercent = $percent
|
$oldpercent = $percent
|
||||||
Write-Progress -Id 1 -ParentId 0 -Activity "Scanning for corruption" -Status "Running DISM... ($percent%)" -PercentComplete $percent
|
Write-Progress -Id 1 -ParentId 0 -Activity "Scanning for corruption" -Status "Running DISM... ($percent%)" -PercentComplete $percent
|
||||||
@ -137,7 +137,7 @@ function Invoke-WPFFixesUpdate {
|
|||||||
) -join ''
|
) -join ''
|
||||||
).TrimStart()} catch {0}
|
).TrimStart()} catch {0}
|
||||||
) -and $percent -gt $oldpercent
|
) -and $percent -gt $oldpercent
|
||||||
){
|
) {
|
||||||
# Update the progress bar
|
# Update the progress bar
|
||||||
$oldpercent = $percent
|
$oldpercent = $percent
|
||||||
Write-Progress -Id 1 -ParentId 0 -Activity "Scanning for corruption" -Status "Running SFC... ($percent%)" -PercentComplete $percent
|
Write-Progress -Id 1 -ParentId 0 -Activity "Scanning for corruption" -Status "Running SFC... ($percent%)" -PercentComplete $percent
|
||||||
@ -289,4 +289,4 @@ function Invoke-WPFFixesUpdate {
|
|||||||
Write-Progress -Id 8 -Activity "Deleting BITS jobs" -Completed
|
Write-Progress -Id 8 -Activity "Deleting BITS jobs" -Completed
|
||||||
Write-Progress -Id 9 -Activity "Starting Windows Update Services" -Completed
|
Write-Progress -Id 9 -Activity "Starting Windows Update Services" -Completed
|
||||||
Write-Progress -Id 10 -Activity "Forcing discovery" -Completed
|
Write-Progress -Id 10 -Activity "Forcing discovery" -Completed
|
||||||
}
|
}
|
||||||
|
@ -11,4 +11,4 @@ function Invoke-WPFFixesWinget {
|
|||||||
Install-WinUtilChoco
|
Install-WinUtilChoco
|
||||||
Start-Process -FilePath "choco" -ArgumentList "install winget -y --force" -NoNewWindow -Wait
|
Start-Process -FilePath "choco" -ArgumentList "install winget -y --force" -NoNewWindow -Wait
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,13 +10,13 @@ function Invoke-WPFGetInstalled {
|
|||||||
#>
|
#>
|
||||||
param($checkbox)
|
param($checkbox)
|
||||||
|
|
||||||
if($sync.ProcessRunning){
|
if($sync.ProcessRunning) {
|
||||||
$msg = "[Invoke-WPFGetInstalled] Install process is currently running."
|
$msg = "[Invoke-WPFGetInstalled] Install process is currently running."
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if(((Test-WinUtilPackageManager -winget) -eq "not-installed") -and $checkbox -eq "winget"){
|
if(((Test-WinUtilPackageManager -winget) -eq "not-installed") -and $checkbox -eq "winget") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,17 +26,17 @@ function Invoke-WPFGetInstalled {
|
|||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" })
|
||||||
|
|
||||||
if($checkbox -eq "winget"){
|
if($checkbox -eq "winget") {
|
||||||
Write-Host "Getting Installed Programs..."
|
Write-Host "Getting Installed Programs..."
|
||||||
}
|
}
|
||||||
if($checkbox -eq "tweaks"){
|
if($checkbox -eq "tweaks") {
|
||||||
Write-Host "Getting Installed Tweaks..."
|
Write-Host "Getting Installed Tweaks..."
|
||||||
}
|
}
|
||||||
|
|
||||||
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox
|
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox
|
||||||
|
|
||||||
$sync.form.Dispatcher.invoke({
|
$sync.form.Dispatcher.invoke({
|
||||||
foreach($checkbox in $Checkboxes){
|
foreach($checkbox in $Checkboxes) {
|
||||||
$sync.$checkbox.ischecked = $True
|
$sync.$checkbox.ischecked = $True
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -6,7 +6,7 @@ function Invoke-WPFGetIso {
|
|||||||
|
|
||||||
Write-Host "Invoking WPFGetIso"
|
Write-Host "Invoking WPFGetIso"
|
||||||
|
|
||||||
if($sync.ProcessRunning){
|
if($sync.ProcessRunning) {
|
||||||
$msg = "GetIso process is currently running."
|
$msg = "GetIso process is currently running."
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
@ -18,22 +18,20 @@ function Invoke-WPFGetIso {
|
|||||||
|
|
||||||
|
|
||||||
Write-Host " _ __ __ _ "
|
Write-Host " _ __ __ _ "
|
||||||
Write-Host " /\/\ (_) ___ _ __ ___ / / /\ \ \(_) _ __ "
|
Write-Host " /\/\ (_) ___ _ __ ___ / / /\ \ \(_) _ __ "
|
||||||
Write-Host " / \ | | / __|| '__| / _ \ \ \/ \/ /| || '_ \ "
|
Write-Host " / \ | | / __|| '__| / _ \ \ \/ \/ /| || '_ \ "
|
||||||
Write-Host "/ /\/\ \| || (__ | | | (_) | \ /\ / | || | | | "
|
Write-Host "/ /\/\ \| || (__ | | | (_) | \ /\ / | || | | | "
|
||||||
Write-Host "\/ \/|_| \___||_| \___/ \/ \/ |_||_| |_| "
|
Write-Host "\/ \/|_| \___||_| \___/ \/ \/ |_||_| |_| "
|
||||||
|
|
||||||
$oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe'
|
$oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe'
|
||||||
$oscdImgFound = [bool] (Get-Command -ErrorAction Ignore -Type Application oscdimg.exe) -or (Test-Path $oscdimgPath -PathType Leaf)
|
$oscdImgFound = [bool] (Get-Command -ErrorAction Ignore -Type Application oscdimg.exe) -or (Test-Path $oscdimgPath -PathType Leaf)
|
||||||
Write-Host "oscdimg.exe on system: $oscdImgFound"
|
Write-Host "oscdimg.exe on system: $oscdImgFound"
|
||||||
|
|
||||||
if (!$oscdImgFound)
|
if (!$oscdImgFound) {
|
||||||
{
|
|
||||||
$downloadFromGitHub = $sync.WPFMicrowinDownloadFromGitHub.IsChecked
|
$downloadFromGitHub = $sync.WPFMicrowinDownloadFromGitHub.IsChecked
|
||||||
$sync.BusyMessage.Visibility="Hidden"
|
$sync.BusyMessage.Visibility="Hidden"
|
||||||
|
|
||||||
if (!$downloadFromGitHub)
|
if (!$downloadFromGitHub) {
|
||||||
{
|
|
||||||
# only show the message to people who did check the box to download from github, if you check the box
|
# only show the message to people who did check the box to download from github, if you check the box
|
||||||
# you consent to downloading it, no need to show extra dialogs
|
# you consent to downloading it, no need to show extra dialogs
|
||||||
[System.Windows.MessageBox]::Show("oscdimge.exe is not found on the system, winutil will now attempt do download and install it using choco. This might take a long time.")
|
[System.Windows.MessageBox]::Show("oscdimge.exe is not found on the system, winutil will now attempt do download and install it using choco. This might take a long time.")
|
||||||
@ -42,8 +40,7 @@ function Invoke-WPFGetIso {
|
|||||||
Install-WinUtilChoco
|
Install-WinUtilChoco
|
||||||
$chocoFound = [bool] (Get-Command -ErrorAction Ignore -Type Application choco)
|
$chocoFound = [bool] (Get-Command -ErrorAction Ignore -Type Application choco)
|
||||||
Write-Host "choco on system: $chocoFound"
|
Write-Host "choco on system: $chocoFound"
|
||||||
if (!$chocoFound)
|
if (!$chocoFound) {
|
||||||
{
|
|
||||||
[System.Windows.MessageBox]::Show("choco.exe is not found on the system, you need choco to download oscdimg.exe")
|
[System.Windows.MessageBox]::Show("choco.exe is not found on the system, you need choco to download oscdimg.exe")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -51,8 +48,7 @@ function Invoke-WPFGetIso {
|
|||||||
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install windows-adk-oscdimg"
|
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install windows-adk-oscdimg"
|
||||||
[System.Windows.MessageBox]::Show("oscdimg is installed, now close, reopen PowerShell terminal and re-launch winutil.ps1")
|
[System.Windows.MessageBox]::Show("oscdimg is installed, now close, reopen PowerShell terminal and re-launch winutil.ps1")
|
||||||
return
|
return
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
[System.Windows.MessageBox]::Show("oscdimge.exe is not found on the system, winutil will now attempt do download and install it from github. This might take a long time.")
|
[System.Windows.MessageBox]::Show("oscdimge.exe is not found on the system, winutil will now attempt do download and install it from github. This might take a long time.")
|
||||||
Get-Oscdimg -oscdimgPath $oscdimgPath
|
Get-Oscdimg -oscdimgPath $oscdimgPath
|
||||||
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
|
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
|
||||||
@ -60,8 +56,7 @@ function Invoke-WPFGetIso {
|
|||||||
$msg = "oscdimg was not downloaded can not proceed"
|
$msg = "oscdimg was not downloaded can not proceed"
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
|
||||||
return
|
return
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Write-Host "oscdimg.exe was successfully downloaded from github"
|
Write-Host "oscdimg.exe was successfully downloaded from github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,16 +69,14 @@ function Invoke-WPFGetIso {
|
|||||||
$openFileDialog.ShowDialog() | Out-Null
|
$openFileDialog.ShowDialog() | Out-Null
|
||||||
$filePath = $openFileDialog.FileName
|
$filePath = $openFileDialog.FileName
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($filePath))
|
if ([string]::IsNullOrEmpty($filePath)) {
|
||||||
{
|
|
||||||
Write-Host "No ISO is chosen"
|
Write-Host "No ISO is chosen"
|
||||||
$sync.BusyMessage.Visibility="Hidden"
|
$sync.BusyMessage.Visibility="Hidden"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "File path $($filePath)"
|
Write-Host "File path $($filePath)"
|
||||||
if (-not (Test-Path -Path $filePath -PathType Leaf))
|
if (-not (Test-Path -Path $filePath -PathType Leaf)) {
|
||||||
{
|
|
||||||
$msg = "File you've chosen doesn't exist"
|
$msg = "File you've chosen doesn't exist"
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
|
||||||
return
|
return
|
||||||
@ -98,20 +91,16 @@ function Invoke-WPFGetIso {
|
|||||||
# This is done to guarantee a dynamic solution, as the installation drive may be mounted to a letter different than C
|
# This is done to guarantee a dynamic solution, as the installation drive may be mounted to a letter different than C
|
||||||
$driveSpace = (Get-Volume -DriveLetter ([IO.Path]::GetPathRoot([Environment]::GetFolderPath([Environment+SpecialFolder]::UserProfile)).Replace(":\", "").Trim())).SizeRemaining
|
$driveSpace = (Get-Volume -DriveLetter ([IO.Path]::GetPathRoot([Environment]::GetFolderPath([Environment+SpecialFolder]::UserProfile)).Replace(":\", "").Trim())).SizeRemaining
|
||||||
Write-Debug "Free space on installation drive: $($driveSpace) bytes"
|
Write-Debug "Free space on installation drive: $($driveSpace) bytes"
|
||||||
if ($driveSpace -lt ($isoSize * 2))
|
if ($driveSpace -lt ($isoSize * 2)) {
|
||||||
{
|
|
||||||
# It's not critical and we _may_ continue. Output a warning
|
# It's not critical and we _may_ continue. Output a warning
|
||||||
Write-Warning "You may not have enough space for this operation. Proceed at your own risk."
|
Write-Warning "You may not have enough space for this operation. Proceed at your own risk."
|
||||||
}
|
}
|
||||||
elseif ($driveSpace -lt $isoSize)
|
elseif ($driveSpace -lt $isoSize) {
|
||||||
{
|
|
||||||
# It's critical and we can't continue. Output an error
|
# It's critical and we can't continue. Output an error
|
||||||
Write-Host "You don't have enough space for this operation. You need at least $([Math]::Round(($isoSize / ([Math]::Pow(1024, 2))) * 2, 2)) MB of free space to copy the ISO files to a temp directory and to be able to perform additional operations."
|
Write-Host "You don't have enough space for this operation. You need at least $([Math]::Round(($isoSize / ([Math]::Pow(1024, 2))) * 2, 2)) MB of free space to copy the ISO files to a temp directory and to be able to perform additional operations."
|
||||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||||
return
|
return
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
Write-Host "You have enough space for this operation."
|
Write-Host "You have enough space for this operation."
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,14 +140,12 @@ function Invoke-WPFGetIso {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Detect if the folders already exist and remove them
|
# Detect if the folders already exist and remove them
|
||||||
if (($sync.MicrowinMountDir.Text -ne "") -and (Test-Path -Path $sync.MicrowinMountDir.Text))
|
if (($sync.MicrowinMountDir.Text -ne "") -and (Test-Path -Path $sync.MicrowinMountDir.Text)) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
Write-Host "Deleting temporary files from previous run. Please wait..."
|
Write-Host "Deleting temporary files from previous run. Please wait..."
|
||||||
Remove-Item -Path $sync.MicrowinMountDir.Text -Recurse -Force
|
Remove-Item -Path $sync.MicrowinMountDir.Text -Recurse -Force
|
||||||
Remove-Item -Path $sync.MicrowinScratchDir.Text -Recurse -Force
|
Remove-Item -Path $sync.MicrowinScratchDir.Text -Recurse -Force
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Host "Could not delete temporary files. You need to delete those manually."
|
Write-Host "Could not delete temporary files. You need to delete those manually."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -199,16 +186,14 @@ function Invoke-WPFGetIso {
|
|||||||
$wimFile = "$mountDir\sources\install.wim"
|
$wimFile = "$mountDir\sources\install.wim"
|
||||||
Write-Host "Getting image information $wimFile"
|
Write-Host "Getting image information $wimFile"
|
||||||
|
|
||||||
if ((-not (Test-Path -Path $wimFile -PathType Leaf)) -and (-not (Test-Path -Path $wimFile.Replace(".wim", ".esd").Trim() -PathType Leaf)))
|
if ((-not (Test-Path -Path $wimFile -PathType Leaf)) -and (-not (Test-Path -Path $wimFile.Replace(".wim", ".esd").Trim() -PathType Leaf))) {
|
||||||
{
|
|
||||||
$msg = "Neither install.wim nor install.esd exist in the image, this could happen if you use unofficial Windows images. Please don't use shady images from the internet, use only official images. Here are instructions how to download ISO images if the Microsoft website is not showing the link to download and ISO. https://www.techrepublic.com/article/how-to-download-a-windows-10-iso-file-without-using-the-media-creation-tool/"
|
$msg = "Neither install.wim nor install.esd exist in the image, this could happen if you use unofficial Windows images. Please don't use shady images from the internet, use only official images. Here are instructions how to download ISO images if the Microsoft website is not showing the link to download and ISO. https://www.techrepublic.com/article/how-to-download-a-windows-10-iso-file-without-using-the-media-creation-tool/"
|
||||||
Write-Host $msg
|
Write-Host $msg
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
|
||||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||||
throw
|
throw
|
||||||
}
|
}
|
||||||
elseif ((-not (Test-Path -Path $wimFile -PathType Leaf)) -and (Test-Path -Path $wimFile.Replace(".wim", ".esd").Trim() -PathType Leaf))
|
elseif ((-not (Test-Path -Path $wimFile -PathType Leaf)) -and (Test-Path -Path $wimFile.Replace(".wim", ".esd").Trim() -PathType Leaf)) {
|
||||||
{
|
|
||||||
Write-Host "Install.esd found on the image. It needs to be converted to a WIM file in order to begin processing"
|
Write-Host "Install.esd found on the image. It needs to be converted to a WIM file in order to begin processing"
|
||||||
$wimFile = $wimFile.Replace(".wim", ".esd").Trim()
|
$wimFile = $wimFile.Replace(".wim", ".esd").Trim()
|
||||||
}
|
}
|
||||||
@ -221,8 +206,7 @@ function Invoke-WPFGetIso {
|
|||||||
$sync.MicrowinWindowsFlavors.SelectedIndex = 0
|
$sync.MicrowinWindowsFlavors.SelectedIndex = 0
|
||||||
Write-Host "Finding suitable Pro edition. This can take some time. Do note that this is an automatic process that might not select the edition you want."
|
Write-Host "Finding suitable Pro edition. This can take some time. Do note that this is an automatic process that might not select the edition you want."
|
||||||
Get-WindowsImage -ImagePath $wimFile | ForEach-Object {
|
Get-WindowsImage -ImagePath $wimFile | ForEach-Object {
|
||||||
if ((Get-WindowsImage -ImagePath $wimFile -Index $_.ImageIndex).EditionId -eq "Professional")
|
if ((Get-WindowsImage -ImagePath $wimFile -Index $_.ImageIndex).EditionId -eq "Professional") {
|
||||||
{
|
|
||||||
# We have found the Pro edition
|
# We have found the Pro edition
|
||||||
$sync.MicrowinWindowsFlavors.SelectedIndex = $_.ImageIndex - 1
|
$sync.MicrowinWindowsFlavors.SelectedIndex = $_.ImageIndex - 1
|
||||||
}
|
}
|
||||||
@ -247,5 +231,3 @@ function Invoke-WPFGetIso {
|
|||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
|
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,31 +19,30 @@ function Invoke-WPFImpex {
|
|||||||
$Config = $null
|
$Config = $null
|
||||||
)
|
)
|
||||||
|
|
||||||
if ($type -eq "export"){
|
if ($type -eq "export") {
|
||||||
$FileBrowser = New-Object System.Windows.Forms.SaveFileDialog
|
$FileBrowser = New-Object System.Windows.Forms.SaveFileDialog
|
||||||
}
|
}
|
||||||
if ($type -eq "import"){
|
if ($type -eq "import") {
|
||||||
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog
|
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not $Config){
|
if (-not $Config) {
|
||||||
$FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop')
|
$FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop')
|
||||||
$FileBrowser.Filter = "JSON Files (*.json)|*.json"
|
$FileBrowser.Filter = "JSON Files (*.json)|*.json"
|
||||||
$FileBrowser.ShowDialog() | Out-Null
|
$FileBrowser.ShowDialog() | Out-Null
|
||||||
|
|
||||||
if($FileBrowser.FileName -eq ""){
|
if($FileBrowser.FileName -eq "") {
|
||||||
return
|
return
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$Config = $FileBrowser.FileName
|
$Config = $FileBrowser.FileName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($type -eq "export"){
|
if ($type -eq "export") {
|
||||||
$jsonFile = Get-WinUtilCheckBoxes -unCheck $false
|
$jsonFile = Get-WinUtilCheckBoxes -unCheck $false
|
||||||
$jsonFile | ConvertTo-Json | Out-File $FileBrowser.FileName -Force
|
$jsonFile | ConvertTo-Json | Out-File $FileBrowser.FileName -Force
|
||||||
}
|
}
|
||||||
if ($type -eq "import"){
|
if ($type -eq "import") {
|
||||||
$jsonFile = Get-Content $Config | ConvertFrom-Json
|
$jsonFile = Get-Content $Config | ConvertFrom-Json
|
||||||
|
|
||||||
$flattenedJson = @()
|
$flattenedJson = @()
|
||||||
|
@ -6,7 +6,7 @@ function Invoke-WPFInstall {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
if($sync.ProcessRunning){
|
if($sync.ProcessRunning) {
|
||||||
$msg = "[Invoke-WPFInstall] An Install process is currently running."
|
$msg = "[Invoke-WPFInstall] An Install process is currently running."
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
@ -23,7 +23,7 @@ function Invoke-WPFInstall {
|
|||||||
|
|
||||||
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
|
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
param($PackagesToInstall, $DebugPreference)
|
param($PackagesToInstall, $DebugPreference)
|
||||||
if ($PackagesToInstall.count -eq 1){
|
if ($PackagesToInstall.count -eq 1) {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
||||||
} else {
|
} else {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
||||||
@ -43,15 +43,15 @@ function Invoke-WPFInstall {
|
|||||||
return $packagesWinget, $packagesChoco
|
return $packagesWinget, $packagesChoco
|
||||||
}.Invoke($PackagesToInstall)
|
}.Invoke($PackagesToInstall)
|
||||||
|
|
||||||
try{
|
try {
|
||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
$errorPackages = @()
|
$errorPackages = @()
|
||||||
if($packagesWinget.Count -gt 0){
|
if($packagesWinget.Count -gt 0) {
|
||||||
Install-WinUtilWinget
|
Install-WinUtilWinget
|
||||||
$errorPackages += Invoke-WinUtilWingetProgram -Action Install -Programs $packagesWinget
|
$errorPackages += Invoke-WinUtilWingetProgram -Action Install -Programs $packagesWinget
|
||||||
$errorPackages| ForEach-Object {if($_.choco -ne "na") {$packagesChoco += $_}}
|
$errorPackages| ForEach-Object {if($_.choco -ne "na") {$packagesChoco += $_}}
|
||||||
}
|
}
|
||||||
if($packagesChoco.Count -gt 0){
|
if($packagesChoco.Count -gt 0) {
|
||||||
Install-WinUtilChoco
|
Install-WinUtilChoco
|
||||||
Install-WinUtilProgramChoco -ProgramsToInstall $packagesChoco
|
Install-WinUtilProgramChoco -ProgramsToInstall $packagesChoco
|
||||||
}
|
}
|
||||||
@ -59,8 +59,7 @@ function Invoke-WPFInstall {
|
|||||||
Write-Host "-- Installs have finished ---"
|
Write-Host "-- Installs have finished ---"
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
|
||||||
}
|
} catch {
|
||||||
Catch {
|
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
Write-Host "Error: $_"
|
Write-Host "Error: $_"
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
|
@ -5,11 +5,11 @@ function Invoke-WPFInstallUpgrade {
|
|||||||
Invokes the function that upgrades all installed programs using winget
|
Invokes the function that upgrades all installed programs using winget
|
||||||
|
|
||||||
#>
|
#>
|
||||||
if((Test-WinUtilPackageManager -winget) -eq "not-installed"){
|
if((Test-WinUtilPackageManager -winget) -eq "not-installed") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Get-WinUtilInstallerProcess -Process $global:WinGetInstall){
|
if(Get-WinUtilInstallerProcess -Process $global:WinGetInstall) {
|
||||||
$msg = "[Invoke-WPFInstallUpgrade] Install process is currently running. Please check for a powershell window labeled 'Winget Install'"
|
$msg = "[Invoke-WPFInstallUpgrade] Install process is currently running. Please check for a powershell window labeled 'Winget Install'"
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
|
@ -5,32 +5,32 @@ function Invoke-WPFMicrowin {
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
|
|
||||||
if($sync.ProcessRunning) {
|
if($sync.ProcessRunning) {
|
||||||
$msg = "GetIso process is currently running."
|
$msg = "GetIso process is currently running."
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
# Define the constants for Windows API
|
# Define the constants for Windows API
|
||||||
Add-Type @"
|
Add-Type @"
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
public class PowerManagement {
|
public class PowerManagement {
|
||||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||||
public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
|
public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
|
||||||
|
|
||||||
[FlagsAttribute]
|
[FlagsAttribute]
|
||||||
public enum EXECUTION_STATE : uint {
|
public enum EXECUTION_STATE : uint {
|
||||||
ES_SYSTEM_REQUIRED = 0x00000001,
|
ES_SYSTEM_REQUIRED = 0x00000001,
|
||||||
ES_DISPLAY_REQUIRED = 0x00000002,
|
ES_DISPLAY_REQUIRED = 0x00000002,
|
||||||
ES_CONTINUOUS = 0x80000000,
|
ES_CONTINUOUS = 0x80000000,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"@
|
"@
|
||||||
|
|
||||||
# Prevent the machine from sleeping
|
# Prevent the machine from sleeping
|
||||||
[PowerManagement]::SetThreadExecutionState([PowerManagement]::EXECUTION_STATE::ES_CONTINUOUS -bor [PowerManagement]::EXECUTION_STATE::ES_SYSTEM_REQUIRED -bor [PowerManagement]::EXECUTION_STATE::ES_DISPLAY_REQUIRED)
|
[PowerManagement]::SetThreadExecutionState([PowerManagement]::EXECUTION_STATE::ES_CONTINUOUS -bor [PowerManagement]::EXECUTION_STATE::ES_SYSTEM_REQUIRED -bor [PowerManagement]::EXECUTION_STATE::ES_DISPLAY_REQUIRED)
|
||||||
|
|
||||||
# Ask the user where to save the file
|
# Ask the user where to save the file
|
||||||
$SaveDialog = New-Object System.Windows.Forms.SaveFileDialog
|
$SaveDialog = New-Object System.Windows.Forms.SaveFileDialog
|
||||||
@ -40,470 +40,429 @@ public class PowerManagement {
|
|||||||
|
|
||||||
if ($SaveDialog.FileName -eq "") {
|
if ($SaveDialog.FileName -eq "") {
|
||||||
Write-Host "No file name for the target image was specified"
|
Write-Host "No file name for the target image was specified"
|
||||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
|
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
|
||||||
|
|
||||||
Write-Host "Target ISO location: $($SaveDialog.FileName)"
|
Write-Host "Target ISO location: $($SaveDialog.FileName)"
|
||||||
|
|
||||||
$index = $sync.MicrowinWindowsFlavors.SelectedValue.Split(":")[0].Trim()
|
$index = $sync.MicrowinWindowsFlavors.SelectedValue.Split(":")[0].Trim()
|
||||||
Write-Host "Index chosen: '$index' from $($sync.MicrowinWindowsFlavors.SelectedValue)"
|
Write-Host "Index chosen: '$index' from $($sync.MicrowinWindowsFlavors.SelectedValue)"
|
||||||
|
|
||||||
$keepPackages = $sync.WPFMicrowinKeepProvisionedPackages.IsChecked
|
$keepPackages = $sync.WPFMicrowinKeepProvisionedPackages.IsChecked
|
||||||
$keepProvisionedPackages = $sync.WPFMicrowinKeepAppxPackages.IsChecked
|
$keepProvisionedPackages = $sync.WPFMicrowinKeepAppxPackages.IsChecked
|
||||||
$keepDefender = $sync.WPFMicrowinKeepDefender.IsChecked
|
$keepDefender = $sync.WPFMicrowinKeepDefender.IsChecked
|
||||||
$keepEdge = $sync.WPFMicrowinKeepEdge.IsChecked
|
$keepEdge = $sync.WPFMicrowinKeepEdge.IsChecked
|
||||||
$copyToUSB = $sync.WPFMicrowinCopyToUsb.IsChecked
|
$copyToUSB = $sync.WPFMicrowinCopyToUsb.IsChecked
|
||||||
$injectDrivers = $sync.MicrowinInjectDrivers.IsChecked
|
$injectDrivers = $sync.MicrowinInjectDrivers.IsChecked
|
||||||
$importDrivers = $sync.MicrowinImportDrivers.IsChecked
|
$importDrivers = $sync.MicrowinImportDrivers.IsChecked
|
||||||
|
|
||||||
$mountDir = $sync.MicrowinMountDir.Text
|
$mountDir = $sync.MicrowinMountDir.Text
|
||||||
$scratchDir = $sync.MicrowinScratchDir.Text
|
$scratchDir = $sync.MicrowinScratchDir.Text
|
||||||
|
|
||||||
# Detect if the Windows image is an ESD file and convert it to WIM
|
# Detect if the Windows image is an ESD file and convert it to WIM
|
||||||
if (-not (Test-Path -Path $mountDir\sources\install.wim -PathType Leaf) -and (Test-Path -Path $mountDir\sources\install.esd -PathType Leaf))
|
if (-not (Test-Path -Path $mountDir\sources\install.wim -PathType Leaf) -and (Test-Path -Path $mountDir\sources\install.esd -PathType Leaf)) {
|
||||||
{
|
Write-Host "Exporting Windows image to a WIM file, keeping the index we want to work on. This can take several minutes, depending on the performance of your computer..."
|
||||||
Write-Host "Exporting Windows image to a WIM file, keeping the index we want to work on. This can take several minutes, depending on the performance of your computer..."
|
Export-WindowsImage -SourceImagePath $mountDir\sources\install.esd -SourceIndex $index -DestinationImagePath $mountDir\sources\install.wim -CompressionType "Max"
|
||||||
Export-WindowsImage -SourceImagePath $mountDir\sources\install.esd -SourceIndex $index -DestinationImagePath $mountDir\sources\install.wim -CompressionType "Max"
|
if ($?) {
|
||||||
if ($?)
|
|
||||||
{
|
|
||||||
Remove-Item -Path $mountDir\sources\install.esd -Force
|
Remove-Item -Path $mountDir\sources\install.esd -Force
|
||||||
# Since we've already exported the image index we wanted, switch to the first one
|
# Since we've already exported the image index we wanted, switch to the first one
|
||||||
$index = 1
|
$index = 1
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$msg = "The export process has failed and MicroWin processing cannot continue"
|
$msg = "The export process has failed and MicroWin processing cannot continue"
|
||||||
Write-Host "Failed to export the image"
|
Write-Host "Failed to export the image"
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
|
||||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$imgVersion = (Get-WindowsImage -ImagePath $mountDir\sources\install.wim -Index $index).Version
|
$imgVersion = (Get-WindowsImage -ImagePath $mountDir\sources\install.wim -Index $index).Version
|
||||||
|
|
||||||
# Detect image version to avoid performing MicroWin processing on Windows 8 and earlier
|
# Detect image version to avoid performing MicroWin processing on Windows 8 and earlier
|
||||||
if ((Test-CompatibleImage $imgVersion $([System.Version]::new(10,0,10240,0))) -eq $false)
|
if ((Test-CompatibleImage $imgVersion $([System.Version]::new(10,0,10240,0))) -eq $false) {
|
||||||
{
|
$msg = "This image is not compatible with MicroWin processing. Make sure it isn't a Windows 8 or earlier image."
|
||||||
$msg = "This image is not compatible with MicroWin processing. Make sure it isn't a Windows 8 or earlier image."
|
|
||||||
$dlg_msg = $msg + "`n`nIf you want more information, the version of the image selected is $($imgVersion)`n`nIf an image has been incorrectly marked as incompatible, report an issue to the developers."
|
$dlg_msg = $msg + "`n`nIf you want more information, the version of the image selected is $($imgVersion)`n`nIf an image has been incorrectly marked as incompatible, report an issue to the developers."
|
||||||
Write-Host $msg
|
Write-Host $msg
|
||||||
[System.Windows.MessageBox]::Show($dlg_msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Exclamation)
|
[System.Windows.MessageBox]::Show($dlg_msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Exclamation)
|
||||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
$mountDirExists = Test-Path $mountDir
|
$mountDirExists = Test-Path $mountDir
|
||||||
$scratchDirExists = Test-Path $scratchDir
|
$scratchDirExists = Test-Path $scratchDir
|
||||||
if (-not $mountDirExists -or -not $scratchDirExists)
|
if (-not $mountDirExists -or -not $scratchDirExists) {
|
||||||
{
|
|
||||||
Write-Error "Required directories '$mountDirExists' '$scratchDirExists' and do not exist."
|
Write-Error "Required directories '$mountDirExists' '$scratchDirExists' and do not exist."
|
||||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Write-Host "Mounting Windows image. This may take a while."
|
Write-Host "Mounting Windows image. This may take a while."
|
||||||
Mount-WindowsImage -ImagePath "$mountDir\sources\install.wim" -Index $index -Path "$scratchDir"
|
Mount-WindowsImage -ImagePath "$mountDir\sources\install.wim" -Index $index -Path "$scratchDir"
|
||||||
if ($?)
|
if ($?) {
|
||||||
{
|
Write-Host "Mounting complete! Performing removal of applications..."
|
||||||
Write-Host "Mounting complete! Performing removal of applications..."
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Write-Host "Could not mount image. Exiting..."
|
Write-Host "Could not mount image. Exiting..."
|
||||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($importDrivers)
|
if ($importDrivers) {
|
||||||
{
|
Write-Host "Exporting drivers from active installation..."
|
||||||
Write-Host "Exporting drivers from active installation..."
|
if (Test-Path "$env:TEMP\DRV_EXPORT") {
|
||||||
if (Test-Path "$env:TEMP\DRV_EXPORT")
|
Remove-Item "$env:TEMP\DRV_EXPORT" -Recurse -Force
|
||||||
{
|
}
|
||||||
Remove-Item "$env:TEMP\DRV_EXPORT" -Recurse -Force
|
if (($injectDrivers -and (Test-Path $sync.MicrowinDriverLocation.Text))) {
|
||||||
}
|
Write-Host "Using specified driver source..."
|
||||||
if (($injectDrivers -and (Test-Path $sync.MicrowinDriverLocation.Text)))
|
dism /english /online /export-driver /destination="$($sync.MicrowinDriverLocation.Text)" | Out-Host
|
||||||
{
|
if ($?) {
|
||||||
Write-Host "Using specified driver source..."
|
# Don't add exported drivers yet, that is run later
|
||||||
dism /english /online /export-driver /destination="$($sync.MicrowinDriverLocation.Text)" | Out-Host
|
Write-Host "Drivers have been exported successfully."
|
||||||
if ($?)
|
} else {
|
||||||
{
|
Write-Host "Failed to export drivers."
|
||||||
# Don't add exported drivers yet, that is run later
|
}
|
||||||
Write-Host "Drivers have been exported successfully."
|
} else {
|
||||||
}
|
New-Item -Path "$env:TEMP\DRV_EXPORT" -ItemType Directory -Force
|
||||||
else
|
dism /english /online /export-driver /destination="$env:TEMP\DRV_EXPORT" | Out-Host
|
||||||
{
|
if ($?) {
|
||||||
Write-Host "Failed to export drivers."
|
Write-Host "Adding exported drivers..."
|
||||||
}
|
dism /english /image="$scratchDir" /add-driver /driver="$env:TEMP\DRV_EXPORT" /recurse | Out-Host
|
||||||
}
|
} else {
|
||||||
else
|
Write-Host "Failed to export drivers. Continuing without importing them..."
|
||||||
{
|
}
|
||||||
New-Item -Path "$env:TEMP\DRV_EXPORT" -ItemType Directory -Force
|
if (Test-Path "$env:TEMP\DRV_EXPORT") {
|
||||||
dism /english /online /export-driver /destination="$env:TEMP\DRV_EXPORT" | Out-Host
|
Remove-Item "$env:TEMP\DRV_EXPORT" -Recurse -Force
|
||||||
if ($?)
|
}
|
||||||
{
|
}
|
||||||
Write-Host "Adding exported drivers..."
|
}
|
||||||
dism /english /image="$scratchDir" /add-driver /driver="$env:TEMP\DRV_EXPORT" /recurse | Out-Host
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Write-Host "Failed to export drivers. Continuing without importing them..."
|
|
||||||
}
|
|
||||||
if (Test-Path "$env:TEMP\DRV_EXPORT")
|
|
||||||
{
|
|
||||||
Remove-Item "$env:TEMP\DRV_EXPORT" -Recurse -Force
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($injectDrivers)
|
if ($injectDrivers) {
|
||||||
{
|
$driverPath = $sync.MicrowinDriverLocation.Text
|
||||||
$driverPath = $sync.MicrowinDriverLocation.Text
|
if (Test-Path $driverPath) {
|
||||||
if (Test-Path $driverPath)
|
Write-Host "Adding Windows Drivers image($scratchDir) drivers($driverPath) "
|
||||||
{
|
dism /English /image:$scratchDir /add-driver /driver:$driverPath /recurse | Out-Host
|
||||||
Write-Host "Adding Windows Drivers image($scratchDir) drivers($driverPath) "
|
} else {
|
||||||
dism /English /image:$scratchDir /add-driver /driver:$driverPath /recurse | Out-Host
|
Write-Host "Path to drivers is invalid continuing without driver injection"
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
|
||||||
Write-Host "Path to drivers is invalid continuing without driver injection"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Remove Features from the image"
|
Write-Host "Remove Features from the image"
|
||||||
Remove-Features -keepDefender:$keepDefender
|
Remove-Features -keepDefender:$keepDefender
|
||||||
Write-Host "Removing features complete!"
|
Write-Host "Removing features complete!"
|
||||||
|
|
||||||
if (!$keepPackages)
|
if (!$keepPackages) {
|
||||||
{
|
Write-Host "Removing OS packages"
|
||||||
Write-Host "Removing OS packages"
|
Remove-Packages
|
||||||
Remove-Packages
|
}
|
||||||
}
|
if (!$keepProvisionedPackages) {
|
||||||
if (!$keepProvisionedPackages)
|
Write-Host "Removing Appx Bloat"
|
||||||
{
|
Remove-ProvisionedPackages -keepSecurity:$keepDefender
|
||||||
Write-Host "Removing Appx Bloat"
|
}
|
||||||
Remove-ProvisionedPackages -keepSecurity:$keepDefender
|
|
||||||
}
|
|
||||||
|
|
||||||
# special code, for some reason when you try to delete some inbox apps
|
# special code, for some reason when you try to delete some inbox apps
|
||||||
# we have to get and delete log files directory.
|
# we have to get and delete log files directory.
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\LogFiles\WMI\RtBackup" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\LogFiles\WMI\RtBackup" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\WebThreatDefSvc" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\WebThreatDefSvc" -Directory
|
||||||
|
|
||||||
# Defender is hidden in 2 places we removed a feature above now need to remove it from the disk
|
# Defender is hidden in 2 places we removed a feature above now need to remove it from the disk
|
||||||
if (!$keepDefender)
|
if (!$keepDefender) {
|
||||||
{
|
Write-Host "Removing Defender"
|
||||||
Write-Host "Removing Defender"
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Defender" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Defender" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Defender"
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Defender"
|
}
|
||||||
}
|
if (!$keepEdge) {
|
||||||
if (!$keepEdge)
|
Write-Host "Removing Edge"
|
||||||
{
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Microsoft" -mask "*edge*" -Directory
|
||||||
Write-Host "Removing Edge"
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Microsoft" -mask "*edge*" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Microsoft" -mask "*edge*" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*edge*" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Microsoft" -mask "*edge*" -Directory
|
}
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*edge*" -Directory
|
|
||||||
}
|
|
||||||
|
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\DiagTrack" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\DiagTrack" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\InboxApps" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\InboxApps" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\SecurityHealthSystray.exe"
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\SecurityHealthSystray.exe"
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\LocationNotificationWindows.exe"
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\LocationNotificationWindows.exe"
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Photo Viewer" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Photo Viewer" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Photo Viewer" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Photo Viewer" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Media Player" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Media Player" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Media Player" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Media Player" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Mail" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Mail" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Mail" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Mail" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Internet Explorer" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Internet Explorer" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Internet Explorer" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Internet Explorer" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\GameBarPresenceWriter"
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\GameBarPresenceWriter"
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\OneDriveSetup.exe"
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\OneDriveSetup.exe"
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\OneDrive.ico"
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\OneDrive.ico"
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*Windows.Search*" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*Windows.Search*" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*narratorquickstart*" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*narratorquickstart*" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*Xbox*" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*Xbox*" -Directory
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*ParentalControls*" -Directory
|
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*ParentalControls*" -Directory
|
||||||
Write-Host "Removal complete!"
|
Write-Host "Removal complete!"
|
||||||
|
|
||||||
Write-Host "Create unattend.xml"
|
Write-Host "Create unattend.xml"
|
||||||
New-Unattend
|
New-Unattend
|
||||||
Write-Host "Done Create unattend.xml"
|
Write-Host "Done Create unattend.xml"
|
||||||
Write-Host "Copy unattend.xml file into the ISO"
|
Write-Host "Copy unattend.xml file into the ISO"
|
||||||
New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\Panther"
|
New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\Panther"
|
||||||
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\Windows\Panther\unattend.xml" -force
|
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\Windows\Panther\unattend.xml" -force
|
||||||
New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\System32\Sysprep"
|
New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\System32\Sysprep"
|
||||||
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\Windows\System32\Sysprep\unattend.xml" -force
|
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\Windows\System32\Sysprep\unattend.xml" -force
|
||||||
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\unattend.xml" -force
|
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\unattend.xml" -force
|
||||||
Write-Host "Done Copy unattend.xml"
|
Write-Host "Done Copy unattend.xml"
|
||||||
|
|
||||||
Write-Host "Create FirstRun"
|
Write-Host "Create FirstRun"
|
||||||
New-FirstRun
|
New-FirstRun
|
||||||
Write-Host "Done create FirstRun"
|
Write-Host "Done create FirstRun"
|
||||||
Write-Host "Copy FirstRun.ps1 into the ISO"
|
Write-Host "Copy FirstRun.ps1 into the ISO"
|
||||||
Copy-Item "$env:temp\FirstStartup.ps1" "$($scratchDir)\Windows\FirstStartup.ps1" -force
|
Copy-Item "$env:temp\FirstStartup.ps1" "$($scratchDir)\Windows\FirstStartup.ps1" -force
|
||||||
Write-Host "Done copy FirstRun.ps1"
|
Write-Host "Done copy FirstRun.ps1"
|
||||||
|
|
||||||
Write-Host "Copy link to winutil.ps1 into the ISO"
|
Write-Host "Copy link to winutil.ps1 into the ISO"
|
||||||
$desktopDir = "$($scratchDir)\Windows\Users\Default\Desktop"
|
$desktopDir = "$($scratchDir)\Windows\Users\Default\Desktop"
|
||||||
New-Item -ItemType Directory -Force -Path "$desktopDir"
|
New-Item -ItemType Directory -Force -Path "$desktopDir"
|
||||||
dism /English /image:$($scratchDir) /set-profilepath:"$($scratchDir)\Windows\Users\Default"
|
dism /English /image:$($scratchDir) /set-profilepath:"$($scratchDir)\Windows\Users\Default"
|
||||||
|
|
||||||
# $command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'irm https://christitus.com/win | iex'"
|
# $command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'irm https://christitus.com/win | iex'"
|
||||||
# $shortcutPath = "$desktopDir\WinUtil.lnk"
|
# $shortcutPath = "$desktopDir\WinUtil.lnk"
|
||||||
# $shell = New-Object -ComObject WScript.Shell
|
# $shell = New-Object -ComObject WScript.Shell
|
||||||
# $shortcut = $shell.CreateShortcut($shortcutPath)
|
# $shortcut = $shell.CreateShortcut($shortcutPath)
|
||||||
|
|
||||||
# if (Test-Path -Path "$env:TEMP\cttlogo.png")
|
# if (Test-Path -Path "$env:TEMP\cttlogo.png")
|
||||||
# {
|
# {
|
||||||
# $pngPath = "$env:TEMP\cttlogo.png"
|
# $pngPath = "$env:TEMP\cttlogo.png"
|
||||||
# $icoPath = "$env:TEMP\cttlogo.ico"
|
# $icoPath = "$env:TEMP\cttlogo.ico"
|
||||||
# ConvertTo-Icon -bitmapPath $pngPath -iconPath $icoPath
|
# ConvertTo-Icon -bitmapPath $pngPath -iconPath $icoPath
|
||||||
# Write-Host "ICO file created at: $icoPath"
|
# Write-Host "ICO file created at: $icoPath"
|
||||||
# Copy-Item "$env:TEMP\cttlogo.png" "$($scratchDir)\Windows\cttlogo.png" -force
|
# Copy-Item "$env:TEMP\cttlogo.png" "$($scratchDir)\Windows\cttlogo.png" -force
|
||||||
# Copy-Item "$env:TEMP\cttlogo.ico" "$($scratchDir)\Windows\cttlogo.ico" -force
|
# Copy-Item "$env:TEMP\cttlogo.ico" "$($scratchDir)\Windows\cttlogo.ico" -force
|
||||||
# $shortcut.IconLocation = "c:\Windows\cttlogo.ico"
|
# $shortcut.IconLocation = "c:\Windows\cttlogo.ico"
|
||||||
# }
|
# }
|
||||||
|
|
||||||
# $shortcut.TargetPath = "powershell.exe"
|
# $shortcut.TargetPath = "powershell.exe"
|
||||||
# $shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -Command `"$command`""
|
# $shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -Command `"$command`""
|
||||||
# $shortcut.Save()
|
# $shortcut.Save()
|
||||||
# Write-Host "Shortcut to winutil created at: $shortcutPath"
|
# Write-Host "Shortcut to winutil created at: $shortcutPath"
|
||||||
# *************************** Automation black ***************************
|
# *************************** Automation black ***************************
|
||||||
|
|
||||||
Write-Host "Copy checkinstall.cmd into the ISO"
|
Write-Host "Copy checkinstall.cmd into the ISO"
|
||||||
New-CheckInstall
|
New-CheckInstall
|
||||||
Copy-Item "$env:temp\checkinstall.cmd" "$($scratchDir)\Windows\checkinstall.cmd" -force
|
Copy-Item "$env:temp\checkinstall.cmd" "$($scratchDir)\Windows\checkinstall.cmd" -force
|
||||||
Write-Host "Done copy checkinstall.cmd"
|
Write-Host "Done copy checkinstall.cmd"
|
||||||
|
|
||||||
Write-Host "Creating a directory that allows to bypass Wifi setup"
|
Write-Host "Creating a directory that allows to bypass Wifi setup"
|
||||||
New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\System32\OOBE\BYPASSNRO"
|
New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\System32\OOBE\BYPASSNRO"
|
||||||
|
|
||||||
Write-Host "Loading registry"
|
Write-Host "Loading registry"
|
||||||
reg load HKLM\zCOMPONENTS "$($scratchDir)\Windows\System32\config\COMPONENTS"
|
reg load HKLM\zCOMPONENTS "$($scratchDir)\Windows\System32\config\COMPONENTS"
|
||||||
reg load HKLM\zDEFAULT "$($scratchDir)\Windows\System32\config\default"
|
reg load HKLM\zDEFAULT "$($scratchDir)\Windows\System32\config\default"
|
||||||
reg load HKLM\zNTUSER "$($scratchDir)\Users\Default\ntuser.dat"
|
reg load HKLM\zNTUSER "$($scratchDir)\Users\Default\ntuser.dat"
|
||||||
reg load HKLM\zSOFTWARE "$($scratchDir)\Windows\System32\config\SOFTWARE"
|
reg load HKLM\zSOFTWARE "$($scratchDir)\Windows\System32\config\SOFTWARE"
|
||||||
reg load HKLM\zSYSTEM "$($scratchDir)\Windows\System32\config\SYSTEM"
|
reg load HKLM\zSYSTEM "$($scratchDir)\Windows\System32\config\SYSTEM"
|
||||||
|
|
||||||
Write-Host "Disabling Teams"
|
Write-Host "Disabling Teams"
|
||||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v "ConfigureChatAutoInstall" /t REG_DWORD /d 0 /f >$null 2>&1
|
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v "ConfigureChatAutoInstall" /t REG_DWORD /d 0 /f >$null 2>&1
|
||||||
reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat" /v ChatIcon /t REG_DWORD /d 2 /f >$null 2>&1
|
reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat" /v ChatIcon /t REG_DWORD /d 2 /f >$null 2>&1
|
||||||
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d 0 /f >$null 2>&1
|
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d 0 /f >$null 2>&1
|
||||||
reg query "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v "ConfigureChatAutoInstall" >$null 2>&1
|
reg query "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v "ConfigureChatAutoInstall" >$null 2>&1
|
||||||
# Write-Host Error code $LASTEXITCODE
|
# Write-Host Error code $LASTEXITCODE
|
||||||
Write-Host "Done disabling Teams"
|
Write-Host "Done disabling Teams"
|
||||||
|
|
||||||
Write-Host "Bypassing system requirements (system image)"
|
Write-Host "Bypassing system requirements (system image)"
|
||||||
reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d 1 /f
|
||||||
|
|
||||||
if (!$keepEdge)
|
if (!$keepEdge) {
|
||||||
{
|
Write-Host "Removing Edge icon from taskbar"
|
||||||
Write-Host "Removing Edge icon from taskbar"
|
reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "Favorites" /f >$null 2>&1
|
||||||
reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "Favorites" /f >$null 2>&1
|
reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "FavoritesChanges" /f >$null 2>&1
|
||||||
reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "FavoritesChanges" /f >$null 2>&1
|
reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "Pinned" /f >$null 2>&1
|
||||||
reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "Pinned" /f >$null 2>&1
|
reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "LayoutCycle" /f >$null 2>&1
|
||||||
reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "LayoutCycle" /f >$null 2>&1
|
Write-Host "Edge icon removed from taskbar"
|
||||||
Write-Host "Edge icon removed from taskbar"
|
if (Test-Path "HKLM:\zSOFTWARE\WOW6432Node") {
|
||||||
if (Test-Path "HKLM:\zSOFTWARE\WOW6432Node")
|
# Remove leftovers of 64-bit installations
|
||||||
{
|
# ---
|
||||||
# Remove leftovers of 64-bit installations
|
# Remove registry values first...
|
||||||
# ---
|
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" /va /f > $null 2>&1
|
||||||
# Remove registry values first...
|
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" /va /f > $null 2>&1
|
||||||
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" /va /f > $null 2>&1
|
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" /va /f > $null 2>&1
|
||||||
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" /va /f > $null 2>&1
|
# ...then the registry keys
|
||||||
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" /va /f > $null 2>&1
|
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" /f > $null 2>&1
|
||||||
# ...then the registry keys
|
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" /f > $null 2>&1
|
||||||
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" /f > $null 2>&1
|
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" /f > $null 2>&1
|
||||||
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" /f > $null 2>&1
|
}
|
||||||
reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" /f > $null 2>&1
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f
|
||||||
Write-Host "Setting all services to start manually"
|
Write-Host "Setting all services to start manually"
|
||||||
reg add "HKLM\zSOFTWARE\CurrentControlSet\Services" /v Start /t REG_DWORD /d 3 /f
|
reg add "HKLM\zSOFTWARE\CurrentControlSet\Services" /v Start /t REG_DWORD /d 3 /f
|
||||||
# Write-Host $LASTEXITCODE
|
# Write-Host $LASTEXITCODE
|
||||||
|
|
||||||
Write-Host "Enabling Local Accounts on OOBE"
|
Write-Host "Enabling Local Accounts on OOBE"
|
||||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v "BypassNRO" /t REG_DWORD /d "1" /f
|
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v "BypassNRO" /t REG_DWORD /d "1" /f
|
||||||
|
|
||||||
Write-Host "Disabling Sponsored Apps"
|
Write-Host "Disabling Sponsored Apps"
|
||||||
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "OemPreInstalledAppsEnabled" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "OemPreInstalledAppsEnabled" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "PreInstalledAppsEnabled" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "PreInstalledAppsEnabled" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKLM\zSOFTWARE\Microsoft\PolicyManager\current\device\Start" /v "ConfigureStartPins" /t REG_SZ /d '{\"pinnedList\": [{}]}' /f
|
reg add "HKLM\zSOFTWARE\Microsoft\PolicyManager\current\device\Start" /v "ConfigureStartPins" /t REG_SZ /d '{\"pinnedList\": [{}]}' /f
|
||||||
Write-Host "Done removing Sponsored Apps"
|
Write-Host "Done removing Sponsored Apps"
|
||||||
|
|
||||||
Write-Host "Disabling Reserved Storage"
|
Write-Host "Disabling Reserved Storage"
|
||||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" /v "ShippedWithReserves" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" /v "ShippedWithReserves" /t REG_DWORD /d 0 /f
|
||||||
|
|
||||||
Write-Host "Changing theme to dark. This only works on Activated Windows"
|
Write-Host "Changing theme to dark. This only works on Activated Windows"
|
||||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "AppsUseLightTheme" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "AppsUseLightTheme" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "SystemUsesLightTheme" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "SystemUsesLightTheme" /t REG_DWORD /d 0 /f
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
Write-Error "An unexpected error occurred: $_"
|
Write-Error "An unexpected error occurred: $_"
|
||||||
} finally {
|
} finally {
|
||||||
Write-Host "Unmounting Registry..."
|
Write-Host "Unmounting Registry..."
|
||||||
reg unload HKLM\zCOMPONENTS
|
reg unload HKLM\zCOMPONENTS
|
||||||
reg unload HKLM\zDEFAULT
|
reg unload HKLM\zDEFAULT
|
||||||
reg unload HKLM\zNTUSER
|
reg unload HKLM\zNTUSER
|
||||||
reg unload HKLM\zSOFTWARE
|
reg unload HKLM\zSOFTWARE
|
||||||
reg unload HKLM\zSYSTEM
|
reg unload HKLM\zSYSTEM
|
||||||
|
|
||||||
Write-Host "Cleaning up image..."
|
Write-Host "Cleaning up image..."
|
||||||
dism /English /image:$scratchDir /Cleanup-Image /StartComponentCleanup /ResetBase
|
dism /English /image:$scratchDir /Cleanup-Image /StartComponentCleanup /ResetBase
|
||||||
Write-Host "Cleanup complete."
|
Write-Host "Cleanup complete."
|
||||||
|
|
||||||
Write-Host "Unmounting image..."
|
Write-Host "Unmounting image..."
|
||||||
Dismount-WindowsImage -Path $scratchDir -Save
|
Dismount-WindowsImage -Path $scratchDir -Save
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Write-Host "Exporting image into $mountDir\sources\install2.wim"
|
Write-Host "Exporting image into $mountDir\sources\install2.wim"
|
||||||
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.wim" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install2.wim" -CompressionType "Max"
|
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.wim" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install2.wim" -CompressionType "Max"
|
||||||
Write-Host "Remove old '$mountDir\sources\install.wim' and rename $mountDir\sources\install2.wim"
|
Write-Host "Remove old '$mountDir\sources\install.wim' and rename $mountDir\sources\install2.wim"
|
||||||
Remove-Item "$mountDir\sources\install.wim"
|
Remove-Item "$mountDir\sources\install.wim"
|
||||||
Rename-Item "$mountDir\sources\install2.wim" "$mountDir\sources\install.wim"
|
Rename-Item "$mountDir\sources\install2.wim" "$mountDir\sources\install.wim"
|
||||||
|
|
||||||
if (-not (Test-Path -Path "$mountDir\sources\install.wim"))
|
if (-not (Test-Path -Path "$mountDir\sources\install.wim")) {
|
||||||
{
|
Write-Error "Something went wrong and '$mountDir\sources\install.wim' doesn't exist. Please report this bug to the devs"
|
||||||
Write-Error "Something went wrong and '$mountDir\sources\install.wim' doesn't exist. Please report this bug to the devs"
|
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
return
|
||||||
return
|
}
|
||||||
}
|
Write-Host "Windows image completed. Continuing with boot.wim."
|
||||||
Write-Host "Windows image completed. Continuing with boot.wim."
|
|
||||||
|
|
||||||
# Next step boot image
|
# Next step boot image
|
||||||
Write-Host "Mounting boot image $mountDir\sources\boot.wim into $scratchDir"
|
Write-Host "Mounting boot image $mountDir\sources\boot.wim into $scratchDir"
|
||||||
Mount-WindowsImage -ImagePath "$mountDir\sources\boot.wim" -Index 2 -Path "$scratchDir"
|
Mount-WindowsImage -ImagePath "$mountDir\sources\boot.wim" -Index 2 -Path "$scratchDir"
|
||||||
|
|
||||||
if ($injectDrivers)
|
if ($injectDrivers) {
|
||||||
{
|
$driverPath = $sync.MicrowinDriverLocation.Text
|
||||||
$driverPath = $sync.MicrowinDriverLocation.Text
|
if (Test-Path $driverPath) {
|
||||||
if (Test-Path $driverPath)
|
Write-Host "Adding Windows Drivers image($scratchDir) drivers($driverPath) "
|
||||||
{
|
dism /English /image:$scratchDir /add-driver /driver:$driverPath /recurse | Out-Host
|
||||||
Write-Host "Adding Windows Drivers image($scratchDir) drivers($driverPath) "
|
} else {
|
||||||
dism /English /image:$scratchDir /add-driver /driver:$driverPath /recurse | Out-Host
|
Write-Host "Path to drivers is invalid continuing without driver injection"
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
|
||||||
Write-Host "Path to drivers is invalid continuing without driver injection"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Loading registry..."
|
Write-Host "Loading registry..."
|
||||||
reg load HKLM\zCOMPONENTS "$($scratchDir)\Windows\System32\config\COMPONENTS" >$null
|
reg load HKLM\zCOMPONENTS "$($scratchDir)\Windows\System32\config\COMPONENTS" >$null
|
||||||
reg load HKLM\zDEFAULT "$($scratchDir)\Windows\System32\config\default" >$null
|
reg load HKLM\zDEFAULT "$($scratchDir)\Windows\System32\config\default" >$null
|
||||||
reg load HKLM\zNTUSER "$($scratchDir)\Users\Default\ntuser.dat" >$null
|
reg load HKLM\zNTUSER "$($scratchDir)\Users\Default\ntuser.dat" >$null
|
||||||
reg load HKLM\zSOFTWARE "$($scratchDir)\Windows\System32\config\SOFTWARE" >$null
|
reg load HKLM\zSOFTWARE "$($scratchDir)\Windows\System32\config\SOFTWARE" >$null
|
||||||
reg load HKLM\zSYSTEM "$($scratchDir)\Windows\System32\config\SYSTEM" >$null
|
reg load HKLM\zSYSTEM "$($scratchDir)\Windows\System32\config\SYSTEM" >$null
|
||||||
Write-Host "Bypassing system requirements on the setup image"
|
Write-Host "Bypassing system requirements on the setup image"
|
||||||
reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d 1 /f
|
reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d 1 /f
|
||||||
# Fix Computer Restarted Unexpectedly Error on New Bare Metal Install
|
# Fix Computer Restarted Unexpectedly Error on New Bare Metal Install
|
||||||
reg add "HKLM\zSYSTEM\Setup\Status\ChildCompletion" /v "setup.exe" /t REG_DWORD /d 3 /f
|
reg add "HKLM\zSYSTEM\Setup\Status\ChildCompletion" /v "setup.exe" /t REG_DWORD /d 3 /f
|
||||||
} catch {
|
} catch {
|
||||||
Write-Error "An unexpected error occurred: $_"
|
Write-Error "An unexpected error occurred: $_"
|
||||||
} finally {
|
} finally {
|
||||||
Write-Host "Unmounting Registry..."
|
Write-Host "Unmounting Registry..."
|
||||||
reg unload HKLM\zCOMPONENTS
|
reg unload HKLM\zCOMPONENTS
|
||||||
reg unload HKLM\zDEFAULT
|
reg unload HKLM\zDEFAULT
|
||||||
reg unload HKLM\zNTUSER
|
reg unload HKLM\zNTUSER
|
||||||
reg unload HKLM\zSOFTWARE
|
reg unload HKLM\zSOFTWARE
|
||||||
reg unload HKLM\zSYSTEM
|
reg unload HKLM\zSYSTEM
|
||||||
|
|
||||||
Write-Host "Unmounting image..."
|
Write-Host "Unmounting image..."
|
||||||
Dismount-WindowsImage -Path $scratchDir -Save
|
Dismount-WindowsImage -Path $scratchDir -Save
|
||||||
|
|
||||||
Write-Host "Creating ISO image"
|
Write-Host "Creating ISO image"
|
||||||
|
|
||||||
# if we downloaded oscdimg from github it will be in the temp directory so use it
|
# if we downloaded oscdimg from github it will be in the temp directory so use it
|
||||||
# if it is not in temp it is part of ADK and is in global PATH so just set it to oscdimg.exe
|
# if it is not in temp it is part of ADK and is in global PATH so just set it to oscdimg.exe
|
||||||
$oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe'
|
$oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe'
|
||||||
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
|
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
|
||||||
if (!$oscdImgFound)
|
if (!$oscdImgFound) {
|
||||||
{
|
$oscdimgPath = "oscdimg.exe"
|
||||||
$oscdimgPath = "oscdimg.exe"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "[INFO] Using oscdimg.exe from: $oscdimgPath"
|
Write-Host "[INFO] Using oscdimg.exe from: $oscdimgPath"
|
||||||
|
|
||||||
$oscdimgProc = Start-Process -FilePath "$oscdimgPath" -ArgumentList "-m -o -u2 -udfver102 -bootdata:2#p0,e,b$mountDir\boot\etfsboot.com#pEF,e,b$mountDir\efi\microsoft\boot\efisys.bin `"$mountDir`" `"$($SaveDialog.FileName)`"" -Wait -PassThru -NoNewWindow
|
|
||||||
|
|
||||||
$LASTEXITCODE = $oscdimgProc.ExitCode
|
|
||||||
|
|
||||||
Write-Host "OSCDIMG Error Level : $($oscdimgProc.ExitCode)"
|
|
||||||
|
|
||||||
if ($copyToUSB)
|
$oscdimgProc = Start-Process -FilePath "$oscdimgPath" -ArgumentList "-m -o -u2 -udfver102 -bootdata:2#p0,e,b$mountDir\boot\etfsboot.com#pEF,e,b$mountDir\efi\microsoft\boot\efisys.bin `"$mountDir`" `"$($SaveDialog.FileName)`"" -Wait -PassThru -NoNewWindow
|
||||||
{
|
|
||||||
Write-Host "Copying target ISO to the USB drive"
|
|
||||||
Copy-ToUSB("$($SaveDialog.FileName)")
|
|
||||||
if ($?) { Write-Host "Done Copying target ISO to USB drive!" } else { Write-Host "ISO copy failed." }
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host " _____ "
|
$LASTEXITCODE = $oscdimgProc.ExitCode
|
||||||
Write-Host "(____ \ "
|
|
||||||
Write-Host " _ \ \ ___ ____ ____ "
|
|
||||||
Write-Host "| | | / _ \| _ \ / _ ) "
|
|
||||||
Write-Host "| |__/ / |_| | | | ( (/ / "
|
|
||||||
Write-Host "|_____/ \___/|_| |_|\____) "
|
|
||||||
|
|
||||||
# Check if the ISO was successfully created - CTT edit
|
Write-Host "OSCDIMG Error Level : $($oscdimgProc.ExitCode)"
|
||||||
if ($LASTEXITCODE -eq 0) {
|
|
||||||
Write-Host "`n`nPerforming Cleanup..."
|
|
||||||
Remove-Item -Recurse -Force "$($scratchDir)"
|
|
||||||
Remove-Item -Recurse -Force "$($mountDir)"
|
|
||||||
$msg = "Done. ISO image is located here: $($SaveDialog.FileName)"
|
|
||||||
Write-Host $msg
|
|
||||||
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
|
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Information)
|
|
||||||
} else {
|
|
||||||
Write-Host "ISO creation failed. The "$($mountDir)" directory has not been removed."
|
|
||||||
try
|
|
||||||
{
|
|
||||||
# This creates a new Win32 exception from which we can extract a message in the system language.
|
|
||||||
# Now, this will NOT throw an exception
|
|
||||||
$exitCode = New-Object System.ComponentModel.Win32Exception($LASTEXITCODE)
|
|
||||||
Write-Host "Reason: $($exitCode.Message)"
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
# Could not get error description from Windows APIs
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$sync.MicrowinOptionsPanel.Visibility = 'Collapsed'
|
if ($copyToUSB) {
|
||||||
|
Write-Host "Copying target ISO to the USB drive"
|
||||||
|
Copy-ToUSB("$($SaveDialog.FileName)")
|
||||||
|
if ($?) { Write-Host "Done Copying target ISO to USB drive!" } else { Write-Host "ISO copy failed." }
|
||||||
|
}
|
||||||
|
|
||||||
#$sync.MicrowinFinalIsoLocation.Text = "$env:temp\microwin.iso"
|
Write-Host " _____ "
|
||||||
|
Write-Host "(____ \ "
|
||||||
|
Write-Host " _ \ \ ___ ____ ____ "
|
||||||
|
Write-Host "| | | / _ \| _ \ / _ ) "
|
||||||
|
Write-Host "| |__/ / |_| | | | ( (/ / "
|
||||||
|
Write-Host "|_____/ \___/|_| |_|\____) "
|
||||||
|
|
||||||
|
# Check if the ISO was successfully created - CTT edit
|
||||||
|
if ($LASTEXITCODE -eq 0) {
|
||||||
|
Write-Host "`n`nPerforming Cleanup..."
|
||||||
|
Remove-Item -Recurse -Force "$($scratchDir)"
|
||||||
|
Remove-Item -Recurse -Force "$($mountDir)"
|
||||||
|
$msg = "Done. ISO image is located here: $($SaveDialog.FileName)"
|
||||||
|
Write-Host $msg
|
||||||
|
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
|
||||||
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Information)
|
||||||
|
} else {
|
||||||
|
Write-Host "ISO creation failed. The "$($mountDir)" directory has not been removed."
|
||||||
|
try {
|
||||||
|
# This creates a new Win32 exception from which we can extract a message in the system language.
|
||||||
|
# Now, this will NOT throw an exception
|
||||||
|
$exitCode = New-Object System.ComponentModel.Win32Exception($LASTEXITCODE)
|
||||||
|
Write-Host "Reason: $($exitCode.Message)"
|
||||||
|
} catch {
|
||||||
|
# Could not get error description from Windows APIs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sync.MicrowinOptionsPanel.Visibility = 'Collapsed'
|
||||||
|
|
||||||
|
#$sync.MicrowinFinalIsoLocation.Text = "$env:temp\microwin.iso"
|
||||||
$sync.MicrowinFinalIsoLocation.Text = "$($SaveDialog.FileName)"
|
$sync.MicrowinFinalIsoLocation.Text = "$($SaveDialog.FileName)"
|
||||||
# Allow the machine to sleep again (optional)
|
# Allow the machine to sleep again (optional)
|
||||||
[PowerManagement]::SetThreadExecutionState(0)
|
[PowerManagement]::SetThreadExecutionState(0)
|
||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,10 @@ function Invoke-WPFOOSU {
|
|||||||
Invoke-WebRequest -Uri "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" -OutFile $OOSU_filepath
|
Invoke-WebRequest -Uri "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" -OutFile $OOSU_filepath
|
||||||
Write-Host "Starting OO Shutup 10 ..."
|
Write-Host "Starting OO Shutup 10 ..."
|
||||||
Start-Process $OOSU_filepath
|
Start-Process $OOSU_filepath
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Host "Error Downloading and Running OO Shutup 10" -ForegroundColor Red
|
Write-Host "Error Downloading and Running OO Shutup 10" -ForegroundColor Red
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
$ProgressPreference = $Initial_ProgressPreference
|
$ProgressPreference = $Initial_ProgressPreference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,4 +27,4 @@ function Invoke-WPFPanelDISM {
|
|||||||
Write-Host '`n(3/4) DISM' -ForegroundColor Green; DISM /Online /Cleanup-Image /Restorehealth;
|
Write-Host '`n(3/4) DISM' -ForegroundColor Green; DISM /Online /Cleanup-Image /Restorehealth;
|
||||||
Write-Host '`n(4/4) SFC - 2nd scan' -ForegroundColor Green; sfc /scannow;
|
Write-Host '`n(4/4) SFC - 2nd scan' -ForegroundColor Green; sfc /scannow;
|
||||||
Read-Host '`nPress Enter to Continue'" -verb runas
|
Read-Host '`nPress Enter to Continue'" -verb runas
|
||||||
}
|
}
|
||||||
|
@ -20,10 +20,9 @@ function Invoke-WPFPresets {
|
|||||||
[bool]$imported = $false
|
[bool]$imported = $false
|
||||||
)
|
)
|
||||||
|
|
||||||
if($imported -eq $true){
|
if($imported -eq $true) {
|
||||||
$CheckBoxesToCheck = $preset
|
$CheckBoxesToCheck = $preset
|
||||||
}
|
} else {
|
||||||
Else{
|
|
||||||
$CheckBoxesToCheck = $sync.configs.preset.$preset
|
$CheckBoxesToCheck = $sync.configs.preset.$preset
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,8 +38,7 @@ function Invoke-WPFPresets {
|
|||||||
foreach ($CheckBox in $CheckBoxes) {
|
foreach ($CheckBox in $CheckBoxes) {
|
||||||
$checkboxName = $CheckBox.Key
|
$checkboxName = $CheckBox.Key
|
||||||
|
|
||||||
if (-not $CheckBoxesToCheck)
|
if (-not $CheckBoxesToCheck) {
|
||||||
{
|
|
||||||
$sync.$checkboxName.IsChecked = $false
|
$sync.$checkboxName.IsChecked = $false
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -38,12 +38,11 @@ function Invoke-WPFRunspace {
|
|||||||
$script:handle = $script:powershell.BeginInvoke()
|
$script:handle = $script:powershell.BeginInvoke()
|
||||||
|
|
||||||
# Clean up the RunspacePool threads when they are complete, and invoke the garbage collector to clean up the memory
|
# Clean up the RunspacePool threads when they are complete, and invoke the garbage collector to clean up the memory
|
||||||
if ($script:handle.IsCompleted)
|
if ($script:handle.IsCompleted) {
|
||||||
{
|
|
||||||
$script:powershell.EndInvoke($script:handle)
|
$script:powershell.EndInvoke($script:handle)
|
||||||
$script:powershell.Dispose()
|
$script:powershell.Dispose()
|
||||||
$sync.runspace.Dispose()
|
$sync.runspace.Dispose()
|
||||||
$sync.runspace.Close()
|
$sync.runspace.Close()
|
||||||
[System.GC]::Collect()
|
[System.GC]::Collect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
function Invoke-WPFShortcut {
|
function Invoke-WPFShortcut {
|
||||||
<#
|
<#
|
||||||
|
|
||||||
@ -22,17 +21,15 @@ function Invoke-WPFShortcut {
|
|||||||
Switch ($ShortcutToAdd) {
|
Switch ($ShortcutToAdd) {
|
||||||
"WinUtil" {
|
"WinUtil" {
|
||||||
# Use Powershell 7 if installed and fallback to PS5 if not
|
# Use Powershell 7 if installed and fallback to PS5 if not
|
||||||
if (Get-Command "pwsh" -ErrorAction SilentlyContinue){
|
if (Get-Command "pwsh" -ErrorAction SilentlyContinue) {
|
||||||
$shell = "pwsh.exe"
|
$shell = "pwsh.exe"
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$shell = "powershell.exe"
|
$shell = "powershell.exe"
|
||||||
}
|
}
|
||||||
|
|
||||||
$shellArgs = "-ExecutionPolicy Bypass -Command `"Start-Process $shell -verb runas -ArgumentList `'-Command `"irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1 | iex`"`'"
|
$shellArgs = "-ExecutionPolicy Bypass -Command `"Start-Process $shell -verb runas -ArgumentList `'-Command `"irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1 | iex`"`'"
|
||||||
|
|
||||||
$DestinationName = "WinUtil.lnk"
|
$DestinationName = "WinUtil.lnk"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,8 +49,8 @@ function Invoke-WPFShortcut {
|
|||||||
# Prepare the Shortcut paramter
|
# Prepare the Shortcut paramter
|
||||||
$WshShell = New-Object -comObject WScript.Shell
|
$WshShell = New-Object -comObject WScript.Shell
|
||||||
$Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName)
|
$Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName)
|
||||||
$Shortcut.TargetPath = $SourceExe
|
$Shortcut.TargetPath = $shell
|
||||||
$Shortcut.Arguments = $ArgumentsToSourceExe
|
$Shortcut.Arguments = $shellArgs
|
||||||
if (Test-Path -Path $winutildir["logo.ico"]) {
|
if (Test-Path -Path $winutildir["logo.ico"]) {
|
||||||
$shortcut.IconLocation = $winutildir["logo.ico"]
|
$shortcut.IconLocation = $winutildir["logo.ico"]
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,7 @@ function Invoke-WPFTab {
|
|||||||
$sync[$PSItem.Name].IsChecked = $false
|
$sync[$PSItem.Name].IsChecked = $false
|
||||||
# $tabNumber = [int]($PSItem.Name -replace "WPFTab","" -replace "BT","") - 1
|
# $tabNumber = [int]($PSItem.Name -replace "WPFTab","" -replace "BT","") - 1
|
||||||
# $sync.$tabNav.Items[$tabNumber].IsSelected = $false
|
# $sync.$tabNav.Items[$tabNumber].IsSelected = $false
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$sync["$ClickedTab"].IsChecked = $true
|
$sync["$ClickedTab"].IsChecked = $true
|
||||||
$tabNumber = [int]($ClickedTab-replace "WPFTab","" -replace "BT","") - 1
|
$tabNumber = [int]($ClickedTab-replace "WPFTab","" -replace "BT","") - 1
|
||||||
$sync.$tabNav.Items[$tabNumber].IsSelected = $true
|
$sync.$tabNav.Items[$tabNumber].IsSelected = $true
|
||||||
|
@ -17,7 +17,7 @@ function Invoke-WPFToggle {
|
|||||||
|
|
||||||
$ToggleStatus = (Get-WinUtilToggleStatus $Button)
|
$ToggleStatus = (Get-WinUtilToggleStatus $Button)
|
||||||
|
|
||||||
Switch -Wildcard ($Button){
|
Switch -Wildcard ($Button) {
|
||||||
|
|
||||||
"WPFToggleDarkMode" {Invoke-WinUtilDarkMode $ToggleStatus}
|
"WPFToggleDarkMode" {Invoke-WinUtilDarkMode $ToggleStatus}
|
||||||
"WPFToggleBingSearch" {Invoke-WinUtilBingSearch $ToggleStatus}
|
"WPFToggleBingSearch" {Invoke-WinUtilBingSearch $ToggleStatus}
|
||||||
|
@ -26,13 +26,13 @@ function Invoke-WPFTweakPS7{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Check if the Windows Terminal is installed and return if not (Prerequisite for the following code)
|
# Check if the Windows Terminal is installed and return if not (Prerequisite for the following code)
|
||||||
if (-not (Get-Command "wt" -ErrorAction SilentlyContinue)){
|
if (-not (Get-Command "wt" -ErrorAction SilentlyContinue)) {
|
||||||
Write-Host "Windows Terminal not installed. Skipping Terminal preference"
|
Write-Host "Windows Terminal not installed. Skipping Terminal preference"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
# Check if the Windows Terminal settings.json file exists and return if not (Prereqisite for the following code)
|
# Check if the Windows Terminal settings.json file exists and return if not (Prereqisite for the following code)
|
||||||
$settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"
|
$settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"
|
||||||
if (-not (Test-Path -Path $settingsPath)){
|
if (-not (Test-Path -Path $settingsPath)) {
|
||||||
Write-Host "Windows Terminal Settings file not found at $settingsPath"
|
Write-Host "Windows Terminal Settings file not found at $settingsPath"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -9,10 +9,10 @@ Function Invoke-WPFUltimatePerformance {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
param($State)
|
param($State)
|
||||||
Try{
|
try {
|
||||||
# Check if Ultimate Performance plan is installed
|
# Check if Ultimate Performance plan is installed
|
||||||
$ultimatePlan = powercfg -list | Select-String -Pattern "Ultimate Performance"
|
$ultimatePlan = powercfg -list | Select-String -Pattern "Ultimate Performance"
|
||||||
if($state -eq "Enable"){
|
if($state -eq "Enable") {
|
||||||
if ($ultimatePlan) {
|
if ($ultimatePlan) {
|
||||||
Write-Host "Ultimate Performance plan is already installed."
|
Write-Host "Ultimate Performance plan is already installed."
|
||||||
} else {
|
} else {
|
||||||
@ -29,7 +29,7 @@ Function Invoke-WPFUltimatePerformance {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif($state -eq "Disable"){
|
elseif($state -eq "Disable") {
|
||||||
if ($ultimatePlan) {
|
if ($ultimatePlan) {
|
||||||
# Extract the GUID of the Ultimate Performance plan
|
# Extract the GUID of the Ultimate Performance plan
|
||||||
$ultimatePlanGUID = $ultimatePlan.Line.Split()[3]
|
$ultimatePlanGUID = $ultimatePlan.Line.Split()[3]
|
||||||
@ -47,7 +47,7 @@ Function Invoke-WPFUltimatePerformance {
|
|||||||
Write-Host "Ultimate Performance plan is not installed."
|
Write-Host "Ultimate Performance plan is not installed."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} Catch{
|
} catch {
|
||||||
Write-Warning $psitem.Exception.Message
|
Write-Warning $psitem.Exception.Message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ function Invoke-WPFUnInstall {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
if($sync.ProcessRunning){
|
if($sync.ProcessRunning) {
|
||||||
$msg = "[Invoke-WPFUnInstall] Install process is currently running"
|
$msg = "[Invoke-WPFUnInstall] Install process is currently running"
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
@ -27,12 +27,12 @@ function Invoke-WPFUnInstall {
|
|||||||
|
|
||||||
$confirm = [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
$confirm = [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||||
|
|
||||||
if($confirm -eq "No"){return}
|
if($confirm -eq "No") {return}
|
||||||
|
|
||||||
|
|
||||||
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
|
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
param($PackagesToInstall, $DebugPreference)
|
param($PackagesToInstall, $DebugPreference)
|
||||||
if ($PackagesToInstall.count -eq 1){
|
if ($PackagesToInstall.count -eq 1) {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
||||||
} else {
|
} else {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
||||||
@ -51,14 +51,14 @@ function Invoke-WPFUnInstall {
|
|||||||
}
|
}
|
||||||
return $packagesWinget, $packagesChoco
|
return $packagesWinget, $packagesChoco
|
||||||
}.Invoke($PackagesToInstall)
|
}.Invoke($PackagesToInstall)
|
||||||
try{
|
try {
|
||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
|
|
||||||
# Install all selected programs in new window
|
# Install all selected programs in new window
|
||||||
if($packagesWinget.Count -gt 0){
|
if($packagesWinget.Count -gt 0) {
|
||||||
Invoke-WinUtilWingetProgram -Action Uninstall -Programs $packagesWinget
|
Invoke-WinUtilWingetProgram -Action Uninstall -Programs $packagesWinget
|
||||||
}
|
}
|
||||||
if($packagesChoco.Count -gt 0){
|
if($packagesChoco.Count -gt 0) {
|
||||||
Install-WinUtilProgramChoco -ProgramsToInstall $packagesChoco -Manage "Uninstalling"
|
Install-WinUtilProgramChoco -ProgramsToInstall $packagesChoco -Manage "Uninstalling"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,8 +66,7 @@ function Invoke-WPFUnInstall {
|
|||||||
Write-Host "-- Uninstalls have finished ---"
|
Write-Host "-- Uninstalls have finished ---"
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
|
||||||
}
|
} catch {
|
||||||
Catch {
|
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
Write-Host "Error: $_"
|
Write-Host "Error: $_"
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
|
@ -42,4 +42,4 @@ function Invoke-WPFUpdatesdefault {
|
|||||||
Write-Host "==================================================="
|
Write-Host "==================================================="
|
||||||
Write-Host "--- Windows Update Settings Reset to Default ---"
|
Write-Host "--- Windows Update Settings Reset to Default ---"
|
||||||
Write-Host "==================================================="
|
Write-Host "==================================================="
|
||||||
}
|
}
|
||||||
|
@ -32,4 +32,4 @@ function Invoke-WPFUpdatesdisable {
|
|||||||
Write-Host "================================="
|
Write-Host "================================="
|
||||||
Write-Host "--- Updates ARE DISABLED ---"
|
Write-Host "--- Updates ARE DISABLED ---"
|
||||||
Write-Host "================================="
|
Write-Host "================================="
|
||||||
}
|
}
|
||||||
|
@ -50,4 +50,4 @@ function Invoke-WPFUpdatessecurity {
|
|||||||
Write-Host "================================="
|
Write-Host "================================="
|
||||||
Write-Host "-- Updates Set to Recommended ---"
|
Write-Host "-- Updates Set to Recommended ---"
|
||||||
Write-Host "================================="
|
Write-Host "================================="
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ function Invoke-WPFtweaksbutton {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
if($sync.ProcessRunning){
|
if($sync.ProcessRunning) {
|
||||||
$msg = "[Invoke-WPFtweaksbutton] Install process is currently running."
|
$msg = "[Invoke-WPFtweaksbutton] Install process is currently running."
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
@ -16,7 +16,7 @@ function Invoke-WPFtweaksbutton {
|
|||||||
|
|
||||||
Set-WinUtilDNS -DNSProvider $sync["WPFchangedns"].text
|
Set-WinUtilDNS -DNSProvider $sync["WPFchangedns"].text
|
||||||
|
|
||||||
if ($tweaks.count -eq 0 -and $sync["WPFchangedns"].text -eq "Default"){
|
if ($tweaks.count -eq 0 -and $sync["WPFchangedns"].text -eq "Default") {
|
||||||
$msg = "Please check the tweaks you wish to perform."
|
$msg = "Please check the tweaks you wish to perform."
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
@ -30,17 +30,16 @@ function Invoke-WPFtweaksbutton {
|
|||||||
|
|
||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
|
|
||||||
if ($Tweaks.count -eq 1){
|
if ($Tweaks.count -eq 1) {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
||||||
} else {
|
} else {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
||||||
}
|
}
|
||||||
# Execute other selected tweaks
|
# Execute other selected tweaks
|
||||||
|
|
||||||
for ($i = 0; $i -lt $Tweaks.Count; $i++){
|
for ($i = 0; $i -lt $Tweaks.Count; $i++) {
|
||||||
Set-WinUtilProgressBar -Label "Applying $($tweaks[$i])" -Percent ($i / $Tweaks.Count * 100)
|
Set-WinUtilProgressBar -Label "Applying $($tweaks[$i])" -Percent ($i / $Tweaks.Count * 100)
|
||||||
Invoke-WinUtilTweaks $tweaks[$i]
|
Invoke-WinUtilTweaks $tweaks[$i]$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($i/$Tweaks.Count) })
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($i/$Tweaks.Count) })
|
|
||||||
}
|
}
|
||||||
Set-WinUtilProgressBar -Label "Tweaks finished" -Percent 100
|
Set-WinUtilProgressBar -Label "Tweaks finished" -Percent 100
|
||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
@ -55,4 +54,4 @@ function Invoke-WPFtweaksbutton {
|
|||||||
# $MessageIcon = [System.Windows.MessageBoxImage]::Information
|
# $MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||||
# [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
# [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ function Invoke-WPFundoall {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
if($sync.ProcessRunning){
|
if($sync.ProcessRunning) {
|
||||||
$msg = "[Invoke-WPFundoall] Install process is currently running."
|
$msg = "[Invoke-WPFundoall] Install process is currently running."
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
@ -14,7 +14,7 @@ function Invoke-WPFundoall {
|
|||||||
|
|
||||||
$tweaks = (Get-WinUtilCheckBoxes)["WPFtweaks"]
|
$tweaks = (Get-WinUtilCheckBoxes)["WPFtweaks"]
|
||||||
|
|
||||||
if ($tweaks.count -eq 0){
|
if ($tweaks.count -eq 0) {
|
||||||
$msg = "Please check the tweaks you wish to undo."
|
$msg = "Please check the tweaks you wish to undo."
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
@ -24,14 +24,14 @@ function Invoke-WPFundoall {
|
|||||||
param($tweaks, $DebugPreference)
|
param($tweaks, $DebugPreference)
|
||||||
|
|
||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
if ($tweaks.count -eq 1){
|
if ($tweaks.count -eq 1) {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
||||||
} else {
|
} else {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for ($i = 0; $i -lt $tweaks.Count; $i++){
|
|
||||||
|
for ($i = 0; $i -lt $tweaks.Count; $i++) {
|
||||||
Set-WinUtilProgressBar -Label "Undoing $($tweaks[$i])" -Percent ($i / $tweaks.Count * 100)
|
Set-WinUtilProgressBar -Label "Undoing $($tweaks[$i])" -Percent ($i / $tweaks.Count * 100)
|
||||||
Invoke-WinUtiltweaks $tweaks[$i] -undo $true
|
Invoke-WinUtiltweaks $tweaks[$i] -undo $true
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($i/$tweaks.Count) })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($i/$tweaks.Count) })
|
||||||
@ -39,10 +39,10 @@ function Invoke-WPFundoall {
|
|||||||
|
|
||||||
Set-WinUtilProgressBar -Label "Undo Tweaks Finished" -Percent 100
|
Set-WinUtilProgressBar -Label "Undo Tweaks Finished" -Percent 100
|
||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
|
||||||
Write-Host "=================================="
|
Write-Host "=================================="
|
||||||
Write-Host "--- Undo Tweaks are Finished ---"
|
Write-Host "--- Undo Tweaks are Finished ---"
|
||||||
Write-Host "=================================="
|
Write-Host "=================================="
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Get-ChildItem @(
|
Get-ChildItem @(
|
||||||
"$env:SystemRoot\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package*.mum",
|
"$env:SystemRoot\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package*.mum",
|
||||||
"$env:SystemRoot\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package*.mum"
|
"$env:SystemRoot\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package*.mum"
|
||||||
) | ForEach-Object { dism.exe /online /norestart /add-package:"$_" }
|
) | ForEach-Object { dism.exe /online /norestart /add-package:"$_" }
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user