mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-01 02:22:34 -05:00
Compare commits
182 Commits
admin-elev
...
24.12.06
Author | SHA1 | Date | |
---|---|---|---|
1d0e3bfd5c | |||
83450aef7b | |||
e2ce998426 | |||
cf7f161a06 | |||
d6c1fbe4a2 | |||
0779dd9096 | |||
d48f212be4 | |||
9c52f01204 | |||
d49b21f881 | |||
39ee4d53c0 | |||
6e708bfe95 | |||
e2b9586b0d | |||
c418fe9030 | |||
d619ee7e85 | |||
bbc18b2d4b | |||
9778c0d572 | |||
8087a607fc | |||
e5b79559bd | |||
66e6aa7e96 | |||
def47fe018 | |||
b382f16ae8 | |||
171441ddcf | |||
7a0c40420e | |||
0f0d9d0ae3 | |||
6149738e6c | |||
aa0b03feda | |||
e0889d51db | |||
ce1ef2a519 | |||
77cb0a14c4 | |||
c254a43f77 | |||
640d2ca107 | |||
c186642998 | |||
47a4f1547e | |||
1caf3111d3 | |||
7dcdc4dbb7 | |||
bfaba14191 | |||
5640f9d04c | |||
c6a832b006 | |||
fe19094395 | |||
fdd32f441f | |||
e4565f1f6f | |||
1404efab26 | |||
1deb863f40 | |||
de73efa868 | |||
59097fc7e1 | |||
207ce43428 | |||
d92284ec83 | |||
d855b08119 | |||
0deac4ebb2 | |||
c6fcf21dce | |||
64ed00c2db | |||
e165388117 | |||
806cbd021a | |||
869071783c | |||
ae74965548 | |||
b43d31088c | |||
4fa1b0ddc7 | |||
f012064574 | |||
db26666f97 | |||
38cf922572 | |||
dd337be45e | |||
3670c78789 | |||
225e774f1e | |||
0703935bfb | |||
fd2ac35228 | |||
f516c09ab3 | |||
182fe09b64 | |||
02751c706d | |||
102231c0e3 | |||
b9d7619f9b | |||
4e39096b51 | |||
662139ca5f | |||
42febae25e | |||
395ac9495d | |||
6cc7d314fe | |||
ba45c3303e | |||
1f683d3f78 | |||
18dff2af5e | |||
377758758e | |||
3f2759f967 | |||
1ee7274bdb | |||
06baebc60b | |||
10917c159c | |||
0251757fc0 | |||
9136ed9802 | |||
b3bbe0dbe5 | |||
16b11e994b | |||
a5a06c2a9b | |||
81aead7a68 | |||
a55a44a54c | |||
9c0b0b8913 | |||
7fe0f9a163 | |||
8e5fcceddb | |||
19a3c7070a | |||
343a72f528 | |||
0b13ca4b11 | |||
215de06a58 | |||
80555d945e | |||
314588283a | |||
00668755c9 | |||
d3ef94f175 | |||
1ac24c236e | |||
ff363d686f | |||
9abe11c975 | |||
14d20cd161 | |||
2b9b1b026c | |||
e9a45a002f | |||
6d996495a3 | |||
473f04ddc5 | |||
95db85f791 | |||
5059b93cd7 | |||
380e1e73a6 | |||
ad37371492 | |||
1bfd8bddcc | |||
6ad31edef1 | |||
c1009c3d7c | |||
885108df7e | |||
b21bc35443 | |||
e2d539048d | |||
588008612d | |||
859a733740 | |||
3bb1881254 | |||
8b37420eec | |||
af7528a60b | |||
0c6b2adb91 | |||
0635145896 | |||
2d751f4e8c | |||
9b9d0c58f5 | |||
531cb4c63c | |||
42bda0dc47 | |||
3414a3eee1 | |||
a4302742b3 | |||
2a0d121cf0 | |||
a397f20ac6 | |||
bddf57bcee | |||
2b3f1a811d | |||
2af864f7ab | |||
2b8592a50a | |||
aad0356c28 | |||
01515db90f | |||
2ba5572b6c | |||
7e1c593510 | |||
b6141808af | |||
a21845327b | |||
2a355c00c8 | |||
2d3dbe4f6a | |||
d315963693 | |||
6c82adbdc9 | |||
c1dd88d84a | |||
b67ec35cbb | |||
c45f36d58f | |||
1fc79bccf2 | |||
2b7d0b6c4b | |||
42061faa81 | |||
889ec8f57d | |||
be6b5b3aa0 | |||
90ddfb02a4 | |||
ece57f8ee2 | |||
6a99be9e05 | |||
488cd8dd98 | |||
7eed393902 | |||
97876348d9 | |||
f8db21bbee | |||
3697be1be4 | |||
51068d9670 | |||
46f827fe2f | |||
f6b238ec30 | |||
cc157f6976 | |||
9ae5092e29 | |||
c741e006eb | |||
322d527a0c | |||
99aff2aefc | |||
cfb9edbce7 | |||
bcfbce66fd | |||
2748767a47 | |||
83fe6c5b12 | |||
2ea708eeb0 | |||
11d3c66fc0 | |||
3dd51a6c3c | |||
307980a7ef | |||
93c96fafd2 | |||
4d2ea15e19 |
128
.github/CODE_OF_CONDUCT.md
vendored
Normal file
128
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
|
community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||||
|
identity and expression, level of experience, education, socio-economic status,
|
||||||
|
nationality, personal appearance, race, religion, or sexual identity
|
||||||
|
and orientation.
|
||||||
|
|
||||||
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to a positive environment for our
|
||||||
|
community include:
|
||||||
|
|
||||||
|
* Demonstrating empathy and kindness toward other people
|
||||||
|
* Being respectful of differing opinions, viewpoints, and experiences
|
||||||
|
* Giving and gracefully accepting constructive feedback
|
||||||
|
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
|
and learning from the experience
|
||||||
|
* Focusing on what is best not just for us as individuals, but for the
|
||||||
|
overall community
|
||||||
|
|
||||||
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery, and sexual attention or
|
||||||
|
advances of any kind
|
||||||
|
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or email
|
||||||
|
address, without their explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
Community leaders are responsible for clarifying and enforcing our standards of
|
||||||
|
acceptable behavior and will take appropriate and fair corrective action in
|
||||||
|
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||||
|
or harmful.
|
||||||
|
|
||||||
|
Community leaders have the right and responsibility to remove, edit, or reject
|
||||||
|
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||||
|
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||||
|
decisions when appropriate.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
|
an individual is officially representing the community in public spaces.
|
||||||
|
Examples of representing our community include using an official e-mail address,
|
||||||
|
posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported to the community leaders responsible for enforcement at
|
||||||
|
contact@christitus.com.
|
||||||
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
reporter of any incident.
|
||||||
|
|
||||||
|
## Enforcement Guidelines
|
||||||
|
|
||||||
|
Community leaders will follow these Community Impact Guidelines in determining
|
||||||
|
the consequences for any action they deem in violation of this Code of Conduct:
|
||||||
|
|
||||||
|
### 1. Correction
|
||||||
|
|
||||||
|
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||||
|
unprofessional or unwelcome in the community.
|
||||||
|
|
||||||
|
**Consequence**: A private, written warning from community leaders, providing
|
||||||
|
clarity around the nature of the violation and an explanation of why the
|
||||||
|
behavior was inappropriate. A public apology may be requested.
|
||||||
|
|
||||||
|
### 2. Warning
|
||||||
|
|
||||||
|
**Community Impact**: A violation through a single incident or series
|
||||||
|
of actions.
|
||||||
|
|
||||||
|
**Consequence**: A warning with consequences for continued behavior. No
|
||||||
|
interaction with the people involved, including unsolicited interaction with
|
||||||
|
those enforcing the Code of Conduct, for a specified period of time. This
|
||||||
|
includes avoiding interactions in community spaces as well as external channels
|
||||||
|
like social media. Violating these terms may lead to a temporary or
|
||||||
|
permanent ban.
|
||||||
|
|
||||||
|
### 3. Temporary Ban
|
||||||
|
|
||||||
|
**Community Impact**: A serious violation of community standards, including
|
||||||
|
sustained inappropriate behavior.
|
||||||
|
|
||||||
|
**Consequence**: A temporary ban from any sort of interaction or public
|
||||||
|
communication with the community for a specified period of time. No public or
|
||||||
|
private interaction with the people involved, including unsolicited interaction
|
||||||
|
with those enforcing the Code of Conduct, is allowed during this period.
|
||||||
|
Violating these terms may lead to a permanent ban.
|
||||||
|
|
||||||
|
### 4. Permanent Ban
|
||||||
|
|
||||||
|
**Community Impact**: Demonstrating a pattern of violation of community
|
||||||
|
standards, including sustained inappropriate behavior, harassment of an
|
||||||
|
individual, or aggression toward or disparagement of classes of individuals.
|
||||||
|
|
||||||
|
**Consequence**: A permanent ban from any sort of public interaction within
|
||||||
|
the community.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
|
version 2.0, available at
|
||||||
|
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||||
|
|
||||||
|
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||||
|
enforcement ladder](https://github.com/mozilla/diversity).
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see the FAQ at
|
||||||
|
https://www.contributor-covenant.org/faq. Translations are available at
|
||||||
|
https://www.contributor-covenant.org/translations.
|
20
.github/ISSUE_TEMPLATE/bug_report.md
vendored
20
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -2,25 +2,29 @@
|
|||||||
name: Bug report
|
name: Bug report
|
||||||
about: Create a report to help us improve
|
about: Create a report to help us improve
|
||||||
title: ''
|
title: ''
|
||||||
labels: ''
|
labels: 'bug'
|
||||||
assignees: ''
|
assignees: ''
|
||||||
---
|
---
|
||||||
|
|
||||||
## Describe the bug
|
## Describe the bug
|
||||||
A clear and concise description of what the bug is.
|
<!-- A clear and concise description of what the bug is. -->
|
||||||
|
|
||||||
## To Reproduce
|
## Steps to reproduce
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Go to '...'
|
1. Go to '...'
|
||||||
2. Click on '....'
|
2. Click on '....'
|
||||||
3. Scroll down to '....'
|
3. Scroll down to '....'
|
||||||
4. See error
|
4. See the error.
|
||||||
|
|
||||||
## Expected behavior
|
## Expected behavior
|
||||||
A clear and concise description of what you expected to happen.
|
<!-- A clear and concise description of what you expected to happen. -->
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
If applicable, add screenshots to help explain your problem.
|
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||||
|
|
||||||
## Additional context
|
## Additional context
|
||||||
Add any other context about the problem here.
|
<!-- Add any other context about the problem here. -->
|
||||||
|
|
||||||
|
## Issue validation
|
||||||
|
- [ ] I checked for duplicate issues.
|
||||||
|
- [ ] I checked for already existing discussions.
|
||||||
|
- [ ] I checked for an already existing pull request addressing the issue.
|
||||||
|
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -2,19 +2,23 @@
|
|||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest an idea for this project
|
about: Suggest an idea for this project
|
||||||
title: ''
|
title: ''
|
||||||
labels: ''
|
labels: 'enhancement'
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
## Is your feature request related to a problem? Please describe
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
## Describe the solution you'd like
|
||||||
A clear and concise description of what you want to happen.
|
<!-- A clear and concise description of what you want to happen. -->
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
## Describe alternatives you've considered
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
||||||
|
|
||||||
**Additional context**
|
## Additional context
|
||||||
Add any other context or screenshots about the feature request here.
|
<!-- Add any other context or screenshots about the feature request here. -->
|
||||||
|
|
||||||
|
## Issue validation
|
||||||
|
- [ ] I checked for duplicate issues.
|
||||||
|
- [ ] I checked for already existing discussions.
|
||||||
|
- [ ] I checked for an already existing pull request addressing the issue.
|
||||||
|
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,7 +1,4 @@
|
|||||||
# Pull Request
|
<!--Before you make this PR have you followed the docs here? - https://christitustech.github.io/winutil/contribute/ -->
|
||||||
|
|
||||||
## Title
|
|
||||||
[Provide a succinct and descriptive title for the pull request.]
|
|
||||||
|
|
||||||
## Type of Change
|
## Type of Change
|
||||||
- [ ] New feature
|
- [ ] New feature
|
||||||
@ -13,20 +10,20 @@
|
|||||||
- [ ] UI/UX improvement
|
- [ ] UI/UX improvement
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
[Provide a detailed explanation of the changes you have made. Include the reasons behind these changes and any relevant context. Link any related issues.]
|
<!--[Provide a detailed explanation of the changes you have made. Include the reasons behind these changes and any relevant context. Link any related issues.]-->
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
[Detail the testing you have performed to ensure that these changes function as intended. Include information about any added tests.]
|
<!--[Detail the testing you have performed to ensure that these changes function as intended. Include information about any added tests.]-->
|
||||||
|
|
||||||
## Impact
|
## Impact
|
||||||
[Discuss the impact of your changes on the project. This might include effects on performance, new dependencies, or changes in behaviour.]
|
<!--[Discuss the impact of your changes on the project. This might include effects on performance, new dependencies, or changes in behaviour.]-->
|
||||||
|
|
||||||
## Issue related to PR
|
## Issue related to PR
|
||||||
[What issue/discussion is related to this PR (if any)]
|
<!--[What issue/discussion is related to this PR (if any)]-->
|
||||||
- Resolves #
|
- Resolves #
|
||||||
|
|
||||||
## Additional Information
|
## Additional Information
|
||||||
[Any additional information that reviewers should be aware of.]
|
<!--[Any additional information that reviewers should be aware of.]-->
|
||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
- [ ] My code adheres to the coding and style guidelines of the project.
|
- [ ] My code adheres to the coding and style guidelines of the project.
|
||||||
|
2
.github/SECURITY.md
vendored
2
.github/SECURITY.md
vendored
@ -1,5 +1,5 @@
|
|||||||
# Security Policy
|
# Security Policy
|
||||||
|
|
||||||
If you find a security issue please make post it in the issues tab. If you think it should be private you can email me at contact@christitus.com.
|
If you find a security issue please make post it in the issues tab. If you think it should be private you can email me at contact@christitus.com.
|
||||||
|
|
||||||
For immediate response check out our discord server @ [](https://discord.gg/RUbZUZyByQ)
|
For immediate response check out our discord server @ [](https://discord.gg/RUbZUZyByQ)
|
||||||
|
5
.github/mkdocs.yml
vendored
5
.github/mkdocs.yml
vendored
@ -5,12 +5,15 @@ repo_url: https://github.com/ChrisTitusTech/winutil
|
|||||||
nav:
|
nav:
|
||||||
- Introduction: 'index.md'
|
- Introduction: 'index.md'
|
||||||
- User Guide: 'userguide.md'
|
- User Guide: 'userguide.md'
|
||||||
- Contributing Guide: 'contribute.md'
|
- Contributing Guide: 'CONTRIBUTING.md'
|
||||||
- Documentation:
|
- Documentation:
|
||||||
- Dev Docs: 'devdocs.md'
|
- Dev Docs: 'devdocs.md'
|
||||||
- Known Issues: 'KnownIssues.md'
|
- Known Issues: 'KnownIssues.md'
|
||||||
- FAQ: 'faq.md'
|
- FAQ: 'faq.md'
|
||||||
|
|
||||||
|
not_in_nav: |
|
||||||
|
dev/
|
||||||
|
|
||||||
theme:
|
theme:
|
||||||
name: material
|
name: material
|
||||||
custom_dir: '../overrides'
|
custom_dir: '../overrides'
|
||||||
|
54
.github/release-drafter.yml
vendored
Normal file
54
.github/release-drafter.yml
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
tag-prefix: ''
|
||||||
|
categories:
|
||||||
|
- title: '🚀 Features'
|
||||||
|
labels:
|
||||||
|
- 'feature'
|
||||||
|
- 'enhancement'
|
||||||
|
- title: '🐛 Bug Fixes'
|
||||||
|
labels:
|
||||||
|
- 'fix'
|
||||||
|
- 'bugfix'
|
||||||
|
- 'bug'
|
||||||
|
- title: '📚 Documentation'
|
||||||
|
label: 'documentation'
|
||||||
|
- title: '🔒 Security'
|
||||||
|
label: 'security'
|
||||||
|
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
||||||
|
template: |
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
$CHANGES
|
||||||
|
|
||||||
|
change-title-escapes: '\<*_&"'''
|
||||||
|
autolabeler:
|
||||||
|
- label: 'documentation'
|
||||||
|
files:
|
||||||
|
- '*.md'
|
||||||
|
branch:
|
||||||
|
- '/docs{0,1}\/.+/'
|
||||||
|
- label: 'bug'
|
||||||
|
branch:
|
||||||
|
- '/fix\/.+/'
|
||||||
|
title:
|
||||||
|
- '/fix/i'
|
||||||
|
- label: 'enhancement'
|
||||||
|
branch:
|
||||||
|
- '/feature\/.+/'
|
||||||
|
body:
|
||||||
|
- '/[A-Z]+-[0-9]+/'
|
||||||
|
- label: 'documentation'
|
||||||
|
files:
|
||||||
|
- '**/*.md'
|
||||||
|
- 'docs/**/*'
|
||||||
|
- label: 'security'
|
||||||
|
branch:
|
||||||
|
- '/security\/.+/'
|
||||||
|
replacers:
|
||||||
|
- search: /"/g
|
||||||
|
replace: ''
|
||||||
|
- search: /'/g
|
||||||
|
replace: ''
|
||||||
|
exclude-labels:
|
||||||
|
- 'skip-changelog'
|
||||||
|
|
||||||
|
filter-by-commitish: true
|
45
.github/workflows/close-issue-command.yaml
vendored
45
.github/workflows/close-issue-command.yaml
vendored
@ -1,45 +0,0 @@
|
|||||||
name: Close issue on /close
|
|
||||||
|
|
||||||
on:
|
|
||||||
issue_comment:
|
|
||||||
types: [created, edited]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
closeIssueOnClose:
|
|
||||||
# Skip this job if the comment was created/edited on a PR
|
|
||||||
if: ${{ !github.event.issue.pull_request }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: none
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Check for /close comment
|
|
||||||
id: check_comment
|
|
||||||
run: |
|
|
||||||
if [[ "${{ contains(github.event.comment.body, '/close') }}" == "true" ]]; then
|
|
||||||
echo "comment=true" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "comment=false" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Check if the user is allowed
|
|
||||||
id: check_user
|
|
||||||
if: env.comment == 'true'
|
|
||||||
run: |
|
|
||||||
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC")
|
|
||||||
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then
|
|
||||||
echo "user=true" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "user=false" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Close issue if conditions are met
|
|
||||||
if: env.comment == 'true' && env.user == 'true'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
|
||||||
run: |
|
|
||||||
echo Closing the issue...
|
|
||||||
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
|
|
8
.github/workflows/close-old-issues.yaml
vendored
8
.github/workflows/close-old-issues.yaml
vendored
@ -22,14 +22,14 @@ jobs:
|
|||||||
exempt-issue-labels: "Keep Issue Open"
|
exempt-issue-labels: "Keep Issue Open"
|
||||||
# Split it into two weeks, after one week the issue will be marked as stale,
|
# Split it into two weeks, after one week the issue will be marked as stale,
|
||||||
# after another week have pasted without any update.. the issue will then be closed.
|
# after another week have pasted without any update.. the issue will then be closed.
|
||||||
days-before-issue-stale: 7
|
days-before-issue-stale: 90
|
||||||
days-before-issue-close: 7
|
days-before-issue-close: 365
|
||||||
# NEVER mark PRs as Stale or Close + this workflow should never have write permissions on PRs, EVER!
|
# NEVER mark PRs as Stale or Close + this workflow should never have write permissions on PRs, EVER!
|
||||||
days-before-pr-stale: -1
|
days-before-pr-stale: -1
|
||||||
days-before-pr-close: -1
|
days-before-pr-close: -1
|
||||||
# Sends a message for both the Stale and Close events of an issue.
|
# Sends a message for both the Stale and Close events of an issue.
|
||||||
stale-issue-message: "This issue was marked as stale because it has been inactive for 7 days"
|
stale-issue-message: "This issue was marked as stale due to inactivity."
|
||||||
close-issue-message: "This issue was closed because it has been inactive for 7 days since it was marked as stale"
|
close-issue-message: "This issue was closed after remaining stale without updates."
|
||||||
# Increase this value if the project receives a lot of
|
# Increase this value if the project receives a lot of
|
||||||
# PRs (yes.. apparently they're processed no matter what) & Issues.
|
# PRs (yes.. apparently they're processed no matter what) & Issues.
|
||||||
# Default value for it (according to the docs) is 30
|
# Default value for it (according to the docs) is 30
|
||||||
|
22
.github/workflows/github-pages.yaml
vendored
22
.github/workflows/github-pages.yaml
vendored
@ -1,15 +1,17 @@
|
|||||||
name: GitHub Pages Deploy
|
name: GitHub Pages Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
push:
|
||||||
types: [published, prereleased]
|
paths:
|
||||||
|
- '.github/mkdocs.yml'
|
||||||
|
- '.github/requirements.txt'
|
||||||
|
- 'docs/**'
|
||||||
|
- 'overrides/**'
|
||||||
|
- '.github/CONTRIBUTING.md'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -22,10 +24,10 @@ jobs:
|
|||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: 3.x # Install latest Stable release of Python 3
|
python-version: 3.x # Install latest Stable release of Python 3
|
||||||
cache: 'pip' # caching pip dependencies
|
cache: 'pip' # Caching pip dependencies
|
||||||
|
|
||||||
- name: Install Necessary Dependencies using 'pip install -r .github/requirements.txt'
|
- name: Install Necessary Dependencies
|
||||||
run: pip install -r .github/requirements.txt
|
run: pip install -r .github/requirements.txt
|
||||||
|
|
||||||
- name: Build & Deploy using 'mkdocs'
|
- name: Build & Deploy using mkdocs
|
||||||
run: mkdocs gh-deploy --force -f .github/mkdocs.yml
|
run: mkdocs gh-deploy --force -f .github/mkdocs.yml
|
||||||
|
115
.github/workflows/issue-slash-commands.yaml
vendored
Normal file
115
.github/workflows/issue-slash-commands.yaml
vendored
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
name: Issue slash commands
|
||||||
|
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created, edited]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
issueCommands:
|
||||||
|
# Skip this job if the comment was created/edited on a PR
|
||||||
|
if: ${{ !github.event.issue.pull_request }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: none
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- run: echo "command=false" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Check for /label command
|
||||||
|
id: check_label_command
|
||||||
|
run: |
|
||||||
|
if [[ "${{ contains(github.event.comment.body, '/label') }}" == "true" ]]; then
|
||||||
|
echo "command=true" >> $GITHUB_ENV
|
||||||
|
LABEL_NAME=$(echo "${{ github.event.comment.body }}" | awk -F"/label" '/\/label/ { match($2, /'\''([^'\'']*)'\''/, arr); if (arr[1] != "") print arr[1] }')
|
||||||
|
echo "label_command=true" >> $GITHUB_ENV
|
||||||
|
echo "label_name=${LABEL_NAME}" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "label_command=false" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Check for /unlabel command
|
||||||
|
id: check_unlabel_command
|
||||||
|
run: |
|
||||||
|
if [[ "${{ contains(github.event.comment.body, '/unlabel') }}" == "true" ]]; then
|
||||||
|
echo "command=true" >> $GITHUB_ENV
|
||||||
|
UNLABEL_NAME=$(echo "${{ github.event.comment.body }}" | awk -F"/unlabel" '/\/unlabel/ { match($2, /'\''([^'\'']*)'\''/, arr); if (arr[1] != "") print arr[1] }')
|
||||||
|
echo "unlabel_command=true" >> $GITHUB_ENV
|
||||||
|
echo "unlabel_name=${UNLABEL_NAME}" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "unlabel_command=false" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Check for /close command
|
||||||
|
id: check_close_command
|
||||||
|
run: |
|
||||||
|
if [[ "${{ contains(github.event.comment.body, '/close') }}" == "true" ]]; then
|
||||||
|
echo "command=true" >> $GITHUB_ENV
|
||||||
|
echo "close_command=true" >> $GITHUB_ENV
|
||||||
|
echo "reopen_command=false" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "close_command=false" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Check for /open or /reopen command
|
||||||
|
id: check_reopen_command
|
||||||
|
run: |
|
||||||
|
if [[ "${{ contains(github.event.comment.body, '/open') }}" == "true" ]] || [[ "${{ contains(github.event.comment.body, '/reopen') }}" == "true" ]]; then
|
||||||
|
echo "command=true" >> $GITHUB_ENV
|
||||||
|
echo "reopen_command=true" >> $GITHUB_ENV
|
||||||
|
echo "close_command=false" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "reopen_command=false" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Check if the user is allowed
|
||||||
|
id: check_user
|
||||||
|
if: env.command == 'true'
|
||||||
|
run: |
|
||||||
|
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC" "CodingWonders")
|
||||||
|
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then
|
||||||
|
echo "user=true" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Close issue
|
||||||
|
if: env.close_command == 'true'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||||
|
run: |
|
||||||
|
echo Closing the issue...
|
||||||
|
if [[ "${{ contains(github.event.comment.body, 'not planned') }}" == "true" ]]; then
|
||||||
|
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }} --reason 'not planned'
|
||||||
|
else
|
||||||
|
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Reopen issue
|
||||||
|
if: env.reopen_command == 'true'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||||
|
run: |
|
||||||
|
echo Reopening the issue...
|
||||||
|
gh issue reopen $ISSUE_NUMBER --repo ${{ github.repository }}
|
||||||
|
|
||||||
|
- name: Label issue
|
||||||
|
if: env.label_command == 'true'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||||
|
run: |
|
||||||
|
echo Labeling the issue...
|
||||||
|
gh issue edit $ISSUE_NUMBER --repo ${{ github.repository }} --add-label "${{ env.label_name }}"
|
||||||
|
|
||||||
|
- name: Remove labels
|
||||||
|
if: env.unlabel_command == 'true'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||||
|
run: |
|
||||||
|
echo Unlabeling the issue...
|
||||||
|
gh issue edit $ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "${{ env.unlabel_name }}"
|
15
.github/workflows/pre-release.yaml
vendored
15
.github/workflows/pre-release.yaml
vendored
@ -74,16 +74,27 @@ jobs:
|
|||||||
name: winutil
|
name: winutil
|
||||||
path: ./winutil.ps1
|
path: ./winutil.ps1
|
||||||
|
|
||||||
|
- name: Generate Release Notes
|
||||||
|
id: generate_notes
|
||||||
|
uses: release-drafter/release-drafter@v6
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
config-name: release-drafter.yml
|
||||||
|
version: ${{ env.VERSION }} # Pass the version variable
|
||||||
|
|
||||||
- name: Create and Upload Release
|
- name: Create and Upload Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ env.VERSION }}
|
tag_name: ${{ env.VERSION }}
|
||||||
name: Pre-Release ${{ env.VERSION }}
|
name: Pre-Release ${{ env.VERSION }}
|
||||||
body: ""
|
body: |
|
||||||
|
${{ steps.generate_notes.outputs.body }}
|
||||||
|
|
||||||
|

|
||||||
append_body: false
|
append_body: false
|
||||||
files: ./winutil.ps1
|
files: ./winutil.ps1
|
||||||
prerelease: true
|
prerelease: true
|
||||||
generate_release_notes: true
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
121
Compile.ps1
121
Compile.ps1
@ -1,12 +1,21 @@
|
|||||||
param (
|
param (
|
||||||
[switch]$Debug,
|
[switch]$Debug,
|
||||||
[switch]$Run,
|
[switch]$Run,
|
||||||
[switch]$SkipPreprocessing
|
[switch]$SkipPreprocessing,
|
||||||
|
[string]$Arguments
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if ((Get-Item ".\winutil.ps1" -ErrorAction SilentlyContinue).IsReadOnly) {
|
||||||
|
Remove-Item ".\winutil.ps1" -Force
|
||||||
|
}
|
||||||
|
|
||||||
$OFS = "`r`n"
|
$OFS = "`r`n"
|
||||||
$scriptname = "winutil.ps1"
|
$scriptname = "winutil.ps1"
|
||||||
$workingdir = $PSScriptRoot
|
$workingdir = $PSScriptRoot
|
||||||
|
|
||||||
|
Push-Location
|
||||||
|
Set-Location $workingdir
|
||||||
|
|
||||||
# Variable to sync between runspaces
|
# Variable to sync between runspaces
|
||||||
$sync = [Hashtable]::Synchronized(@{})
|
$sync = [Hashtable]::Synchronized(@{})
|
||||||
$sync.PSScriptRoot = $workingdir
|
$sync.PSScriptRoot = $workingdir
|
||||||
@ -41,11 +50,11 @@ if (-NOT $SkipPreprocessing) {
|
|||||||
|
|
||||||
# Dot source the 'Invoke-Preprocessing' Function from 'tools/Invoke-Preprocessing.ps1' Script
|
# Dot source the 'Invoke-Preprocessing' Function from 'tools/Invoke-Preprocessing.ps1' Script
|
||||||
$preprocessingFilePath = ".\tools\Invoke-Preprocessing.ps1"
|
$preprocessingFilePath = ".\tools\Invoke-Preprocessing.ps1"
|
||||||
. "$(($workingdir -replace ('\\$', '')) + '\' + ($preprocessingFilePath -replace ('\.\\', '')))"
|
. $preprocessingFilePath
|
||||||
|
|
||||||
$excludedFiles = @('.\.git\', '.\.gitignore', '.\.gitattributes', '.\.github\CODEOWNERS', '.\LICENSE', "$preprocessingFilePath", '*.png', '*.exe')
|
$excludedFiles = @('.\.git\', '.\.gitignore', '.\.gitattributes', '.\.github\CODEOWNERS', '.\LICENSE', "$preprocessingFilePath", '*.png', '*.exe')
|
||||||
$msg = "Pre-req: Code Formatting"
|
$msg = "Pre-req: Code Formatting"
|
||||||
Invoke-Preprocessing -WorkingDir "$workingdir" -ExcludedFiles $excludedFiles -ProgressStatusMessage $msg
|
Invoke-Preprocessing -WorkingDir "$workingdir" -ExcludedFiles $excludedFiles -ProgressStatusMessage $msg -ThrowExceptionOnEmptyFilesList
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create the script in memory.
|
# Create the script in memory.
|
||||||
@ -56,109 +65,83 @@ 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 "$workingdir\scripts\start.ps1").replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)"))
|
$script_content.Add($(Get-Content "scripts\start.ps1").replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)"))
|
||||||
|
|
||||||
Update-Progress "Adding: Functions" 20
|
Update-Progress "Adding: Functions" 20
|
||||||
Get-ChildItem "$workingdir\functions" -Recurse -File | ForEach-Object {
|
Get-ChildItem "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 "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
|
Get-ChildItem "config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
|
||||||
|
$json = (Get-Content $psitem.FullName -Raw)
|
||||||
$json = (Get-Content $psitem.FullName).replace("'","''")
|
$jsonAsObject = $json | ConvertFrom-Json
|
||||||
|
|
||||||
# Replace every XML Special Character so it'll render correctly in final build
|
|
||||||
# Only do so if json files has content to be displayed (for example the applications, tweaks, features json files)
|
|
||||||
# Make an Array List containing every name at first level of Json File
|
|
||||||
$jsonAsObject = $json | convertfrom-json
|
|
||||||
$firstLevelJsonList = [System.Collections.ArrayList]::new()
|
|
||||||
$jsonAsObject.PSObject.Properties.Name | ForEach-Object {$null = $firstLevelJsonList.Add($_)}
|
|
||||||
# Note:
|
|
||||||
# Avoid using HTML Entity Codes, for example '”' (stands for "Right Double Quotation Mark"),
|
|
||||||
# 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) {
|
|
||||||
$firstLevelName = $firstLevelJsonList[$i]
|
|
||||||
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('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
|
|
||||||
}
|
|
||||||
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('''',"'") # 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") {
|
||||||
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
|
foreach ($appEntryName in $jsonAsObject.PSObject.Properties.Name) {
|
||||||
$appEntryName = $firstLevelJsonList[$i]
|
|
||||||
$appEntryContent = $jsonAsObject.$appEntryName
|
$appEntryContent = $jsonAsObject.$appEntryName
|
||||||
# Remove the entire app entry, so we could add it later with a different name
|
|
||||||
$jsonAsObject.PSObject.Properties.Remove($appEntryName)
|
$jsonAsObject.PSObject.Properties.Remove($appEntryName)
|
||||||
# Add the app entry, but with a different name (WPFInstall + The App Entry Name)
|
|
||||||
$jsonAsObject | Add-Member -MemberType NoteProperty -Name "WPFInstall$appEntryName" -Value $appEntryContent
|
$jsonAsObject | Add-Member -MemberType NoteProperty -Name "WPFInstall$appEntryName" -Value $appEntryContent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# The replace at the end is required, as without it the output of 'converto-json' will be somewhat weird for Multiline Strings
|
# Line 90 requires no whitespace inside the here-strings, to keep formatting of the JSON in the final script.
|
||||||
# Most Notably is the scripts in some json files, making it harder for users who want to review these scripts, which're found in the compiled script
|
$json = @"
|
||||||
$json = ($jsonAsObject | convertto-json -Depth 3).replace('\r\n',"`r`n")
|
$($jsonAsObject | ConvertTo-Json -Depth 3)
|
||||||
|
"@
|
||||||
|
|
||||||
$sync.configs.$($psitem.BaseName) = $json | convertfrom-json
|
$sync.configs.$($psitem.BaseName) = $json | ConvertFrom-Json
|
||||||
$script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" ))
|
$script_content.Add($(Write-Output "`$sync.configs.$($psitem.BaseName) = @'`r`n$json`r`n'@ `| ConvertFrom-Json" ))
|
||||||
}
|
}
|
||||||
|
|
||||||
$xaml = (Get-Content "$workingdir\xaml\inputXML.xaml").replace("'","''")
|
# Read the entire XAML file as a single string, preserving line breaks
|
||||||
|
$xaml = Get-Content "$workingdir\xaml\inputXML.xaml" -Raw
|
||||||
# Dot-source the Get-TabXaml function
|
|
||||||
. "$workingdir\functions\private\Get-TabXaml.ps1"
|
|
||||||
|
|
||||||
Update-Progress "Building: Xaml " 75
|
|
||||||
$appXamlContent = Get-TabXaml "applications" 5
|
|
||||||
$tweaksXamlContent = Get-TabXaml "tweaks"
|
|
||||||
$featuresXamlContent = Get-TabXaml "feature"
|
|
||||||
|
|
||||||
|
|
||||||
Update-Progress "Adding: Xaml " 90
|
Update-Progress "Adding: Xaml " 90
|
||||||
# Replace the placeholder in $inputXML with the content of inputApp.xaml
|
|
||||||
$xaml = $xaml -replace "{{InstallPanel_applications}}", $appXamlContent
|
|
||||||
$xaml = $xaml -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent
|
|
||||||
$xaml = $xaml -replace "{{InstallPanel_features}}", $featuresXamlContent
|
|
||||||
|
|
||||||
$script_content.Add($(Write-output "`$inputXML = '$xaml'"))
|
# Add the XAML content to $script_content using a here-string
|
||||||
|
$script_content.Add(@"
|
||||||
|
`$inputXML = @'
|
||||||
|
$xaml
|
||||||
|
'@
|
||||||
|
"@)
|
||||||
|
|
||||||
$script_content.Add($(Get-Content "$workingdir\scripts\main.ps1"))
|
$script_content.Add($(Get-Content "scripts\main.ps1"))
|
||||||
|
|
||||||
if ($Debug) {
|
if ($Debug) {
|
||||||
Update-Progress "Writing debug files" 95
|
Update-Progress "Writing debug files" 95
|
||||||
$appXamlContent | Out-File -FilePath "$workingdir\xaml\inputApp.xaml" -Encoding ascii
|
$appXamlContent | Out-File -FilePath "xaml\inputApp.xaml" -Encoding ascii
|
||||||
$tweaksXamlContent | Out-File -FilePath "$workingdir\xaml\inputTweaks.xaml" -Encoding ascii
|
$tweaksXamlContent | Out-File -FilePath "xaml\inputTweaks.xaml" -Encoding ascii
|
||||||
$featuresXamlContent | Out-File -FilePath "$workingdir\xaml\inputFeatures.xaml" -Encoding ascii
|
$featuresXamlContent | Out-File -FilePath "xaml\inputFeatures.xaml" -Encoding ascii
|
||||||
} else {
|
} else {
|
||||||
Update-Progress "Removing temporary files" 99
|
Update-Progress "Removing temporary files" 99
|
||||||
Remove-Item "$workingdir\xaml\inputApp.xaml" -ErrorAction SilentlyContinue
|
Remove-Item "xaml\inputApp.xaml" -ErrorAction SilentlyContinue
|
||||||
Remove-Item "$workingdir\xaml\inputTweaks.xaml" -ErrorAction SilentlyContinue
|
Remove-Item "xaml\inputTweaks.xaml" -ErrorAction SilentlyContinue
|
||||||
Remove-Item "$workingdir\xaml\inputFeatures.xaml" -ErrorAction SilentlyContinue
|
Remove-Item "xaml\inputFeatures.xaml" -ErrorAction SilentlyContinue
|
||||||
}
|
}
|
||||||
|
|
||||||
Set-Content -Path "$workingdir\$scriptname" -Value ($script_content -join "`r`n") -Encoding ascii
|
Set-Content -Path "$scriptname" -Value ($script_content -join "`r`n") -Encoding ascii
|
||||||
Write-Progress -Activity "Compiling" -Completed
|
Write-Progress -Activity "Compiling" -Completed
|
||||||
|
|
||||||
Update-Progress -Activity "Validating" -StatusMessage "Checking winutil.ps1 Syntax" -Percent 0
|
Update-Progress -Activity "Validating" -StatusMessage "Checking winutil.ps1 Syntax" -Percent 0
|
||||||
try {
|
try {
|
||||||
$null = Get-Command -Syntax .\winutil.ps1
|
Get-Command -Syntax .\winutil.ps1 | Out-Null
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
Write-Warning "Syntax Validation for 'winutil.ps1' has failed"
|
Write-Warning "Syntax Validation for 'winutil.ps1' has failed"
|
||||||
Write-Host "$($Error[0])" -ForegroundColor Red
|
Write-Host "$($Error[0])" -ForegroundColor Red
|
||||||
|
Pop-Location # Restore previous location before exiting...
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
Write-Progress -Activity "Validating" -Completed
|
Write-Progress -Activity "Validating" -Completed
|
||||||
|
|
||||||
if ($run) {
|
if ($run) {
|
||||||
try {
|
$script = "& '$workingdir\$scriptname' $Arguments"
|
||||||
Start-Process -FilePath "pwsh" -ArgumentList "$workingdir\$scriptname"
|
|
||||||
} catch {
|
|
||||||
Start-Process -FilePath "powershell" -ArgumentList "$workingdir\$scriptname"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" }
|
||||||
|
$processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { $powershellcmd }
|
||||||
|
|
||||||
|
Start-Process $processCmd -ArgumentList "$powershellcmd -NoProfile -Command $script"
|
||||||
|
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
Pop-Location
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2022 Chris Titus
|
Copyright (c) 2022 CT Tech Group LLC
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
@ -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/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/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><a href="https://github.com/woobe-studio"><img src="https://github.com/woobe-studio.png" width="60px" alt="Michael Wozniak" /></a><a href="https://github.com/xBandaku"><img src="https://github.com/xBandaku.png" width="60px" alt="xPandaku" /></a><!-- sponsors -->
|
<!-- sponsors --><a href="https://github.com/TriHydera"><img src="https://avatars.githubusercontent.com/u/39857764?u=5dbda638f45530582eee1703b4473f2a5e229e28&v=4" width="60px" alt="TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://avatars.githubusercontent.com/u/3272468?u=4391ed4655e4fd8b56e23b4169e44e2ac9b6cd97&v=4" width="60px" alt="" /></a><a href="https://github.com/DelDongo"><img src="https://avatars.githubusercontent.com/u/127976398?v=4" width="60px" alt="" /></a><a href="https://github.com/markamos"><img src="https://avatars.githubusercontent.com/u/9561861?u=3cca179dcff0413538591e57a3abea116d65ce56&v=4" width="60px" alt="Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://avatars.githubusercontent.com/u/54533224?u=a49ea000a8f52adb31382ea69a1a7501b27fefdd&v=4" width="60px" alt="" /></a><a href="https://github.com/mews-se"><img src="https://avatars.githubusercontent.com/u/58894405?v=4" width="60px" alt="" /></a><a href="https://github.com/jdiegmueller"><img src="https://avatars.githubusercontent.com/u/18660571?u=601d0a23040a271c86b5d40339f899a6dbf27086&v=4" width="60px" alt="Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://avatars.githubusercontent.com/u/105566568?v=4" width="60px" alt="" /></a><a href="https://github.com/zepled112"><img src="https://avatars.githubusercontent.com/u/65176625?v=4" width="60px" alt="wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https://avatars.githubusercontent.com/u/105917451?u=ee73ff639c7bd9feb4708ab4ba7b14eff80196f7&v=4" width="60px" alt="" /></a><a href="https://github.com/robertsandrock"><img src="https://avatars.githubusercontent.com/u/12015331?v=4" width="60px" alt="RMS" /></a><a href="https://github.com/mmomega"><img src="https://avatars.githubusercontent.com/u/71956566?v=4" width="60px" alt="" /></a><a href="https://github.com/KenichiQaz"><img src="https://avatars.githubusercontent.com/u/31177857?u=efdbae734a4c60a7bb95df4659d0535e60a6fd57&v=4" width="60px" alt="Stefan" /></a><a href="https://github.com/paulsheets"><img src="https://avatars.githubusercontent.com/u/45240946?u=d4db66f8e8d7a2606fe7a5521daf48ca9f097105&v=4" width="60px" alt="Paul" /></a><a href="https://github.com/djones369"><img src="https://avatars.githubusercontent.com/u/4107092?v=4" width="60px" alt="Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://avatars.githubusercontent.com/u/19240897?u=f82b4be098cac65c8421421b70ebd2d1da85c67e&v=4" width="60px" alt="Anthony Mendez" /></a><a href="https://github.com/claudemods"><img src="https://avatars.githubusercontent.com/u/73653396?u=d64c656fb8db24ef56bb000197532df9b618d06c&v=4" width="60px" alt="Claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https://avatars.githubusercontent.com/u/173957728?v=4" width="60px" alt="" /></a><a href="https://github.com/Ascent7910"><img src="https://avatars.githubusercontent.com/u/118260621?v=4" width="60px" alt="Max" /></a><a href="https://github.com/DursleyGuy"><img src="https://avatars.githubusercontent.com/u/140165544?v=4" width="60px" alt="DursleyGuy" /></a><a href="https://github.com/YamiSandman616"><img src="https://avatars.githubusercontent.com/u/183505690?u=c3bd20157058b6215e28f7568d4f8c4fbbe92838&v=4" width="60px" alt="Sandman616" /></a><a href="https://github.com/realmuddy"><img src="https://avatars.githubusercontent.com/u/30978236?v=4" width="60px" alt="Phillip Waters" /></a><a href="https://github.com/Tariq-Al-Zahrani"><img src="https://avatars.githubusercontent.com/u/187593049?v=4" width="60px" alt="" /></a><a href="https://github.com/quaszi"><img src="https://avatars.githubusercontent.com/u/51266738?u=2e3185214607e51239c5969c866ddd5eb1bdee48&v=4" width="60px" alt="" /></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 🍻.
|
||||||
|
28
Test-WingetInstall.ps1
Normal file
28
Test-WingetInstall.ps1
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Import the function (adjust the path according to your setup)
|
||||||
|
. "./functions/private/Get-WinUtilWingetLatest.ps1"
|
||||||
|
|
||||||
|
# Set up Information stream to be visible
|
||||||
|
$InformationPreference = "Continue"
|
||||||
|
|
||||||
|
Write-Host "Starting Winget installation test..." -ForegroundColor Cyan
|
||||||
|
|
||||||
|
try {
|
||||||
|
# Test the function with verbose output
|
||||||
|
Write-Host "Attempting to run Get-WinUtilWingetLatest..." -ForegroundColor Cyan
|
||||||
|
Get-WinUtilWingetLatest -Verbose
|
||||||
|
|
||||||
|
# Verify Winget is working
|
||||||
|
if (Get-Command winget -ErrorAction SilentlyContinue) {
|
||||||
|
Write-Host "Success! Winget is installed and accessible." -ForegroundColor Green
|
||||||
|
|
||||||
|
# Display Winget version
|
||||||
|
Write-Host "`nWinget version:" -ForegroundColor Cyan
|
||||||
|
winget --version
|
||||||
|
} else {
|
||||||
|
Write-Host "Warning: Winget is installed but not accessible in the current session. You may need to restart your terminal." -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Host "Error occurred during testing: $($_.Exception.Message)" -ForegroundColor Red
|
||||||
|
Write-Host "Stack Trace:" -ForegroundColor Red
|
||||||
|
$_.ScriptStackTrace
|
||||||
|
}
|
@ -87,14 +87,6 @@
|
|||||||
"link": "https://anydesk.com/",
|
"link": "https://anydesk.com/",
|
||||||
"winget": "AnyDeskSoftwareGmbH.AnyDesk"
|
"winget": "AnyDeskSoftwareGmbH.AnyDesk"
|
||||||
},
|
},
|
||||||
"ATLauncher": {
|
|
||||||
"category": "Games",
|
|
||||||
"choco": "na",
|
|
||||||
"content": "ATLauncher",
|
|
||||||
"description": "ATLauncher is a Launcher for Minecraft which integrates multiple different ModPacks to allow you to download and install ModPacks easily and quickly.",
|
|
||||||
"link": "https://github.com/ATLauncher/ATLauncher",
|
|
||||||
"winget": "ATLauncher.ATLauncher"
|
|
||||||
},
|
|
||||||
"audacity": {
|
"audacity": {
|
||||||
"category": "Multimedia Tools",
|
"category": "Multimedia Tools",
|
||||||
"choco": "audacity",
|
"choco": "audacity",
|
||||||
@ -447,13 +439,21 @@
|
|||||||
"link": "https://dotnet.microsoft.com/download/dotnet/8.0",
|
"link": "https://dotnet.microsoft.com/download/dotnet/8.0",
|
||||||
"winget": "Microsoft.DotNet.DesktopRuntime.8"
|
"winget": "Microsoft.DotNet.DesktopRuntime.8"
|
||||||
},
|
},
|
||||||
|
"dotnet9": {
|
||||||
|
"category": "Microsoft Tools",
|
||||||
|
"choco": "dotnet-9.0-runtime",
|
||||||
|
"content": ".NET Desktop Runtime 9",
|
||||||
|
"description": ".NET Desktop Runtime 9 is a runtime environment required for running applications developed with .NET 9.",
|
||||||
|
"link": "https://dotnet.microsoft.com/download/dotnet/9.0",
|
||||||
|
"winget": "Microsoft.DotNet.DesktopRuntime.9"
|
||||||
|
},
|
||||||
"dmt": {
|
"dmt": {
|
||||||
"winget": "GNE.DualMonitorTools",
|
"winget": "GNE.DualMonitorTools",
|
||||||
"choco": "dual-monitor-tools",
|
"choco": "dual-monitor-tools",
|
||||||
"category": "Utilities",
|
"category": "Utilities",
|
||||||
"content": "Dual Monitor Tools",
|
"content": "Dual Monitor Tools",
|
||||||
"link": "https://dualmonitortool.sourceforge.net/",
|
"link": "https://dualmonitortool.sourceforge.net/",
|
||||||
"description": "Dual Monitor Tools (DMT) is a FOSS app that customize handling multiple monitors and even lock the mouse on specific monitor. Useful for full screen games and apps that does not handle well a second monitor or helps the workflow."
|
"description": "Dual Monitor Tools (DMT) is a FOSS app that allows you to customize the handling of multiple monitors. Useful for fullscreen games and apps that handle a second monitor poorly and can improve your workflow."
|
||||||
},
|
},
|
||||||
"duplicati": {
|
"duplicati": {
|
||||||
"category": "Utilities",
|
"category": "Utilities",
|
||||||
@ -511,14 +511,6 @@
|
|||||||
"link": "https://www.epicgames.com/store/en-US/",
|
"link": "https://www.epicgames.com/store/en-US/",
|
||||||
"winget": "EpicGames.EpicGamesLauncher"
|
"winget": "EpicGames.EpicGamesLauncher"
|
||||||
},
|
},
|
||||||
"errorlookup": {
|
|
||||||
"category": "Utilities",
|
|
||||||
"choco": "na",
|
|
||||||
"content": "Windows Error Code Lookup",
|
|
||||||
"description": "ErrorLookup is a tool for looking up Windows error codes and their descriptions.",
|
|
||||||
"link": "https://github.com/HenryPP/ErrorLookup",
|
|
||||||
"winget": "Henry++.ErrorLookup"
|
|
||||||
},
|
|
||||||
"esearch": {
|
"esearch": {
|
||||||
"category": "Utilities",
|
"category": "Utilities",
|
||||||
"choco": "everything",
|
"choco": "everything",
|
||||||
@ -813,7 +805,7 @@
|
|||||||
"content": "Google Drive",
|
"content": "Google Drive",
|
||||||
"description": "File syncing across devices all tied to your google account",
|
"description": "File syncing across devices all tied to your google account",
|
||||||
"link": "https://www.google.com/drive/",
|
"link": "https://www.google.com/drive/",
|
||||||
"winget": "Google.Drive"
|
"winget": "Google.GoogleDrive"
|
||||||
},
|
},
|
||||||
"gpuz": {
|
"gpuz": {
|
||||||
"category": "Utilities",
|
"category": "Utilities",
|
||||||
@ -1908,7 +1900,7 @@
|
|||||||
"choco": "sdio",
|
"choco": "sdio",
|
||||||
"content": "Snappy Driver Installer Origin",
|
"content": "Snappy Driver Installer Origin",
|
||||||
"description": "Snappy Driver Installer Origin is a free and open-source driver updater with a vast driver database for Windows.",
|
"description": "Snappy Driver Installer Origin is a free and open-source driver updater with a vast driver database for Windows.",
|
||||||
"link": "https://sourceforge.net/projects/snappy-driver-installer-origin",
|
"link": "https://www.glenn.delahoy.com/snappy-driver-installer-origin/",
|
||||||
"winget": "GlennDelahoy.SnappyDriverInstallerOrigin"
|
"winget": "GlennDelahoy.SnappyDriverInstallerOrigin"
|
||||||
},
|
},
|
||||||
"session": {
|
"session": {
|
||||||
@ -2871,14 +2863,6 @@
|
|||||||
"link": "https://www.kicad.org/",
|
"link": "https://www.kicad.org/",
|
||||||
"winget": "KiCad.KiCad"
|
"winget": "KiCad.KiCad"
|
||||||
},
|
},
|
||||||
"FormatFactory": {
|
|
||||||
"category": "Utilities",
|
|
||||||
"choco": "formatfactory",
|
|
||||||
"content": "Format Factory",
|
|
||||||
"description":"FormatFactory is an ad-supported freeware multimedia converter that can convert video, audio, and picture files. It is also capable of ripping DVDs and CDs to other file formats, as well as creating .iso images. It can also join multiple video files together into one.",
|
|
||||||
"link": "http://www.pcfreetime.com/formatfactory/",
|
|
||||||
"winget": "na"
|
|
||||||
},
|
|
||||||
"dropox": {
|
"dropox": {
|
||||||
"category": "Utilities",
|
"category": "Utilities",
|
||||||
"choco": "na",
|
"choco": "na",
|
||||||
|
@ -113,7 +113,7 @@
|
|||||||
</RunSynchronousCommand>
|
</RunSynchronousCommand>
|
||||||
<RunSynchronousCommand wcm:action="add">
|
<RunSynchronousCommand wcm:action="add">
|
||||||
<Order>19</Order>
|
<Order>19</Order>
|
||||||
<Path>powershell.exe -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Temp\remove-packages.ps1' -Raw | Invoke-Expression;"</Path>
|
<Path>powershell.exe -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Temp\Microwin-RemovePackages.ps1' -Raw | Invoke-Expression;"</Path>
|
||||||
</RunSynchronousCommand>
|
</RunSynchronousCommand>
|
||||||
<RunSynchronousCommand wcm:action="add">
|
<RunSynchronousCommand wcm:action="add">
|
||||||
<Order>20</Order>
|
<Order>20</Order>
|
||||||
@ -293,7 +293,7 @@
|
|||||||
<Extensions xmlns="https://schneegans.de/windows/unattend-generator/">
|
<Extensions xmlns="https://schneegans.de/windows/unattend-generator/">
|
||||||
<ExtractScript>
|
<ExtractScript>
|
||||||
param(
|
param(
|
||||||
[xml] $Document
|
[xml]$Document
|
||||||
);
|
);
|
||||||
|
|
||||||
$scriptsDir = 'C:\Windows\Setup\Scripts\';
|
$scriptsDir = 'C:\Windows\Setup\Scripts\';
|
||||||
@ -312,7 +312,7 @@ foreach( $file in $Document.unattend.Extensions.File ) {
|
|||||||
[System.IO.File]::WriteAllBytes( $path, ( $encoding.GetPreamble() + $encoding.GetBytes( $file.InnerText.Trim() ) ) );
|
[System.IO.File]::WriteAllBytes( $path, ( $encoding.GetPreamble() + $encoding.GetBytes( $file.InnerText.Trim() ) ) );
|
||||||
}
|
}
|
||||||
</ExtractScript>
|
</ExtractScript>
|
||||||
<File path="C:\Windows\Temp\remove-packages.ps1">
|
<File path="C:\Windows\Temp\Microwin-RemovePackages.ps1">
|
||||||
$selectors = @(
|
$selectors = @(
|
||||||
'Microsoft.Microsoft3DViewer';
|
'Microsoft.Microsoft3DViewer';
|
||||||
'Microsoft.BingSearch';
|
'Microsoft.BingSearch';
|
||||||
@ -359,7 +359,7 @@ $removeCommand = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
$type = 'Package';
|
$type = 'Package';
|
||||||
$logfile = 'C:\Windows\Temp\remove-packages.log';
|
$logfile = 'C:\Windows\Temp\Microwin-RemovePackages.log';
|
||||||
& {
|
& {
|
||||||
$installed = & $getCommand;
|
$installed = & $getCommand;
|
||||||
foreach( $selector in $selectors ) {
|
foreach( $selector in $selectors ) {
|
||||||
|
@ -46,5 +46,23 @@
|
|||||||
"Secondary": "94.140.15.16",
|
"Secondary": "94.140.15.16",
|
||||||
"Primary6": "2a10:50c0::bad1:ff",
|
"Primary6": "2a10:50c0::bad1:ff",
|
||||||
"Secondary6": "2a10:50c0::bad2:ff"
|
"Secondary6": "2a10:50c0::bad2:ff"
|
||||||
|
},
|
||||||
|
"dns0.eu_Open":{
|
||||||
|
"Primary": "193.110.81.254",
|
||||||
|
"Secondary": "185.253.5.254",
|
||||||
|
"Primary6": "2a0f:fc80::ffff",
|
||||||
|
"Secondary6": "2a0f:fc81::ffff"
|
||||||
|
},
|
||||||
|
"dns0.eu_ZERO":{
|
||||||
|
"Primary": "193.110.81.9",
|
||||||
|
"Secondary": "185.253.5.9",
|
||||||
|
"Primary6": "2a0f:fc80::9",
|
||||||
|
"Secondary6": "2a0f:fc81::9"
|
||||||
|
},
|
||||||
|
"dns0.eu_KIDS":{
|
||||||
|
"Primary": "193.110.81.1",
|
||||||
|
"Secondary": "185.253.5.1",
|
||||||
|
"Primary6": "2a0f:fc80::1",
|
||||||
|
"Secondary6": "2a0f:fc81::1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -282,6 +282,14 @@
|
|||||||
"ButtonWidth": "300",
|
"ButtonWidth": "300",
|
||||||
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/sound"
|
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/sound"
|
||||||
},
|
},
|
||||||
|
"WPFPanelprinter": {
|
||||||
|
"Content": "Printer Panel",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
|
"panel": "2",
|
||||||
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
|
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/printer"
|
||||||
|
},
|
||||||
"WPFPanelsystem": {
|
"WPFPanelsystem": {
|
||||||
"Content": "System Properties",
|
"Content": "System Properties",
|
||||||
"category": "Legacy Windows Panels",
|
"category": "Legacy Windows Panels",
|
||||||
@ -297,5 +305,31 @@
|
|||||||
"Type": "Button",
|
"Type": "Button",
|
||||||
"ButtonWidth": "300",
|
"ButtonWidth": "300",
|
||||||
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/user"
|
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/user"
|
||||||
|
},
|
||||||
|
"WPFWinUtilInstallPSProfile": {
|
||||||
|
"Content": "Install CTT PowerShell Profile",
|
||||||
|
"category": "Powershell Profile",
|
||||||
|
"panel": "2",
|
||||||
|
"Order": "a083_",
|
||||||
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
|
"link": "https://christitustech.github.io/winutil/dev/features/Powershell-Profile/PSProfileInstall"
|
||||||
|
},
|
||||||
|
"WPFWinUtilUninstallPSProfile": {
|
||||||
|
"Content": "Uninstall CTT PowerShell Profile",
|
||||||
|
"category": "Powershell Profile",
|
||||||
|
"panel": "2",
|
||||||
|
"Order": "a084_",
|
||||||
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
|
"link": "https://christitustech.github.io/winutil/dev/features/Powershell-Profile/PSProfileUninstall"
|
||||||
|
},
|
||||||
|
"WPFWinUtilSSHServer": {
|
||||||
|
"Content": "Enable OpenSSH Server",
|
||||||
|
"category": "Remote Access",
|
||||||
|
"panel": "2",
|
||||||
|
"Order": "a084_",
|
||||||
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"WPFTweaksDeleteTempFiles",
|
"WPFTweaksDeleteTempFiles",
|
||||||
"WPFTweaksEndTaskOnTaskbar",
|
"WPFTweaksEndTaskOnTaskbar",
|
||||||
"WPFTweaksRestorePoint",
|
"WPFTweaksRestorePoint",
|
||||||
"WPFTweaksTeredo",
|
"WPFTweaksIPv46",
|
||||||
"WPFTweaksPowershell7Tele"
|
"WPFTweaksPowershell7Tele"
|
||||||
],
|
],
|
||||||
"Minimal": [
|
"Minimal": [
|
||||||
|
@ -1,220 +1,109 @@
|
|||||||
{
|
{
|
||||||
"Classic": {
|
"shared":{
|
||||||
"CustomDialogFontSize": "12",
|
"CustomDialogFontSize": "12",
|
||||||
"CustomDialogFontSizeHeader": "14",
|
"CustomDialogFontSizeHeader": "14",
|
||||||
"CustomDialogIconSize": "25",
|
"CustomDialogLogoSize": "25",
|
||||||
"CustomDialogWidth": "400",
|
"CustomDialogWidth": "400",
|
||||||
"CustomDialogHeight": "200",
|
"CustomDialogHeight": "200",
|
||||||
|
"FontSize": "12",
|
||||||
|
"FontFamily": "Arial",
|
||||||
|
"HeadingFontSize": "16",
|
||||||
|
"HeaderFontFamily": "Consolas, Monaco",
|
||||||
|
"CheckBoxBulletDecoratorSize": "14",
|
||||||
|
"CheckBoxMargin": "15,0,0,2",
|
||||||
|
"TabContentMargin": "5",
|
||||||
|
"TabButtonFontSize": "14",
|
||||||
|
"TabButtonWidth": "110",
|
||||||
|
"TabButtonHeight": "26",
|
||||||
|
"TabRowHeightInPixels": "50",
|
||||||
|
"IconFontSize": "14",
|
||||||
|
"IconButtonSize": "35",
|
||||||
|
"SettingsIconFontSize": "18",
|
||||||
|
"CloseIconFontSize": "18",
|
||||||
|
"MicroWinLogoSize": "10",
|
||||||
|
"MicrowinCheckBoxMargin": "-10,5,0,0",
|
||||||
|
"GroupBorderBackgroundColor": "#232629",
|
||||||
|
"ButtonFontSize": "12",
|
||||||
|
"ButtonFontFamily": "Arial",
|
||||||
|
"ButtonWidth": "200",
|
||||||
|
"ButtonHeight": "25",
|
||||||
|
"ConfigUpdateButtonFontSize": "14",
|
||||||
|
"SearchBarWidth": "200",
|
||||||
|
"SearchBarHeight": "26",
|
||||||
|
"SearchBarTextBoxFontSize": "12",
|
||||||
|
"SearchBarClearButtonFontSize": "14",
|
||||||
|
"CheckboxMouseOverColor": "#999999",
|
||||||
|
"ButtonBorderThickness": "1",
|
||||||
|
"ButtonMargin": "1",
|
||||||
|
"ButtonCornerRadius": "2"
|
||||||
|
},
|
||||||
|
"Light": {
|
||||||
|
"ComboBoxForegroundColor": "#232629",
|
||||||
|
"ComboBoxBackgroundColor": "#F7F7F7",
|
||||||
|
"LabelboxForegroundColor": "#232629",
|
||||||
|
"MainForegroundColor": "#232629",
|
||||||
|
"MainBackgroundColor": "#F7F7F7",
|
||||||
|
"LabelBackgroundColor": "#F7F7F7",
|
||||||
|
"LinkForegroundColor": "#484848",
|
||||||
|
"LinkHoverForegroundColor": "#232629",
|
||||||
|
"ScrollBarBackgroundColor": "#4A4D52",
|
||||||
|
"ScrollBarHoverColor": "#5A5D62",
|
||||||
|
"ScrollBarDraggingColor": "#6A6D72",
|
||||||
|
|
||||||
"FontSize": "12",
|
"ProgressBarForegroundColor": "#2e77ff",
|
||||||
"FontFamily": "Arial",
|
"ProgressBarBackgroundColor": "Transparent",
|
||||||
"FontSizeHeading": "14",
|
"ProgressBarTextColor": "#232629",
|
||||||
"HeaderFontFamily": "Consolas, Monaco",
|
"ButtonInstallBackgroundColor": "#F7F7F7",
|
||||||
|
"ButtonTweaksBackgroundColor": "#F7F7F7",
|
||||||
|
"ButtonConfigBackgroundColor": "#F7F7F7",
|
||||||
|
"ButtonUpdatesBackgroundColor": "#F7F7F7",
|
||||||
|
"ButtonInstallForegroundColor": "#232629",
|
||||||
|
"ButtonTweaksForegroundColor": "#232629",
|
||||||
|
"ButtonConfigForegroundColor": "#232629",
|
||||||
|
"ButtonUpdatesForegroundColor": "#232629",
|
||||||
|
"ButtonBackgroundColor": "#F5F5F5",
|
||||||
|
"ButtonBackgroundPressedColor": "#1A1A1A",
|
||||||
|
"ButtonBackgroundMouseoverColor": "#C2C2C2",
|
||||||
|
"ButtonBackgroundSelectedColor": "#F0F0F0",
|
||||||
|
"ButtonForegroundColor": "#232629",
|
||||||
|
"ToggleButtonOnColor": "#2e77ff",
|
||||||
|
"ToggleButtonOffColor": "#707070",
|
||||||
|
"BorderColor": "#232629",
|
||||||
|
"BorderOpacity": "0.2"
|
||||||
|
|
||||||
"CheckBoxBulletDecoratorFontSize": "14",
|
},
|
||||||
"CheckBoxMargin": "15,0,0,2",
|
"Dark": {
|
||||||
|
"ComboBoxForegroundColor": "#F7F7F7",
|
||||||
|
"ComboBoxBackgroundColor": "#1E3747",
|
||||||
|
"LabelboxForegroundColor": "#0567ff",
|
||||||
|
"MainForegroundColor": "#F7F7F7",
|
||||||
|
"MainBackgroundColor": "#232629",
|
||||||
|
"LabelBackgroundColor": "#232629",
|
||||||
|
"LinkForegroundColor": "#add8e6",
|
||||||
|
"LinkHoverForegroundColor": "#F7F7F7",
|
||||||
|
"ScrollBarBackgroundColor": "#2E3135",
|
||||||
|
"ScrollBarHoverColor": "#3B4252",
|
||||||
|
"ScrollBarDraggingColor": "#5E81AC",
|
||||||
|
|
||||||
"TabButtonFontSize": "14",
|
"ProgressBarForegroundColor": "#222222",
|
||||||
"TabButtonWidth": "100",
|
"ProgressBarBackgroundColor": "Transparent",
|
||||||
"TabButtonHeight": "25",
|
"ProgressBarTextColor": "#cccccc",
|
||||||
"TabRowHeightInPixels": "50",
|
"ButtonInstallBackgroundColor": "#222222",
|
||||||
"IconFontSize": "14",
|
"ButtonTweaksBackgroundColor": "#333333",
|
||||||
"IconButtonSize": "35",
|
"ButtonConfigBackgroundColor": "#444444",
|
||||||
"WinUtilIconSize": "Auto",
|
"ButtonUpdatesBackgroundColor": "#555555",
|
||||||
"SettingsIconFontSize": "18",
|
"ButtonInstallForegroundColor": "#F7F7F7",
|
||||||
|
"ButtonTweaksForegroundColor": "#F7F7F7",
|
||||||
"MicroWinLogoSize": "10",
|
"ButtonConfigForegroundColor": "#F7F7F7",
|
||||||
|
"ButtonUpdatesForegroundColor": "#F7F7F7",
|
||||||
"ProgressBarForegroundColor": "#FFAC1C",
|
"ButtonBackgroundColor": "#1E3747",
|
||||||
"ProgressBarBackgroundColor": "Transparent",
|
"ButtonBackgroundPressedColor": "#F7F7F7",
|
||||||
"ProgressBarTextColor": "#000000",
|
"ButtonBackgroundMouseoverColor": "#3B4252",
|
||||||
|
"ButtonBackgroundSelectedColor": "#5E81AC",
|
||||||
"ComboBoxBackgroundColor": "#FFFFFF",
|
"ButtonForegroundColor": "#F7F7F7",
|
||||||
"LabelboxForegroundColor": "#000000",
|
"ToggleButtonOnColor": "#2e77ff",
|
||||||
"MainForegroundColor": "#000000",
|
"ToggleButtonOffColor": "#707070",
|
||||||
"MainBackgroundColor": "#FFFFFF",
|
"BorderColor": "#2F373D",
|
||||||
"LabelBackgroundColor": "#FAFAFA",
|
"BorderOpacity": "0.2"
|
||||||
"LinkForegroundColor": "#000000",
|
}
|
||||||
"LinkHoverForegroundColor": "#000000",
|
|
||||||
"GroupBorderBackgroundColor": "#000000",
|
|
||||||
"ComboBoxForegroundColor": "#000000",
|
|
||||||
|
|
||||||
"ButtonFontSize": "12",
|
|
||||||
"ButtonFontFamily": "Arial",
|
|
||||||
"ButtonWidth": "200",
|
|
||||||
"ButtonHeight": "25",
|
|
||||||
"ConfigTabButtonFontSize": "16",
|
|
||||||
|
|
||||||
"SearchBarWidth": "200",
|
|
||||||
"SearchBarHeight": "25",
|
|
||||||
"SearchBarTextBoxFontSize": "16",
|
|
||||||
"SearchBarClearButtonFontSize": "14",
|
|
||||||
|
|
||||||
"ButtonInstallBackgroundColor": "#FFFFFF",
|
|
||||||
"ButtonTweaksBackgroundColor": "#FFFFFF",
|
|
||||||
"ButtonConfigBackgroundColor": "#FFFFFF",
|
|
||||||
"ButtonUpdatesBackgroundColor": "#FFFFFF",
|
|
||||||
"ButtonInstallForegroundColor": "#000000",
|
|
||||||
"ButtonTweaksForegroundColor": "#000000",
|
|
||||||
"ButtonConfigForegroundColor": "#000000",
|
|
||||||
"ButtonUpdatesForegroundColor": "#000000",
|
|
||||||
"ButtonBackgroundColor": "#F5F5F5",
|
|
||||||
"ButtonBackgroundPressedColor": "#1A1A1A",
|
|
||||||
"CheckboxMouseOverColor": "#999999",
|
|
||||||
"ButtonBackgroundMouseoverColor": "#C2C2C2",
|
|
||||||
"ButtonBackgroundSelectedColor": "#F0F0F0",
|
|
||||||
"ButtonForegroundColor": "#000000",
|
|
||||||
"ToggleButtonOnColor": "#2e77ff",
|
|
||||||
|
|
||||||
"ButtonBorderThickness": "1",
|
|
||||||
"ButtonMargin": "1",
|
|
||||||
"ButtonCornerRadius": "2",
|
|
||||||
"BorderColor": "#000000",
|
|
||||||
"BorderOpacity": "0.2",
|
|
||||||
"ShadowPulse": "Forever"
|
|
||||||
},
|
|
||||||
"Matrix": {
|
|
||||||
"CustomDialogFontSize": "12",
|
|
||||||
"CustomDialogFontSizeHeader": "14",
|
|
||||||
"CustomDialogIconSize": "25",
|
|
||||||
"CustomDialogWidth": "400",
|
|
||||||
"CustomDialogHeight": "200",
|
|
||||||
|
|
||||||
"FontSize": "12",
|
|
||||||
"FontFamily": "Arial",
|
|
||||||
"FontSizeHeading": "14",
|
|
||||||
"HeaderFontFamily": "Consolas, Monaco",
|
|
||||||
|
|
||||||
"CheckBoxBulletDecoratorFontSize": "14",
|
|
||||||
"CheckBoxMargin": "15,0,0,2",
|
|
||||||
|
|
||||||
"TabButtonFontSize": "14",
|
|
||||||
"TabButtonWidth": "100",
|
|
||||||
"TabButtonHeight": "25",
|
|
||||||
"TabRowHeightInPixels": "50",
|
|
||||||
"IconFontSize": "14",
|
|
||||||
"IconButtonSize": "35",
|
|
||||||
"WinUtilIconSize": "Auto",
|
|
||||||
"SettingsIconFontSize": "18",
|
|
||||||
|
|
||||||
"MicroWinLogoSize": "10",
|
|
||||||
|
|
||||||
"ProgressBarForegroundColor": "#222222",
|
|
||||||
"ProgressBarBackgroundColor": "Transparent",
|
|
||||||
"ProgressBarTextColor": "#cccccc",
|
|
||||||
|
|
||||||
"ComboBoxBackgroundColor": "#000000",
|
|
||||||
"LabelboxForegroundColor": "#FFEE58",
|
|
||||||
"MainForegroundColor": "#9CCC65",
|
|
||||||
"MainBackgroundColor": "#000000",
|
|
||||||
"LabelBackgroundColor": "#000000",
|
|
||||||
"LinkForegroundColor": "#add8e6",
|
|
||||||
"LinkHoverForegroundColor": "#FFFFFF",
|
|
||||||
"ComboBoxForegroundColor": "#FFEE58",
|
|
||||||
|
|
||||||
"ButtonFontSize": "12",
|
|
||||||
"ButtonFontFamily": "Arial",
|
|
||||||
"ButtonWidth": "200",
|
|
||||||
"ButtonHeight": "25",
|
|
||||||
"ConfigTabButtonFontSize": "16",
|
|
||||||
|
|
||||||
"SearchBarWidth": "200",
|
|
||||||
"SearchBarHeight": "25",
|
|
||||||
"SearchBarTextBoxFontSize": "16",
|
|
||||||
"SearchBarClearButtonFontSize": "14",
|
|
||||||
|
|
||||||
"ButtonInstallBackgroundColor": "#222222",
|
|
||||||
"ButtonTweaksBackgroundColor": "#333333",
|
|
||||||
"ButtonConfigBackgroundColor": "#444444",
|
|
||||||
"ButtonUpdatesBackgroundColor": "#555555",
|
|
||||||
"ButtonInstallForegroundColor": "#FFFFFF",
|
|
||||||
"ButtonTweaksForegroundColor": "#FFFFFF",
|
|
||||||
"ButtonConfigForegroundColor": "#FFFFFF",
|
|
||||||
"ButtonUpdatesForegroundColor": "#FFFFFF",
|
|
||||||
"ButtonBackgroundColor": "#000019",
|
|
||||||
"ButtonBackgroundPressedColor": "#FFFFFF",
|
|
||||||
"ButtonBackgroundMouseoverColor": "#A55A64",
|
|
||||||
"ButtonBackgroundSelectedColor": "#FF5733",
|
|
||||||
"ButtonForegroundColor": "#9CCC65",
|
|
||||||
"ToggleButtonOnColor": "#2e77ff",
|
|
||||||
|
|
||||||
"ButtonBorderThickness": "1",
|
|
||||||
"ButtonMargin": "1",
|
|
||||||
"ButtonCornerRadius": "2",
|
|
||||||
"BorderColor": "#FFAC1C",
|
|
||||||
"BorderOpacity": "0.8",
|
|
||||||
"ShadowPulse": "0:0:3"
|
|
||||||
},
|
|
||||||
"Dark": {
|
|
||||||
"CustomDialogFontSize": "12",
|
|
||||||
"CustomDialogFontSizeHeader": "14",
|
|
||||||
"CustomDialogIconSize": "25",
|
|
||||||
"CustomDialogWidth": "400",
|
|
||||||
"CustomDialogHeight": "200",
|
|
||||||
|
|
||||||
"FontSize": "12",
|
|
||||||
"FontFamily": "Arial",
|
|
||||||
"FontSizeHeading": "14",
|
|
||||||
"HeaderFontFamily": "Consolas, Monaco",
|
|
||||||
|
|
||||||
"CheckBoxBulletDecoratorFontSize": "14",
|
|
||||||
"CheckBoxMargin": "15,0,0,2",
|
|
||||||
|
|
||||||
"TabButtonFontSize": "14",
|
|
||||||
"TabButtonWidth": "100",
|
|
||||||
"TabButtonHeight": "25",
|
|
||||||
"TabRowHeightInPixels": "50",
|
|
||||||
"IconFontSize": "14",
|
|
||||||
"IconButtonSize": "35",
|
|
||||||
"WinUtilIconSize": "Auto",
|
|
||||||
"SettingsIconFontSize": "18",
|
|
||||||
|
|
||||||
"MicroWinLogoSize": "10",
|
|
||||||
|
|
||||||
"ProgressBarForegroundColor": "#222222",
|
|
||||||
"ProgressBarBackgroundColor": "Transparent",
|
|
||||||
"ProgressBarTextColor": "#FFFFFF",
|
|
||||||
|
|
||||||
"ComboBoxBackgroundColor": "#000000",
|
|
||||||
"LabelboxForegroundColor": "#FFEE58",
|
|
||||||
"MainForegroundColor": "#9CCC65",
|
|
||||||
"MainBackgroundColor": "#000000",
|
|
||||||
"LabelBackgroundColor": "#000000",
|
|
||||||
"LinkForegroundColor": "#add8e6",
|
|
||||||
"LinkHoverForegroundColor": "#FFFFFF",
|
|
||||||
"ComboBoxForegroundColor": "#FFEE58",
|
|
||||||
|
|
||||||
"ButtonFontSize": "12",
|
|
||||||
"ButtonFontFamily": "Arial",
|
|
||||||
"ButtonWidth": "200",
|
|
||||||
"ButtonHeight": "25",
|
|
||||||
"ConfigTabButtonFontSize": "16",
|
|
||||||
|
|
||||||
"SearchBarWidth": "200",
|
|
||||||
"SearchBarHeight": "25",
|
|
||||||
"SearchBarTextBoxFontSize": "16",
|
|
||||||
"SearchBarClearButtonFontSize": "14",
|
|
||||||
|
|
||||||
"ButtonInstallBackgroundColor": "#222222",
|
|
||||||
"ButtonTweaksBackgroundColor": "#333333",
|
|
||||||
"ButtonConfigBackgroundColor": "#444444",
|
|
||||||
"ButtonUpdatesBackgroundColor": "#555555",
|
|
||||||
"ButtonInstallForegroundColor": "#FFFFFF",
|
|
||||||
"ButtonTweaksForegroundColor": "#FFFFFF",
|
|
||||||
"ButtonConfigForegroundColor": "#FFFFFF",
|
|
||||||
"ButtonUpdatesForegroundColor": "#FFFFFF",
|
|
||||||
"ButtonBackgroundColor": "#000019",
|
|
||||||
"ButtonBackgroundPressedColor": "#9CCC65",
|
|
||||||
"ButtonBackgroundMouseoverColor": "#FF5733",
|
|
||||||
"ButtonBackgroundSelectedColor": "#FF5733",
|
|
||||||
"ButtonForegroundColor": "#9CCC65",
|
|
||||||
"ToggleButtonOnColor": "#2e77ff",
|
|
||||||
|
|
||||||
"ButtonBorderThickness": "1",
|
|
||||||
"ButtonMargin": "1",
|
|
||||||
"ButtonCornerRadius": "2",
|
|
||||||
"BorderColor": "#FFAC1C",
|
|
||||||
"BorderOpacity": "0.2",
|
|
||||||
"ShadowPulse": "Forever"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -11,21 +11,21 @@
|
|||||||
"Name": "EnableActivityFeed",
|
"Name": "EnableActivityFeed",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System",
|
||||||
"Name": "PublishUserActivities",
|
"Name": "PublishUserActivities",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System",
|
||||||
"Name": "UploadUserActivities",
|
"Name": "UploadUserActivities",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/AH"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/AH"
|
||||||
@ -1598,147 +1598,126 @@
|
|||||||
"Name": "CreateDesktopShortcutDefault",
|
"Name": "CreateDesktopShortcutDefault",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
|
||||||
{
|
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
|
||||||
"Name": "EdgeEnhanceImagesEnabled",
|
|
||||||
"Type": "DWord",
|
|
||||||
"Value": "0",
|
|
||||||
"OriginalValue": "1"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "PersonalizationReportingEnabled",
|
"Name": "PersonalizationReportingEnabled",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "ShowRecommendationsEnabled",
|
"Name": "ShowRecommendationsEnabled",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "HideFirstRunExperience",
|
"Name": "HideFirstRunExperience",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "1",
|
"Value": "1",
|
||||||
"OriginalValue": "0"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "UserFeedbackAllowed",
|
"Name": "UserFeedbackAllowed",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "ConfigureDoNotTrack",
|
"Name": "ConfigureDoNotTrack",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "1",
|
"Value": "1",
|
||||||
"OriginalValue": "0"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "AlternateErrorPagesEnabled",
|
"Name": "AlternateErrorPagesEnabled",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "EdgeCollectionsEnabled",
|
"Name": "EdgeCollectionsEnabled",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
|
||||||
{
|
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
|
||||||
"Name": "EdgeFollowEnabled",
|
|
||||||
"Type": "DWord",
|
|
||||||
"Value": "0",
|
|
||||||
"OriginalValue": "1"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "EdgeShoppingAssistantEnabled",
|
"Name": "EdgeShoppingAssistantEnabled",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "MicrosoftEdgeInsiderPromotionEnabled",
|
"Name": "MicrosoftEdgeInsiderPromotionEnabled",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "PersonalizationReportingEnabled",
|
"Name": "PersonalizationReportingEnabled",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "ShowMicrosoftRewards",
|
"Name": "ShowMicrosoftRewards",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "WebWidgetAllowed",
|
"Name": "WebWidgetAllowed",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "DiagnosticData",
|
"Name": "DiagnosticData",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "EdgeAssetDeliveryServiceEnabled",
|
"Name": "EdgeAssetDeliveryServiceEnabled",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "EdgeCollectionsEnabled",
|
"Name": "EdgeCollectionsEnabled",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "CryptoWalletEnabled",
|
"Name": "CryptoWalletEnabled",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
|
||||||
{
|
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
|
||||||
"Name": "ConfigureDoNotTrack",
|
|
||||||
"Type": "DWord",
|
|
||||||
"Value": "1",
|
|
||||||
"OriginalValue": "0"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||||
"Name": "WalletDonationEnabled",
|
"Name": "WalletDonationEnabled",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/EdgeDebloat"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/EdgeDebloat"
|
||||||
@ -1752,7 +1731,7 @@
|
|||||||
"registry": [
|
"registry": [
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent",
|
||||||
"OriginalValue": "0",
|
"OriginalValue": "<RemoveEntry>",
|
||||||
"Name": "DisableWindowsConsumerFeatures",
|
"Name": "DisableWindowsConsumerFeatures",
|
||||||
"Value": "1",
|
"Value": "1",
|
||||||
"Type": "DWord"
|
"Type": "DWord"
|
||||||
@ -1839,11 +1818,11 @@
|
|||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"Name": "AllowTelemetry",
|
"Name": "AllowTelemetry",
|
||||||
"OriginalValue": "1"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection",
|
||||||
"OriginalValue": "1",
|
"OriginalValue": "<RemoveEntry>",
|
||||||
"Name": "AllowTelemetry",
|
"Name": "AllowTelemetry",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"Type": "DWord"
|
"Type": "DWord"
|
||||||
@ -1927,21 +1906,21 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection",
|
||||||
"OriginalValue": "0",
|
"OriginalValue": "<RemoveEntry>",
|
||||||
"Name": "DoNotShowFeedbackNotifications",
|
"Name": "DoNotShowFeedbackNotifications",
|
||||||
"Value": "1",
|
"Value": "1",
|
||||||
"Type": "DWord"
|
"Type": "DWord"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent",
|
"Path": "HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent",
|
||||||
"OriginalValue": "0",
|
"OriginalValue": "<RemoveEntry>",
|
||||||
"Name": "DisableTailoredExperiencesWithDiagnosticData",
|
"Name": "DisableTailoredExperiencesWithDiagnosticData",
|
||||||
"Value": "1",
|
"Value": "1",
|
||||||
"Type": "DWord"
|
"Type": "DWord"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\AdvertisingInfo",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\AdvertisingInfo",
|
||||||
"OriginalValue": "0",
|
"OriginalValue": "<RemoveEntry>",
|
||||||
"Name": "DisabledByGroupPolicy",
|
"Name": "DisabledByGroupPolicy",
|
||||||
"Value": "1",
|
"Value": "1",
|
||||||
"Type": "DWord"
|
"Type": "DWord"
|
||||||
@ -2068,7 +2047,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Feeds",
|
"Path": "HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Feeds",
|
||||||
"OriginalValue": "1",
|
"OriginalValue": "<RemoveEntry>",
|
||||||
"Name": "EnableFeeds",
|
"Name": "EnableFeeds",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"Type": "DWord"
|
"Type": "DWord"
|
||||||
@ -2082,7 +2061,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
|
||||||
"OriginalValue": "1",
|
"OriginalValue": "<RemoveEntry>",
|
||||||
"Name": "HideSCAMeetNow",
|
"Name": "HideSCAMeetNow",
|
||||||
"Value": "1",
|
"Value": "1",
|
||||||
"Type": "DWord"
|
"Type": "DWord"
|
||||||
@ -2430,12 +2409,6 @@
|
|||||||
"Order": "a001_",
|
"Order": "a001_",
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"
|
"
|
||||||
# Check if the user has administrative privileges
|
|
||||||
if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
|
||||||
Write-Host \"Please run this script as an administrator.\"
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check if System Restore is enabled for the main drive
|
# Check if System Restore is enabled for the main drive
|
||||||
try {
|
try {
|
||||||
# Try getting restore points to check if System Restore is enabled
|
# Try getting restore points to check if System Restore is enabled
|
||||||
@ -2580,14 +2553,14 @@
|
|||||||
"Name": "TurnOffWindowsCopilot",
|
"Name": "TurnOffWindowsCopilot",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "1",
|
"Value": "1",
|
||||||
"OriginalValue": "0"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKCU:\\Software\\Policies\\Microsoft\\Windows\\WindowsCopilot",
|
"Path": "HKCU:\\Software\\Policies\\Microsoft\\Windows\\WindowsCopilot",
|
||||||
"Name": "TurnOffWindowsCopilot",
|
"Name": "TurnOffWindowsCopilot",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "1",
|
"Value": "1",
|
||||||
"OriginalValue": "0"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||||
@ -2611,6 +2584,36 @@
|
|||||||
],
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveCopilot"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveCopilot"
|
||||||
},
|
},
|
||||||
|
"WPFTweaksRecallOff": {
|
||||||
|
"Content": "Disable Recall",
|
||||||
|
"Description": "Turn Recall off",
|
||||||
|
"category": "Essential Tweaks",
|
||||||
|
"panel": "1",
|
||||||
|
"Order": "a011_",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsAI",
|
||||||
|
"Name": "DisableAIDataAnalysis",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "<RemoveEntry>"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"InvokeScript": [
|
||||||
|
"
|
||||||
|
Write-Host \"Disable Recall\"
|
||||||
|
DISM /Online /Disable-Feature /FeatureName:Recall
|
||||||
|
"
|
||||||
|
],
|
||||||
|
"UndoScript": [
|
||||||
|
"
|
||||||
|
Write-Host \"Enable Recall\"
|
||||||
|
DISM /Online /Enable-Feature /FeatureName:Recall
|
||||||
|
"
|
||||||
|
],
|
||||||
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DisableRecall"
|
||||||
|
},
|
||||||
"WPFTweaksDisableLMS1": {
|
"WPFTweaksDisableLMS1": {
|
||||||
"Content": "Disable Intel MM (vPro LMS)",
|
"Content": "Disable Intel MM (vPro LMS)",
|
||||||
"Description": "Intel LMS service is always listening on all ports and could be a huge security risk. There is no need to run LMS on home machines and even in the Enterprise there are better solutions.",
|
"Description": "Intel LMS service is always listening on all ports and could be a huge security risk. There is no need to run LMS on home machines and even in the Enterprise there are better solutions.",
|
||||||
@ -2679,80 +2682,92 @@
|
|||||||
"
|
"
|
||||||
$OneDrivePath = $($env:OneDrive)
|
$OneDrivePath = $($env:OneDrive)
|
||||||
Write-Host \"Removing OneDrive\"
|
Write-Host \"Removing OneDrive\"
|
||||||
|
|
||||||
|
# Check both traditional and Microsoft Store installations
|
||||||
$regPath = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OneDriveSetup.exe\"
|
$regPath = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OneDriveSetup.exe\"
|
||||||
|
$msStorePath = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Appx\\AppxAllUserStore\\Applications\\*OneDrive*\"
|
||||||
|
|
||||||
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
|
||||||
|
} elseif (Test-Path $msStorePath) {
|
||||||
|
Write-Host \"OneDrive appears to be installed via Microsoft Store\" -ForegroundColor Yellow
|
||||||
|
# Attempt to uninstall via winget
|
||||||
|
Start-Process -FilePath winget -ArgumentList \"uninstall -e --purge --accept-source-agreements Microsoft.OneDrive\" -NoNewWindow -Wait
|
||||||
} else {
|
} else {
|
||||||
Write-Host \"Onedrive dosn't seem to be installed anymore\" -ForegroundColor Red
|
Write-Host \"OneDrive doesn't seem to be installed\" -ForegroundColor Red
|
||||||
return
|
Write-Host \"Running cleanup if OneDrive path exists\" -ForegroundColor Red
|
||||||
}
|
|
||||||
# Check if OneDrive got Uninstalled
|
|
||||||
if (-not (Test-Path $regPath)) {
|
|
||||||
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
|
|
||||||
|
|
||||||
Write-Host \"Removing OneDrive leftovers\"
|
|
||||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:localappdata\\Microsoft\\OneDrive\"
|
|
||||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:localappdata\\OneDrive\"
|
|
||||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:programdata\\Microsoft OneDrive\"
|
|
||||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:systemdrive\\OneDriveTemp\"
|
|
||||||
reg delete \"HKEY_CURRENT_USER\\Software\\Microsoft\\OneDrive\" -f
|
|
||||||
# check if directory is empty before removing:
|
|
||||||
If ((Get-ChildItem \"$OneDrivePath\" -Recurse | Measure-Object).Count -eq 0) {
|
|
||||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$OneDrivePath\"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host \"Remove Onedrive from explorer sidebar\"
|
# Check if OneDrive got Uninstalled (both paths)
|
||||||
Set-ItemProperty -Path \"HKCR:\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Name \"System.IsPinnedToNameSpaceTree\" -Value 0
|
if (Test-Path $OneDrivePath) {
|
||||||
Set-ItemProperty -Path \"HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Name \"System.IsPinnedToNameSpaceTree\" -Value 0
|
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
|
||||||
|
|
||||||
Write-Host \"Removing run hook for new users\"
|
Write-Host \"Removing OneDrive leftovers\"
|
||||||
reg load \"hku\\Default\" \"C:\\Users\\Default\\NTUSER.DAT\"
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:localappdata\\Microsoft\\OneDrive\"
|
||||||
reg delete \"HKEY_USERS\\Default\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" /v \"OneDriveSetup\" /f
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:localappdata\\OneDrive\"
|
||||||
reg unload \"hku\\Default\"
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:programdata\\Microsoft OneDrive\"
|
||||||
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$env:systemdrive\\OneDriveTemp\"
|
||||||
|
reg delete \"HKEY_CURRENT_USER\\Software\\Microsoft\\OneDrive\" -f
|
||||||
|
# check if directory is empty before removing:
|
||||||
|
If ((Get-ChildItem \"$OneDrivePath\" -Recurse | Measure-Object).Count -eq 0) {
|
||||||
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$OneDrivePath\"
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host \"Removing startmenu entry\"
|
Write-Host \"Remove Onedrive from explorer sidebar\"
|
||||||
Remove-Item -Force -ErrorAction SilentlyContinue \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\OneDrive.lnk\"
|
Set-ItemProperty -Path \"HKCR:\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Name \"System.IsPinnedToNameSpaceTree\" -Value 0
|
||||||
|
Set-ItemProperty -Path \"HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Name \"System.IsPinnedToNameSpaceTree\" -Value 0
|
||||||
|
|
||||||
Write-Host \"Removing scheduled task\"
|
Write-Host \"Removing run hook for new users\"
|
||||||
Get-ScheduledTask -TaskPath '\\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false
|
reg load \"hku\\Default\" \"C:\\Users\\Default\\NTUSER.DAT\"
|
||||||
|
reg delete \"HKEY_USERS\\Default\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" /v \"OneDriveSetup\" /f
|
||||||
|
reg unload \"hku\\Default\"
|
||||||
|
|
||||||
# Add Shell folders restoring default locations
|
Write-Host \"Removing autostart key\"
|
||||||
Write-Host \"Shell Fixing\"
|
reg delete \"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\" /v \"OneDrive\" /f
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"AppData\" -Value \"$env:userprofile\\AppData\\Roaming\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Cache\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\INetCache\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Cookies\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\INetCookies\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Favorites\" -Value \"$env:userprofile\\Favorites\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"History\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\History\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Local AppData\" -Value \"$env:userprofile\\AppData\\Local\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Music\" -Value \"$env:userprofile\\Music\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Video\" -Value \"$env:userprofile\\Videos\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"NetHood\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Network Shortcuts\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"PrintHood\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Printer Shortcuts\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Programs\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Recent\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Recent\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"SendTo\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\SendTo\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Start Menu\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Startup\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Templates\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Templates\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{374DE290-123F-4565-9164-39C4925E467B}\" -Value \"$env:userprofile\\Downloads\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Desktop\" -Value \"$env:userprofile\\Desktop\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Pictures\" -Value \"$env:userprofile\\Pictures\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Personal\" -Value \"$env:userprofile\\Documents\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{F42EE2D3-909F-4907-8871-4C22FC0BF756}\" -Value \"$env:userprofile\\Documents\" -Type ExpandString
|
|
||||||
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{0DDD015D-B06C-45D5-8C4C-F59713854639}\" -Value \"$env:userprofile\\Pictures\" -Type ExpandString
|
|
||||||
Write-Host \"Restarting explorer\"
|
|
||||||
taskkill.exe /F /IM \"explorer.exe\"
|
|
||||||
Start-Process \"explorer.exe\"
|
|
||||||
|
|
||||||
Write-Host \"Waiting for explorer to complete loading\"
|
Write-Host \"Removing startmenu entry\"
|
||||||
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.\"
|
Remove-Item -Force -ErrorAction SilentlyContinue \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\OneDrive.lnk\"
|
||||||
Write-Host \"If there are Files missing afterwards, please Login to Onedrive.com and Download them manually\" -ForegroundColor Yellow
|
|
||||||
Start-Sleep 5
|
Write-Host \"Removing scheduled task\"
|
||||||
|
Get-ScheduledTask -TaskPath '\\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false
|
||||||
|
|
||||||
|
# Add Shell folders restoring default locations
|
||||||
|
Write-Host \"Shell Fixing\"
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"AppData\" -Value \"$env:userprofile\\AppData\\Roaming\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Cache\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\INetCache\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Cookies\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\INetCookies\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Favorites\" -Value \"$env:userprofile\\Favorites\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"History\" -Value \"$env:userprofile\\AppData\\Local\\Microsoft\\Windows\\History\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Local AppData\" -Value \"$env:userprofile\\AppData\\Local\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Music\" -Value \"$env:userprofile\\Music\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Video\" -Value \"$env:userprofile\\Videos\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"NetHood\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Network Shortcuts\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"PrintHood\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Printer Shortcuts\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Programs\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Recent\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Recent\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"SendTo\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\SendTo\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Start Menu\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Startup\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Templates\" -Value \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Templates\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{374DE290-123F-4565-9164-39C4925E467B}\" -Value \"$env:userprofile\\Downloads\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Desktop\" -Value \"$env:userprofile\\Desktop\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"My Pictures\" -Value \"$env:userprofile\\Pictures\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"Personal\" -Value \"$env:userprofile\\Documents\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{F42EE2D3-909F-4907-8871-4C22FC0BF756}\" -Value \"$env:userprofile\\Documents\" -Type ExpandString
|
||||||
|
Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\" -Name \"{0DDD015D-B06C-45D5-8C4C-F59713854639}\" -Value \"$env:userprofile\\Pictures\" -Type ExpandString
|
||||||
|
Write-Host \"Restarting explorer\"
|
||||||
|
taskkill.exe /F /IM \"explorer.exe\"
|
||||||
|
Start-Process \"explorer.exe\"
|
||||||
|
|
||||||
|
Write-Host \"Waiting for explorer to complete loading\"
|
||||||
|
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
|
||||||
|
Start-Sleep 5
|
||||||
} else {
|
} else {
|
||||||
Write-Host \"Something went Wrong during the Unistallation of OneDrive\" -ForegroundColor Red
|
Write-Host \"Nothing to Cleanup with OneDrive\" -ForegroundColor Red
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
],
|
],
|
||||||
@ -2764,6 +2779,48 @@
|
|||||||
],
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveOnedrive"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveOnedrive"
|
||||||
},
|
},
|
||||||
|
"WPFTweaksRazerBlock": {
|
||||||
|
"Content": "Block Razer Software Installs",
|
||||||
|
"Description": "Blocks ALL Razer Software installations. The hardware works fine without any software.",
|
||||||
|
"category": "z__Advanced Tweaks - CAUTION",
|
||||||
|
"panel": "1",
|
||||||
|
"Order": "a031_",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DriverSearching",
|
||||||
|
"Name": "SearchOrderConfig",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1",
|
||||||
|
"Type": "DWord"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Device Installer",
|
||||||
|
"Name": "DisableCoInstallers",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"InvokeScript": [
|
||||||
|
"
|
||||||
|
$RazerPath = \"C:\\Windows\\Installer\\Razer\"
|
||||||
|
Remove-Item $RazerPath -Recurse -Force
|
||||||
|
New-Item -Path \"C:\\Windows\\Installer\\\" -Name \"Razer\" -ItemType \"directory\"
|
||||||
|
$Acl = Get-Acl $RazerPath
|
||||||
|
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule(\"NT AUTHORITY\\SYSTEM\",\"Write\",\"ContainerInherit,ObjectInherit\",\"None\",\"Deny\")
|
||||||
|
$Acl.SetAccessRule($Ar)
|
||||||
|
Set-Acl $RazerPath $Acl
|
||||||
|
"
|
||||||
|
],
|
||||||
|
"UndoScript": [
|
||||||
|
"
|
||||||
|
$RazerPath = \"C:\\Windows\\Installer\\Razer\"
|
||||||
|
Remove-Item $RazerPath -Recurse -Force
|
||||||
|
New-Item -Path \"C:\\Windows\\Installer\\\" -Name \"Razer\" -ItemType \"directory\"
|
||||||
|
"
|
||||||
|
],
|
||||||
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/RazerBlock"
|
||||||
|
},
|
||||||
"WPFTweaksDisableNotifications": {
|
"WPFTweaksDisableNotifications": {
|
||||||
"Content": "Disable Notification Tray/Calendar",
|
"Content": "Disable Notification Tray/Calendar",
|
||||||
"Description": "Disables all Notifications INCLUDING Calendar",
|
"Description": "Disables all Notifications INCLUDING Calendar",
|
||||||
@ -2776,7 +2833,7 @@
|
|||||||
"Name": "DisableNotificationCenter",
|
"Name": "DisableNotificationCenter",
|
||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "1",
|
"Value": "1",
|
||||||
"OriginalValue": "0"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\PushNotifications",
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\PushNotifications",
|
||||||
@ -3135,18 +3192,35 @@
|
|||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\GameDVR",
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\GameDVR",
|
||||||
"Name": "AllowGameDVR",
|
"Name": "AllowGameDVR",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "1",
|
"OriginalValue": "<RemoveEntry>",
|
||||||
"Type": "DWord"
|
"Type": "DWord"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DVR"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DVR"
|
||||||
},
|
},
|
||||||
"WPFTweaksTeredo": {
|
"WPFTweaksIPv46": {
|
||||||
"Content": "Disable Teredo",
|
"Content": "Prefer IPv4 over IPv6",
|
||||||
"Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency.",
|
"Description": "To set the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.",
|
||||||
"category": "Essential Tweaks",
|
"category": "Essential Tweaks",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a005_",
|
"Order": "a005_",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
|
||||||
|
"Name": "DisabledComponents",
|
||||||
|
"Value": "32",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/IPv46"
|
||||||
|
},
|
||||||
|
"WPFTweaksTeredo": {
|
||||||
|
"Content": "Disable Teredo",
|
||||||
|
"Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency, but may cause problems with some games",
|
||||||
|
"category": "z__Advanced Tweaks - CAUTION",
|
||||||
|
"panel": "1",
|
||||||
|
"Order": "a023_",
|
||||||
"registry": [
|
"registry": [
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
|
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
|
||||||
@ -3162,7 +3236,7 @@
|
|||||||
"UndoScript": [
|
"UndoScript": [
|
||||||
"netsh interface teredo set state default"
|
"netsh interface teredo set state default"
|
||||||
],
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/Teredo"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo"
|
||||||
},
|
},
|
||||||
"WPFTweaksDisableipsix": {
|
"WPFTweaksDisableipsix": {
|
||||||
"Content": "Disable IPv6",
|
"Content": "Disable IPv6",
|
||||||
@ -3228,6 +3302,38 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a100_",
|
"Order": "a100_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize",
|
||||||
|
"Name": "AppsUseLightTheme",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1",
|
||||||
|
"Type": "DWord"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize",
|
||||||
|
"Name": "SystemUsesLightTheme",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"InvokeScript": [
|
||||||
|
"
|
||||||
|
Invoke-WinUtilExplorerUpdate
|
||||||
|
if ($sync.ThemeButton.Content -eq [char]0xF08C) {
|
||||||
|
Invoke-WinutilThemeChange -theme \"Auto\"
|
||||||
|
}
|
||||||
|
"
|
||||||
|
],
|
||||||
|
"UndoScript": [
|
||||||
|
"
|
||||||
|
Invoke-WinUtilExplorerUpdate
|
||||||
|
if ($sync.ThemeButton.Content -eq [char]0xF08C) {
|
||||||
|
Invoke-WinutilThemeChange -theme \"Auto\"
|
||||||
|
}
|
||||||
|
"
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/DarkMode"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/DarkMode"
|
||||||
},
|
},
|
||||||
"WPFToggleBingSearch": {
|
"WPFToggleBingSearch": {
|
||||||
@ -3237,6 +3343,15 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a101_",
|
"Order": "a101_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Search",
|
||||||
|
"Name": "BingSearchEnabled",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/BingSearch"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/BingSearch"
|
||||||
},
|
},
|
||||||
"WPFToggleNumLock": {
|
"WPFToggleNumLock": {
|
||||||
@ -3246,6 +3361,22 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a102_",
|
"Order": "a102_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKU:\\.Default\\Control Panel\\Keyboard",
|
||||||
|
"Name": "InitialKeyboardIndicators",
|
||||||
|
"Value": "2",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Control Panel\\Keyboard",
|
||||||
|
"Name": "InitialKeyboardIndicators",
|
||||||
|
"Value": "2",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/NumLock"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/NumLock"
|
||||||
},
|
},
|
||||||
"WPFToggleVerboseLogon": {
|
"WPFToggleVerboseLogon": {
|
||||||
@ -3255,6 +3386,15 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a103_",
|
"Order": "a103_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System",
|
||||||
|
"Name": "VerboseStatus",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/VerboseLogon"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/VerboseLogon"
|
||||||
},
|
},
|
||||||
"WPFToggleSnapWindow": {
|
"WPFToggleSnapWindow": {
|
||||||
@ -3264,6 +3404,15 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a104_",
|
"Order": "a104_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Control Panel\\Desktop",
|
||||||
|
"Name": "WindowArrangementActive",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "String"
|
||||||
|
}
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/SnapWindow"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/SnapWindow"
|
||||||
},
|
},
|
||||||
"WPFToggleSnapFlyout": {
|
"WPFToggleSnapFlyout": {
|
||||||
@ -3273,6 +3422,25 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a105_",
|
"Order": "a105_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||||
|
"Name": "EnableSnapAssistFlyout",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"InvokeScript": [
|
||||||
|
"
|
||||||
|
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||||
|
"
|
||||||
|
],
|
||||||
|
"UndoScript": [
|
||||||
|
"
|
||||||
|
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||||
|
"
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/SnapFlyout"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/SnapFlyout"
|
||||||
},
|
},
|
||||||
"WPFToggleSnapSuggestion": {
|
"WPFToggleSnapSuggestion": {
|
||||||
@ -3282,6 +3450,25 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a106_",
|
"Order": "a106_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||||
|
"Name": "SnapAssist",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"InvokeScript": [
|
||||||
|
"
|
||||||
|
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||||
|
"
|
||||||
|
],
|
||||||
|
"UndoScript": [
|
||||||
|
"
|
||||||
|
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||||
|
"
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/SnapSuggestion"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/SnapSuggestion"
|
||||||
},
|
},
|
||||||
"WPFToggleMouseAcceleration": {
|
"WPFToggleMouseAcceleration": {
|
||||||
@ -3291,6 +3478,29 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a107_",
|
"Order": "a107_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Control Panel\\Mouse",
|
||||||
|
"Name": "MouseSpeed",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Control Panel\\Mouse",
|
||||||
|
"Name": "MouseThreshold1",
|
||||||
|
"Value": "6",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Control Panel\\Mouse",
|
||||||
|
"Name": "MouseThreshold2",
|
||||||
|
"Value": "10",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/MouseAcceleration"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/MouseAcceleration"
|
||||||
},
|
},
|
||||||
"WPFToggleStickyKeys": {
|
"WPFToggleStickyKeys": {
|
||||||
@ -3300,6 +3510,15 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a108_",
|
"Order": "a108_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Control Panel\\Accessibility\\StickyKeys",
|
||||||
|
"Name": "Flags",
|
||||||
|
"Value": "510",
|
||||||
|
"OriginalValue": "58",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/StickyKeys"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/StickyKeys"
|
||||||
},
|
},
|
||||||
"WPFToggleHiddenFiles": {
|
"WPFToggleHiddenFiles": {
|
||||||
@ -3309,6 +3528,25 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a200_",
|
"Order": "a200_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||||
|
"Name": "Hidden",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"InvokeScript": [
|
||||||
|
"
|
||||||
|
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||||
|
"
|
||||||
|
],
|
||||||
|
"UndoScript": [
|
||||||
|
"
|
||||||
|
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||||
|
"
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/HiddenFiles"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/HiddenFiles"
|
||||||
},
|
},
|
||||||
"WPFToggleShowExt": {
|
"WPFToggleShowExt": {
|
||||||
@ -3318,6 +3556,25 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a201_",
|
"Order": "a201_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||||
|
"Name": "HideFileExt",
|
||||||
|
"Value": "0",
|
||||||
|
"OriginalValue": "1",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"InvokeScript": [
|
||||||
|
"
|
||||||
|
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||||
|
"
|
||||||
|
],
|
||||||
|
"UndoScript": [
|
||||||
|
"
|
||||||
|
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||||
|
"
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/ShowExt"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/ShowExt"
|
||||||
},
|
},
|
||||||
"WPFToggleTaskbarSearch": {
|
"WPFToggleTaskbarSearch": {
|
||||||
@ -3327,6 +3584,15 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a202_",
|
"Order": "a202_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Search",
|
||||||
|
"Name": "SearchboxTaskbarMode",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskbarSearch"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskbarSearch"
|
||||||
},
|
},
|
||||||
"WPFToggleTaskView": {
|
"WPFToggleTaskView": {
|
||||||
@ -3336,6 +3602,15 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a203_",
|
"Order": "a203_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||||
|
"Name": "ShowTaskViewButton",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskView"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskView"
|
||||||
},
|
},
|
||||||
"WPFToggleTaskbarWidgets": {
|
"WPFToggleTaskbarWidgets": {
|
||||||
@ -3345,6 +3620,15 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a204_",
|
"Order": "a204_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||||
|
"Name": "TaskbarDa",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskbarWidgets"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskbarWidgets"
|
||||||
},
|
},
|
||||||
"WPFToggleTaskbarAlignment": {
|
"WPFToggleTaskbarAlignment": {
|
||||||
@ -3354,6 +3638,15 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a204_",
|
"Order": "a204_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||||
|
"Name": "TaskbarAl",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskbarAlignment"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskbarAlignment"
|
||||||
},
|
},
|
||||||
"WPFToggleDetailedBSoD": {
|
"WPFToggleDetailedBSoD": {
|
||||||
@ -3363,6 +3656,22 @@
|
|||||||
"panel": "2",
|
"panel": "2",
|
||||||
"Order": "a205_",
|
"Order": "a205_",
|
||||||
"Type": "Toggle",
|
"Type": "Toggle",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\CrashControl",
|
||||||
|
"Name": "DisplayParameters",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\CrashControl",
|
||||||
|
"Name": "DisableEmoticon",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/DetailedBSoD"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/DetailedBSoD"
|
||||||
},
|
},
|
||||||
"WPFOOSUbutton": {
|
"WPFOOSUbutton": {
|
||||||
@ -3379,25 +3688,9 @@
|
|||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a040_",
|
"Order": "a040_",
|
||||||
"Type": "Combobox",
|
"Type": "Combobox",
|
||||||
"ComboItems": "Default DHCP Google Cloudflare Cloudflare_Malware Cloudflare_Malware_Adult Open_DNS Quad9 AdGuard_Ads_Trackers AdGuard_Ads_Trackers_Malware_Adult",
|
"ComboItems": "Default DHCP Google Cloudflare Cloudflare_Malware Cloudflare_Malware_Adult Open_DNS Quad9 AdGuard_Ads_Trackers AdGuard_Ads_Trackers_Malware_Adult dns0.eu_Open dns0.eu_ZERO dns0.eu_KIDS",
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/changedns"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/changedns"
|
||||||
},
|
},
|
||||||
"WPFTweaksbutton": {
|
|
||||||
"Content": "Run Tweaks",
|
|
||||||
"category": "z__Advanced Tweaks - CAUTION",
|
|
||||||
"panel": "1",
|
|
||||||
"Order": "a041_",
|
|
||||||
"Type": "Button",
|
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/button"
|
|
||||||
},
|
|
||||||
"WPFUndoall": {
|
|
||||||
"Content": "Undo Selected Tweaks",
|
|
||||||
"category": "z__Advanced Tweaks - CAUTION",
|
|
||||||
"panel": "1",
|
|
||||||
"Order": "a042_",
|
|
||||||
"Type": "Button",
|
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/Undoall"
|
|
||||||
},
|
|
||||||
"WPFAddUltPerf": {
|
"WPFAddUltPerf": {
|
||||||
"Content": "Add and Activate Ultimate Performance Profile",
|
"Content": "Add and Activate Ultimate Performance Profile",
|
||||||
"category": "Performance Plans",
|
"category": "Performance Plans",
|
||||||
@ -3415,14 +3708,5 @@
|
|||||||
"Type": "Button",
|
"Type": "Button",
|
||||||
"ButtonWidth": "300",
|
"ButtonWidth": "300",
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Performance-Plans/RemoveUltPerf"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Performance-Plans/RemoveUltPerf"
|
||||||
},
|
|
||||||
"WPFWinUtilShortcut": {
|
|
||||||
"Content": "Create WinUtil Shortcut",
|
|
||||||
"category": "Shortcuts",
|
|
||||||
"panel": "2",
|
|
||||||
"Order": "a082_",
|
|
||||||
"Type": "Button",
|
|
||||||
"ButtonWidth": "300",
|
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Shortcuts/Shortcut"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,9 +68,9 @@ graph TD
|
|||||||
### 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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Clone the Fork
|
### Clone the Fork
|
||||||
!!! tip
|
!!! tip
|
@ -1,18 +1,27 @@
|
|||||||
### Launch Issues:
|
## Launch Issues
|
||||||
|
|
||||||
- Windows Security (formerly Defender) and other anti-virus software are known to block the script. The script gets flagged due to the fact that it requires administrator privileges & makes drastic system changes.
|
### Blocked by anti-virus
|
||||||
- If possible: Allow script in Anti-Virus software settings.
|
Windows Security (formerly Defender) and other anti-virus software are known to block the script. The script gets flagged due to the fact that it requires administrator privileges & makes drastic system changes.
|
||||||
|
|
||||||
- If you are having TLS 1.2 issues, or are having trouble resolving `christitus.com/win` then run with the following command:
|
To resolve this, allow/whitelist the script in your anti-virus software settings, or temporarily disable real-time protection. Since the project is open source, you may audit the code if security is a concern.
|
||||||
|
|
||||||
|
### Download not working
|
||||||
|
If `christitus.com/win` is not working, or you want to download the code from GitHub directly, you can use the direct download link:
|
||||||
|
|
||||||
```ps1
|
```ps1
|
||||||
[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;iex(New-Object Net.WebClient).DownloadString('https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1')
|
irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1 | iex
|
||||||
```
|
```
|
||||||
|
|
||||||
- If you are unable to resolve `christitus.com/win` and are getting errors launching the tool, it might be due to India blocking GitHub's content domain and preventing downloads.
|
If you are seeing errors referencing TLS or security, you may be running an older version of Windows where TLS 1.2 is not the default security protocol used for network connections. The following commands will force .NET to use TLS 1.2, and download the script directly using .NET instead of PowerShell:
|
||||||
- Source: <https://timesofindia.indiatimes.com/gadgets-news/github-content-domain-blocked-for-these-indian-users-reports/articleshow/96687992.cms>
|
|
||||||
|
|
||||||
If you are still having issues try using a **VPN**, or changing your **DNS provider** to one of following two providers:
|
```ps1
|
||||||
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
|
iex (New-Object Net.WebClient).DownloadString('https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1')
|
||||||
|
```
|
||||||
|
|
||||||
|
If it still isn't working and you live in India, it might be due to India blocking GitHub's content domain and preventing downloads. See more on [Times of India](https://timesofindia.indiatimes.com/gadgets-news/github-content-domain-blocked-for-these-indian-users-reports/articleshow/96687992.cms).
|
||||||
|
|
||||||
|
If you are still having issues, try using a **VPN**, or changing your **DNS provider** to one of following two providers:
|
||||||
|
|
||||||
| Provider | Primary DNS | Secondary DNS |
|
| Provider | Primary DNS | Secondary DNS |
|
||||||
|:------------:|:------------:|:-------------:|
|
|:------------:|:------------:|:-------------:|
|
||||||
@ -20,160 +29,186 @@ If you are still having issues try using a **VPN**, or changing your **DNS provi
|
|||||||
| Google | `8.8.8.8` | `8.8.4.4` |
|
| Google | `8.8.8.8` | `8.8.4.4` |
|
||||||
|
|
||||||
|
|
||||||
|
### Script blocked by Execution Policy
|
||||||
|
1. Ensure you are running PowerShell as admin: Press `Windows Key`+`X` and select *PowerShell (Admin)* in Windows 10, or `Windows Terminal (Admin)` in Windows 11.
|
||||||
|
2. In the PowerShell window, type this to allow unsigned code to execute and run the installation script:
|
||||||
|
```ps1
|
||||||
|
Set-ExecutionPolicy Unrestricted -Scope Process -Force
|
||||||
|
irm christitus.com/win | iex
|
||||||
|
```
|
||||||
|
|
||||||
- Script doesn't run/PowerShell crashes:
|
## Runtime Issues
|
||||||
1. Press Windows Key+X and select 'PowerShell (Admin)' (Windows 10) or 'Windows Terminal (Admin)' (Windows 11)
|
|
||||||
2. Run:
|
|
||||||
```ps1
|
|
||||||
Set-ExecutionPolicy Unrestricted -Scope Process -Force
|
|
||||||
```
|
|
||||||
3. Run:
|
|
||||||
```ps1
|
|
||||||
irm christitus.com/win | iex
|
|
||||||
```
|
|
||||||
|
|
||||||
### Other Issues:
|
### WinGet configuration
|
||||||
|
If you have not installed anything using PowerShell before, you may be prompted to configure WinGet. This requires user interaction on first run. You will need to manually type `y` into the PowerShell console and press enter to continue. Once you do it the first time, you will not be prompted again.
|
||||||
|
|
||||||
|
### MicroWin: Error `0x80041031`
|
||||||
|
This error code typically indicates an issue related to Windows Management Instrumentation (WMI). Here are a few steps you can try to resolve the issue:
|
||||||
|
|
||||||
|
1. **Reboot Your Computer:**
|
||||||
|
|
||||||
|
Sometimes, a simple reboot can resolve temporary issues. Restart your computer and try mounting the ISO again.
|
||||||
|
|
||||||
|
3. **Check for System Corruption:**
|
||||||
|
|
||||||
|
Run the System File Checker (SFC) utility to scan and repair system files that may be corrupted.
|
||||||
|
```powershell
|
||||||
|
sfc /scannow
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Update Your System:**
|
||||||
|
|
||||||
|
Make sure your operating system is up-to-date. Check for Windows updates and install any pending updates.
|
||||||
|
|
||||||
|
5. **Check WMI Service:**
|
||||||
|
|
||||||
|
Ensure that the Windows Management Instrumentation (WMI) service is running. You can do this through the Services application:
|
||||||
|
- Press `Win`+`R` to open the Run dialog.
|
||||||
|
- Type `services.msc` and press Enter.
|
||||||
|
- Locate *Windows Management Instrumentation* in the list.
|
||||||
|
- Make sure to set its status to "Running" and the startup type to "Automatic".
|
||||||
|
|
||||||
|
6. **Check for Security Software Interference:**
|
||||||
|
|
||||||
|
Security software can sometimes interfere with WMI operations. Temporarily disable your anti-virus or security software and check if the issue persists. WMI is a common attack/infection vector, so many anti-virus programs will limit its usage.
|
||||||
|
|
||||||
|
7. **Event Viewer:**
|
||||||
|
|
||||||
|
Check the Event Viewer for more detailed error information. Look for entries related to the `80041031` error and check if there are any additional details that can help identify the cause.
|
||||||
|
|
||||||
|
- Press `Win`+`X` and select *Event Viewer*.
|
||||||
|
- Navigate to *Windows Logs* > *Application* or *System*.
|
||||||
|
- Look for entries with the source related to WMI or the application use to mount the ISO.
|
||||||
|
|
||||||
|
8. **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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
## Windows Issues
|
||||||
|
|
||||||
|
### Windows takes longer to shut down
|
||||||
|
This could be for a number of reasons:
|
||||||
|
- Turn on fast startup: Press `Windows key`+`R`, then type:
|
||||||
|
```bat
|
||||||
|
control /name Microsoft.PowerOptions /page pageGlobalSettings
|
||||||
|
```
|
||||||
|
- If that doesn't work, disable Hibernation:
|
||||||
|
- Press `Windows Key`+`X` and select *PowerShell (Admin)* in Windows 10, or `Windows Terminal (Admin)` in Windows 11.
|
||||||
|
- In the PowerShell window, type:
|
||||||
|
```bat
|
||||||
|
powercfg /H off
|
||||||
|
```
|
||||||
|
Related issue: [#69](https://github.com/ChrisTitusTech/winutil/issues/69)
|
||||||
|
|
||||||
|
### Windows Search does not work
|
||||||
|
Enable Background Apps. Related issues: [#69](https://github.com/ChrisTitusTech/winutil/issues/69) [95](https://github.com/ChrisTitusTech/winutil/issues/95) [#232](https://github.com/ChrisTitusTech/winutil/issues/232)
|
||||||
|
|
||||||
|
### Xbox Game Bar Activation Broken
|
||||||
|
Set the Xbox Accessory Management Service to Automatic:
|
||||||
|
|
||||||
- Windows taking longer to shut down:
|
|
||||||
- [#69](https://github.com/ChrisTitusTech/winutil/issues/69) Turn on fast startup: Press Windows key + R, then type:
|
|
||||||
```
|
|
||||||
control /name Microsoft.PowerOptions /page pageGlobalSettings
|
|
||||||
```
|
|
||||||
- If that doesn't work, Disable Hibernation: Press Windows Key+X and select 'PowerShell (Admin)' (Windows 10) or 'Windows Terminal (Admin)' (Windows 11) and enter:
|
|
||||||
```ps1
|
|
||||||
powercfg /H off
|
|
||||||
```
|
|
||||||
- [#69](https://github.com/ChrisTitusTech/winutil/issues/69) [95](https://github.com/ChrisTitusTech/winutil/issues/95) [#232](https://github.com/ChrisTitusTech/winutil/issues/232) Windows Search does not work: Enable Background Apps
|
|
||||||
- [#198](https://github.com/ChrisTitusTech/winutil/issues/198) Xbox Game Bar Activation Broken: Set the Xbox Accessory Management Service to Automatic
|
|
||||||
```ps1
|
```ps1
|
||||||
Get-Service -Name "XboxGipSvc" | Set-Service -StartupType Automatic
|
Get-Service -Name "XboxGipSvc" | Set-Service -StartupType Automatic
|
||||||
```
|
```
|
||||||
|
|
||||||
- Winget requires interaction on first run: Manually type 'y' and 'enter' into the PowerShell console to continue
|
Related issue: [#198](https://github.com/ChrisTitusTech/winutil/issues/198)
|
||||||
- (Windows 11) Quick Settings no longer works: Launch the Script and click 'Enable Action Center'
|
|
||||||
|
|
||||||
- Explorer no longer launches: Go to Control Panel, File Explorer Options, Change the 'Open File Explorer to' option to 'This PC'.
|
### Windows 11: Quick Settings no longer works
|
||||||
|
Launch the Script and click *Enable Action Center*.
|
||||||
|
|
||||||
### Battery drains too fast.
|
### Explorer (file browser) no longer launches
|
||||||
* When your battery on the laptop drains too fast, please perform these steps and report the results back to the Winutil community.
|
- Press `Windows key`+`R` then type:
|
||||||
|
```bat
|
||||||
|
control /name Microsoft.FolderOptions
|
||||||
|
```
|
||||||
|
- Change the *Open File Explorer to* option to *This PC*.
|
||||||
|
|
||||||
|
### Battery drains too fast
|
||||||
|
If you're using a laptop or tablet and find your battery drains too fast, please try the below troubleshooting steps, and report the results back to the Winutil community.
|
||||||
|
|
||||||
1. **Check Battery Health:**
|
1. **Check Battery Health:**
|
||||||
- Open a Command Prompt as an administrator.
|
- Press `Windows Key`+`X` and select *PowerShell (Admin)* in Windows 10, or `Windows Terminal (Admin)` in Windows 11.
|
||||||
- Run the following command to generate a battery report:
|
- Run the following command to generate a battery report:
|
||||||
```powershell
|
```powershell
|
||||||
powercfg /batteryreport /output "C:\battery_report.html"
|
powercfg /batteryreport /output "C:\battery_report.html"
|
||||||
```
|
```
|
||||||
- Open the generated HTML report to review information about battery health and usage.
|
- Open the generated HTML report to review information about battery health and usage. A battery with poor health may hold less charge, discharge faster, or cause other issues.
|
||||||
|
|
||||||
2. **Review Power Settings:**
|
2. **Review Power Settings:**
|
||||||
- Go to "Settings" > "System" > "Power & sleep."
|
- Open the Settings app, and go to *System* > *Power & sleep*.
|
||||||
- Adjust power plan settings based on your preferences and usage patterns.
|
- Adjust power plan settings based on your preferences and usage patterns.
|
||||||
- Click on "Additional power settings" to access advanced power settings.
|
- Click on *Additional power settings* to access advanced power settings that may help.
|
||||||
|
|
||||||
3. **Identify Power-Hungry Apps:**
|
3. **Identify Power-Hungry Apps:**
|
||||||
- Right-click on the taskbar and select "Task Manager."
|
- Right-click on the taskbar and select *Task Manager*.
|
||||||
- Navigate to the "Processes" tab to identify applications with high CPU or memory usage.
|
- Navigate to the *Processes* tab to identify applications with high CPU or memory usage.
|
||||||
- Consider closing unnecessary background applications.
|
- Consider reconfiguring, closing, disabling, or uninstalling applications that use a lot of resources.
|
||||||
|
|
||||||
4. **Update Drivers:**
|
4. **Update Drivers:**
|
||||||
- Visit your laptop manufacturer's website or use Windows Update to check for driver updates.
|
- Visit your device manufacturer's website or use Windows Update to check for driver updates.
|
||||||
- Ensure graphics, chipset, and other essential drivers are up to date.
|
- Ensure graphics, chipset, and other essential drivers are up to date.
|
||||||
|
|
||||||
5. **Check for Windows Updates:**
|
5. **Check for Windows Updates:**
|
||||||
- Go to "Settings" > "Update & Security" > "Windows Update."
|
- Open the Settings app, and go to *Update & Security* > *Windows Update*.
|
||||||
- Check for and install any available updates for your operating system.
|
- Check for and install any available updates for your operating system.
|
||||||
|
|
||||||
6. **Reduce Screen Brightness:**
|
6. **Reduce Screen Brightness:**
|
||||||
- Adjust screen brightness based on your preferences and lighting conditions.
|
- Open the Settings app, and go to *System* > *Display*.
|
||||||
- Go to "Settings" > "System" > "Display" to adjust brightness.
|
- Adjust screen brightness based on your preferences and lighting conditions.
|
||||||
|
|
||||||
7. **Battery Saver Mode:**
|
7. **Enable Battery Saver:**
|
||||||
- Go to "Settings" > "System" > "Battery."
|
- Open the Settings app, and go to *System* > *Battery*.
|
||||||
- Turn on "Battery saver" to limit background activity and conserve power.
|
- Turn on *Battery saver* to limit background activity and conserve power.
|
||||||
|
|
||||||
8. **Check Power Usage in Settings:**
|
8. **Check Power Usage in Settings:**
|
||||||
- Go to "Settings" > "System" > "Battery" > "Battery usage by app."
|
- Open the Settings app, and go to *System* > *Battery* > *Battery usage by app*.
|
||||||
- Review the list of apps and their power usage.
|
- Review the list of apps and their power usage. Disable or uninstall any you don't need.
|
||||||
|
|
||||||
9. **Check Background Apps:**
|
9. **Check Background Apps:**
|
||||||
- Go to "Settings" > "Privacy" > "Background apps."
|
- Open the Settings app, and go to *Privacy* > *Background apps*.
|
||||||
- Disable unnecessary apps running in the background.
|
- Disable or uninstall unnecessary apps running in the background.
|
||||||
|
|
||||||
10. **Use Powercfg for Analysis:**
|
10. **Use `powercfg` for Analysis:**
|
||||||
- Open a Command Prompt as an administrator.
|
- Press `Windows Key`+`X` and select *PowerShell (Admin)* in Windows 10, or `Windows Terminal (Admin)` in Windows 11.
|
||||||
- Run the following command to analyze energy usage and generate a report:
|
- Run the following command to analyze energy usage and generate a report:
|
||||||
```powershell
|
```powershell
|
||||||
powercfg /energy /output "C:\energy_report.html"
|
powercfg /energy /output "C:\energy_report.html"
|
||||||
```
|
```
|
||||||
- Open the generated HTML report to identify energy consumption patterns.
|
- Open the generated HTML report to identify energy consumption patterns.
|
||||||
|
|
||||||
11. **Review Event Viewer:**
|
11. **Review Event Logs:**
|
||||||
- Open Event Viewer by searching for it in the Start menu.
|
- Open Event Viewer by searching for it in the Start menu.
|
||||||
- Navigate to "Windows Logs" > "System."
|
- Navigate to *Windows Logs* > *System*.
|
||||||
- Look for events with the source "Power-Troubleshooter" to identify power-related events.
|
- Look for events with the source *Power-Troubleshooter* to identify power-related events. These may highlight battery, input power, and other issues.
|
||||||
|
|
||||||
12. **Check Wake-up Sources:**
|
12. **Check Wake-up Sources:**
|
||||||
- Open a Command Prompt as an administrator.
|
- Press `Windows Key`+`X` and select *PowerShell (Admin)* in Windows 10, or `Windows Terminal (Admin)` in Windows 11.
|
||||||
- Use the command `powercfg /requests` to identify processes preventing sleep.
|
- Use the command `powercfg /requests` to identify processes preventing sleep.
|
||||||
- Check Task Scheduler for tasks waking up the computer.
|
|
||||||
- Use the command `powercfg /waketimers` to view active wake timers.
|
- Use the command `powercfg /waketimers` to view active wake timers.
|
||||||
|
- Check Task Scheduler to see if any of the discovered processes are scheduled to start on boot or at regular intervals.
|
||||||
|
|
||||||
13. **Resource Monitor:**
|
13. **Advanced Identification of Power-Hungry Apps:**
|
||||||
- Open Resource Monitor from the Start menu.
|
- Open Resource Monitor from the Start menu.
|
||||||
- Navigate to the "CPU" tab and identify processes with high CPU usage.
|
- Navigate to the *CPU*, *Memory*, *Network*, and other tabs to identify processes with high resource usage.
|
||||||
|
- Consider reconfiguring, closing, disabling, or uninstalling applications that use a lot of resources.
|
||||||
|
|
||||||
14. **Windows Settings - Activity History:**
|
14. **Disable Activity History:**
|
||||||
- In "Settings," go to "Privacy" > "Activity history."
|
- Open the Settings app, and go to *Privacy* > *Activity history*.
|
||||||
- Turn off "Let Windows collect my activities from this PC."
|
- Turn off *Let Windows collect my activities from this PC*.
|
||||||
|
|
||||||
15. **Network Adapters:**
|
15. **Prevent Network Adapters From Waking PC:**
|
||||||
- Open Device Manager by searching for it in the Start menu.
|
- Open Device Manager by searching for it in the Start menu.
|
||||||
- Locate your network adapter, right-click, and go to "Properties."
|
- Locate your network adapter, right-click, and go to *Properties*.
|
||||||
- Under the "Power Management" tab, uncheck the option that allows the device to wake the computer.
|
- Under the *Power Management* tab, uncheck the option that allows the device to wake the computer.
|
||||||
|
|
||||||
16. **Review Installed Applications:**
|
16. **Review Installed Applications:**
|
||||||
- Manually review installed applications by searching for "Add or remove programs" in the Start menu.
|
- Manually review installed applications by searching for *Add or remove programs* in the Start menu.
|
||||||
- Check settings/preferences of individual applications for power-related options.
|
- Check settings/preferences of individual applications for power-related options.
|
||||||
- Uninstall unnecessary or problematic software.
|
- Uninstall unnecessary or problematic software.
|
||||||
|
|
||||||
* By following these detailed instructions, you should be able to thoroughly diagnose and address battery drain issues on your Windows laptop. Adjust settings as needed to optimize power management and improve battery life.
|
These troubleshooting steps are generic, but should help in most situations. You should have these key takeaways:
|
||||||
|
- Battery health is the most significant limiter on your device's runtime. A battery in poor health usually cannot be made to last like it used to, simply by closing some applications. Consider replacing your battery.
|
||||||
### Troubleshoot errors during Microwin usage
|
- Background applications that use CPU and memory, make lots of or large network requests, read/write to disk frequently, or that keep your PC awake when it could be conserving energy are the next major concern. Avoid installing programs you don't need, only use programs you trust, and configure applications to use as little power and run as infrequently as possible.
|
||||||
|
- Windows performs a lot of tasks that may affect battery life by default. Changing settings, stopping scheduled tasks, and disabling features can help the system stay in lower power states to conserve battery.
|
||||||
#### Error `0x80041031`
|
- Bad chargers, inconsistent power input, and high temperatures will cause batteries to degrade and discharge faster. Use trusted high-quality chargers, ensure input power is steady, clean any fans or airflow ports, and keep the battery/PC cool.
|
||||||
|
|
||||||
* This error code typically indicates an issue related to Windows Management Instrumentation (WMI). Here are a few steps you can try to resolve the issue:
|
|
||||||
|
|
||||||
1. **Reboot Your Computer:**
|
|
||||||
Sometimes, a simple reboot can resolve temporary issues. Restart your computer and try mounting the ISO again.
|
|
||||||
|
|
||||||
2. **Check for System Corruption:**
|
|
||||||
Run the System File Checker (SFC) utility to scan and repair system files that may be corrupted.
|
|
||||||
```powershell
|
|
||||||
sfc /scannow
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Update Your System:**
|
|
||||||
Make sure your operating system is up-to-date. Check for Windows updates and install any pending updates.
|
|
||||||
|
|
||||||
4. **Check WMI Service:**
|
|
||||||
Ensure that the Windows Management Instrumentation (WMI) service is running. You can do this through the Services application:
|
|
||||||
- Press `Win + R` to open the Run dialog.
|
|
||||||
- Type `services.msc` and press Enter.
|
|
||||||
- Locate "Windows Management Instrumentation" in the list.
|
|
||||||
- Make sure to set its status to "Running" and the startup type to "Automatic."
|
|
||||||
|
|
||||||
5. **Check for Security Software Interference:**
|
|
||||||
Security software can sometimes interfere with WMI operations. Temporarily disable your antivirus or security software and check if the issue persists.
|
|
||||||
|
|
||||||
6. **Event Viewer:**
|
|
||||||
Check the Event Viewer for more detailed error information. Look for entries related to the `80041031` error and check if there are any additional details that can help identify the cause.
|
|
||||||
|
|
||||||
- Press `Win + X` and select "Event Viewer."
|
|
||||||
- Navigate to "Windows Logs" -> "Application" or "System."
|
|
||||||
- Look for entries with the source related to WMI or the application use to mount the ISO.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
* 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.
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 213 KiB |
Binary file not shown.
Before Width: | Height: | Size: 339 KiB After Width: | Height: | Size: 122 KiB |
@ -1,3 +0,0 @@
|
|||||||
--8<-- ".github/CONTRIBUTING.md"
|
|
||||||
|
|
||||||
<!-- The content is sourced from "CONTRIBUTING.md," located in the root directory of the project. -->
|
|
65
docs/dev/features/Legacy-Windows-Panels/printer.md
Normal file
65
docs/dev/features/Legacy-Windows-Panels/printer.md
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
# Printer Settings
|
||||||
|
|
||||||
|
Last Updated: 2024-08-31
|
||||||
|
|
||||||
|
|
||||||
|
!!! info
|
||||||
|
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BEGIN CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<!-- END CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Preview Code</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"Content": "Printer Settings",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
|
"panel": "2",
|
||||||
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Function: Invoke-WPFControlPanel
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
function Invoke-WPFControlPanel {
|
||||||
|
<#
|
||||||
|
|
||||||
|
.SYNOPSIS
|
||||||
|
Opens the requested legacy panel
|
||||||
|
|
||||||
|
.PARAMETER Panel
|
||||||
|
The panel to open
|
||||||
|
|
||||||
|
#>
|
||||||
|
param($Panel)
|
||||||
|
|
||||||
|
switch ($Panel) {
|
||||||
|
"WPFPanelcontrol" {cmd /c control}
|
||||||
|
"WPFPanelnetwork" {cmd /c ncpa.cpl}
|
||||||
|
"WPFPanelpower" {cmd /c powercfg.cpl}
|
||||||
|
"WPFPanelregion" {cmd /c intl.cpl}
|
||||||
|
"WPFPanelsound" {cmd /c mmsys.cpl}
|
||||||
|
"WPFPanelprinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
||||||
|
"WPFPanelsystem" {cmd /c sysdm.cpl}
|
||||||
|
"WPFPaneluser" {cmd /c "control userpasswords2"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BEGIN SECOND CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<!-- END SECOND CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
|
||||||
|
[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/../config/feature.json)
|
||||||
|
|
38
docs/dev/features/PowerShell-Profile/PSProfileInstall.md
Normal file
38
docs/dev/features/PowerShell-Profile/PSProfileInstall.md
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# Install CTT PowerShell Profile
|
||||||
|
|
||||||
|
Last Updated: 2024-10-01
|
||||||
|
|
||||||
|
|
||||||
|
!!! info
|
||||||
|
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BEGIN CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<!-- END CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Preview Code</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"Content": "Install CTT PowerShell Profile",
|
||||||
|
"category": "Powershell Profile",
|
||||||
|
"panel": "2",
|
||||||
|
"Order": "a083_",
|
||||||
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
|
"link": "https://christitustech.github.io/winutil/dev/features/Powershell-Profile/PSProfileInstall"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BEGIN SECOND CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<!-- END SECOND CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
|
||||||
|
[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/config/feature.json)
|
||||||
|
|
38
docs/dev/features/PowerShell-Profile/PSProfileUninstall.md
Normal file
38
docs/dev/features/PowerShell-Profile/PSProfileUninstall.md
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# Uninstall CTT PowerShell Profile
|
||||||
|
|
||||||
|
Last Updated: 2024-10-01
|
||||||
|
|
||||||
|
|
||||||
|
!!! info
|
||||||
|
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BEGIN CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<!-- END CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Preview Code</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"Content": "Uninstall CTT PowerShell Profile",
|
||||||
|
"category": "Powershell Profile",
|
||||||
|
"panel": "2",
|
||||||
|
"Order": "a084_",
|
||||||
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
|
"link": "https://christitustech.github.io/winutil/dev/features/Powershell-Profile/PSProfileUninstall"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BEGIN SECOND CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<!-- END SECOND CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
|
||||||
|
[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/config/feature.json)
|
||||||
|
|
91
docs/dev/tweaks/Essential-Tweaks/DisableRecall.md
Normal file
91
docs/dev/tweaks/Essential-Tweaks/DisableRecall.md
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# Disable Microsoft Recall
|
||||||
|
|
||||||
|
Last Updated: 2024-10-24
|
||||||
|
|
||||||
|
|
||||||
|
!!! info
|
||||||
|
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
||||||
|
## Description
|
||||||
|
|
||||||
|
Disables MS Recall built into Windows since 24H2.
|
||||||
|
|
||||||
|
<!-- BEGIN CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<!-- END CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Preview Code</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
|
"WPFTweaksRecallOff": {
|
||||||
|
"Content": "Disable Recall",
|
||||||
|
"Description": "Turn Recall off",
|
||||||
|
"category": "Essential Tweaks",
|
||||||
|
"panel": "1",
|
||||||
|
"Order": "a011_",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
|
||||||
|
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsAI",
|
||||||
|
"Name": "DisableAIDataAnalysis",
|
||||||
|
"Type": "DWord",
|
||||||
|
"Value": "1",
|
||||||
|
"OriginalValue": "0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"InvokeScript": [
|
||||||
|
"
|
||||||
|
Write-Host \"Disable Recall\"
|
||||||
|
DISM /Online /Disable-Feature /FeatureName:Recall
|
||||||
|
"
|
||||||
|
],
|
||||||
|
"UndoScript": [
|
||||||
|
"
|
||||||
|
Write-Host \"Enable Recall\"
|
||||||
|
DISM /Online /Enable-Feature /FeatureName:Recall
|
||||||
|
"
|
||||||
|
],
|
||||||
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DisableRecall"
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Invoke Script
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
|
||||||
|
Write-Host "Disable Recall"
|
||||||
|
DISM /Online /Disable-Feature /FeatureName:Recall
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
## Undo Script
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
|
||||||
|
Write-Host "Enable Recall"
|
||||||
|
DISM /Online /Enable-Feature /FeatureName:Recall
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
## Registry Changes
|
||||||
|
Applications and System Components store and retrieve configuration data to modify windows settings, so we can use the registry to change many settings in one place.
|
||||||
|
|
||||||
|
|
||||||
|
You can find information about the registry on [Wikipedia](https://www.wikiwand.com/en/Windows_Registry) and [Microsoft's Website](https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry).
|
||||||
|
|
||||||
|
### Registry Key: DisableAIDataAnalysis
|
||||||
|
|
||||||
|
**Type:** DWord
|
||||||
|
|
||||||
|
**Original Value:** 0
|
||||||
|
|
||||||
|
**New Value:** 1
|
||||||
|
|
||||||
|
<!-- BEGIN SECOND CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<!-- END SECOND CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
|
||||||
|
[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/config/tweaks.json)
|
63
docs/dev/tweaks/Essential-Tweaks/IPv46.md
Normal file
63
docs/dev/tweaks/Essential-Tweaks/IPv46.md
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# Prefer IPv4 over IPv6
|
||||||
|
|
||||||
|
Last Updated: 2024-08-27
|
||||||
|
|
||||||
|
|
||||||
|
!!! info
|
||||||
|
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
||||||
|
## Description
|
||||||
|
|
||||||
|
To set the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.
|
||||||
|
|
||||||
|
<!-- BEGIN CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<!-- END CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Preview Code</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"Content": "Prefer IPv4 over IPv6",
|
||||||
|
"Description": "To set the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.",
|
||||||
|
"category": "Essential Tweaks",
|
||||||
|
"panel": "1",
|
||||||
|
"Order": "a005_",
|
||||||
|
"registry": [
|
||||||
|
{
|
||||||
|
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
|
||||||
|
"Name": "DisabledComponents",
|
||||||
|
"Value": "32",
|
||||||
|
"OriginalValue": "0",
|
||||||
|
"Type": "DWord"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/IPv46"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Registry Changes
|
||||||
|
Applications and System Components store and retrieve configuration data to modify windows settings, so we can use the registry to change many settings in one place.
|
||||||
|
|
||||||
|
|
||||||
|
You can find information about the registry on [Wikipedia](https://www.wikiwand.com/en/Windows_Registry) and [Microsoft's Website](https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry).
|
||||||
|
|
||||||
|
### Registry Key: DisabledComponents
|
||||||
|
|
||||||
|
**Type:** DWord
|
||||||
|
|
||||||
|
**Original Value:** 0
|
||||||
|
|
||||||
|
**New Value:** 32
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BEGIN SECOND CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
<!-- END SECOND CUSTOM CONTENT -->
|
||||||
|
|
||||||
|
|
||||||
|
[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/config/tweaks.json)
|
||||||
|
|
@ -69,7 +69,7 @@ function Invoke-WPFTweakPS7{
|
|||||||
Write-Host "Powershell 7 is already installed."
|
Write-Host "Powershell 7 is already installed."
|
||||||
} else {
|
} else {
|
||||||
Write-Host "Installing Powershell 7..."
|
Write-Host "Installing Powershell 7..."
|
||||||
Invoke-WinUtilWingetProgram -Action Install -Programs @("Microsoft.PowerShell")
|
Install-WinUtilProgramWinget -Action Install -Programs @("Microsoft.PowerShell")
|
||||||
}
|
}
|
||||||
$targetTerminalName = "PowerShell"
|
$targetTerminalName = "PowerShell"
|
||||||
}
|
}
|
||||||
@ -105,10 +105,10 @@ function Invoke-WPFTweakPS7{
|
|||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
## Function: Invoke-WinUtilWingetProgram
|
## Function: Install-WinUtilProgramWinget
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Function Invoke-WinUtilWingetProgram {
|
Function Install-WinUtilProgramWinget {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Runs the designated action on the provided programs using Winget
|
Runs the designated action on the provided programs using Winget
|
||||||
|
@ -1,113 +0,0 @@
|
|||||||
# Create WinUtil Shortcut
|
|
||||||
|
|
||||||
Last Updated: 2024-08-07
|
|
||||||
|
|
||||||
|
|
||||||
!!! info
|
|
||||||
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
|
||||||
|
|
||||||
|
|
||||||
<!-- BEGIN CUSTOM CONTENT -->
|
|
||||||
|
|
||||||
<!-- END CUSTOM CONTENT -->
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Preview Code</summary>
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"Content": "Create WinUtil Shortcut",
|
|
||||||
"category": "Shortcuts",
|
|
||||||
"panel": "2",
|
|
||||||
"Order": "a082_",
|
|
||||||
"Type": "Button",
|
|
||||||
"ButtonWidth": "300",
|
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Shortcuts/Shortcut"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## Function: Invoke-WPFShortcut
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
function Invoke-WPFShortcut {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Creates a shortcut and prompts for a save location
|
|
||||||
|
|
||||||
.PARAMETER ShortcutToAdd
|
|
||||||
The name of the shortcut to add
|
|
||||||
|
|
||||||
.PARAMETER RunAsAdmin
|
|
||||||
A boolean value to make 'Run as administrator' property on (true) or off (false), defaults to off
|
|
||||||
|
|
||||||
#>
|
|
||||||
param(
|
|
||||||
$ShortcutToAdd,
|
|
||||||
[bool]$RunAsAdmin = $false
|
|
||||||
)
|
|
||||||
|
|
||||||
# Preper the Shortcut Fields and add an a Custom Icon if it's available, else don't add a Custom Icon.
|
|
||||||
|
|
||||||
Switch ($ShortcutToAdd) {
|
|
||||||
"WinUtil" {
|
|
||||||
# Use Powershell 7 if installed and fallback to PS5 if not
|
|
||||||
if (Get-Command "pwsh" -ErrorAction SilentlyContinue) {
|
|
||||||
$shell = "pwsh.exe"
|
|
||||||
} else {
|
|
||||||
$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`"`'"
|
|
||||||
|
|
||||||
$DestinationName = "WinUtil.lnk"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Show a File Dialog Browser, to let the User choose the Name and Location of where to save the Shortcut
|
|
||||||
$FileBrowser = New-Object System.Windows.Forms.SaveFileDialog
|
|
||||||
$FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop')
|
|
||||||
$FileBrowser.Filter = "Shortcut Files (*.lnk)|*.lnk"
|
|
||||||
$FileBrowser.FileName = $DestinationName
|
|
||||||
|
|
||||||
# Do an Early Return if the Save Operation was canceled by User's Input.
|
|
||||||
$FileBrowserResult = $FileBrowser.ShowDialog()
|
|
||||||
$DialogResultEnum = New-Object System.Windows.Forms.DialogResult
|
|
||||||
if (-not ($FileBrowserResult -eq $DialogResultEnum::OK)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# Prepare the Shortcut paramter
|
|
||||||
$WshShell = New-Object -comObject WScript.Shell
|
|
||||||
$Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName)
|
|
||||||
$Shortcut.TargetPath = $shell
|
|
||||||
$Shortcut.Arguments = $shellArgs
|
|
||||||
if (Test-Path -Path $winutildir["logo.ico"]) {
|
|
||||||
$shortcut.IconLocation = $winutildir["logo.ico"]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Save the Shortcut to disk
|
|
||||||
$Shortcut.Save()
|
|
||||||
|
|
||||||
if ($RunAsAdmin -eq $true) {
|
|
||||||
$bytes = [System.IO.File]::ReadAllBytes($FileBrowser.FileName)
|
|
||||||
# Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex
|
|
||||||
$bytes[0x15] = $bytes[0x15] -bor 0x20
|
|
||||||
[System.IO.File]::WriteAllBytes($FileBrowser.FileName, $bytes)
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Shortcut for $ShortcutToAdd has been saved to $($FileBrowser.FileName) with 'Run as administrator' set to $RunAsAdmin"
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
<!-- BEGIN SECOND CUSTOM CONTENT -->
|
|
||||||
|
|
||||||
<!-- END SECOND CUSTOM CONTENT -->
|
|
||||||
|
|
||||||
|
|
||||||
[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/config/tweaks.json)
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
|||||||
# Disable Teredo
|
# Disable Teredo
|
||||||
|
|
||||||
Last Updated: 2024-08-07
|
Last Updated: 2024-08-27
|
||||||
|
|
||||||
|
|
||||||
!!! info
|
!!! info
|
||||||
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
Teredo network tunneling is a ipv6 feature that can cause additional latency.
|
Teredo network tunneling is a ipv6 feature that can cause additional latency, but may cause problems with some games
|
||||||
|
|
||||||
<!-- BEGIN CUSTOM CONTENT -->
|
<!-- BEGIN CUSTOM CONTENT -->
|
||||||
|
|
||||||
@ -19,10 +19,10 @@ Teredo network tunneling is a ipv6 feature that can cause additional latency.
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"Content": "Disable Teredo",
|
"Content": "Disable Teredo",
|
||||||
"Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency.",
|
"Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency, but may cause problems with some games",
|
||||||
"category": "Essential Tweaks",
|
"category": "z__Advanced Tweaks - CAUTION",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a005_",
|
"Order": "a023_",
|
||||||
"registry": [
|
"registry": [
|
||||||
{
|
{
|
||||||
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
|
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
|
||||||
@ -38,7 +38,7 @@ Teredo network tunneling is a ipv6 feature that can cause additional latency.
|
|||||||
"UndoScript": [
|
"UndoScript": [
|
||||||
"netsh interface teredo set state default"
|
"netsh interface teredo set state default"
|
||||||
],
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/Teredo"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
172
docs/devdocs.md
172
docs/devdocs.md
@ -3,106 +3,106 @@
|
|||||||
|
|
||||||
## Tweaks
|
## Tweaks
|
||||||
|
|
||||||
### z--Advanced-Tweaks---CAUTION
|
|
||||||
|
|
||||||
- [Adobe Debloat](dev/tweaks/z--Advanced-Tweaks---CAUTION/DebloatAdobe.md)
|
|
||||||
- [Adobe Network Block](dev/tweaks/z--Advanced-Tweaks---CAUTION/BlockAdobeNet.md)
|
|
||||||
- [Disable Background Apps](dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableBGapps.md)
|
|
||||||
- [Disable Fullscreen Optimizations](dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableFSO.md)
|
|
||||||
- [Disable Intel MM (vPro LMS)](dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableLMS1.md)
|
|
||||||
- [Disable IPv6](dev/tweaks/z--Advanced-Tweaks---CAUTION/Disableipsix.md)
|
|
||||||
- [Disable Microsoft Copilot](dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveCopilot.md)
|
|
||||||
- [Disable Notification Tray/Calendar](dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableNotifications.md)
|
|
||||||
- [DNS](dev/tweaks/z--Advanced-Tweaks---CAUTION/changedns.md)
|
|
||||||
- [Remove ALL MS Store Apps - NOT RECOMMENDED](dev/tweaks/z--Advanced-Tweaks---CAUTION/DeBloat.md)
|
|
||||||
- [Remove Home and Gallery from explorer](dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveHomeGallery.md)
|
|
||||||
- [Remove Microsoft Edge](dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveEdge.md)
|
|
||||||
- [Remove OneDrive](dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveOnedrive.md)
|
|
||||||
- [Run OO Shutup 10](dev/tweaks/z--Advanced-Tweaks---CAUTION/OOSUbutton.md)
|
|
||||||
- [Run Tweaks](dev/tweaks/z--Advanced-Tweaks---CAUTION/button.md)
|
|
||||||
- [Set Classic Right-Click Menu ](dev/tweaks/z--Advanced-Tweaks---CAUTION/RightClickMenu.md)
|
|
||||||
- [Set Display for Performance](dev/tweaks/z--Advanced-Tweaks---CAUTION/Display.md)
|
|
||||||
- [Set Time to UTC (Dual Boot)](dev/tweaks/z--Advanced-Tweaks---CAUTION/UTC.md)
|
|
||||||
- [Undo Selected Tweaks](dev/tweaks/z--Advanced-Tweaks---CAUTION/Undoall.md)
|
|
||||||
### Essential-Tweaks
|
### Essential-Tweaks
|
||||||
|
|
||||||
- [Change Windows Terminal default: PowerShell 5 -> PowerShell 7](dev/tweaks/Essential-Tweaks/Powershell7.md)
|
- [Change Windows Terminal default: PowerShell 5 -> PowerShell 7](../docs/dev/tweaks/Essential-Tweaks/Powershell7.md)
|
||||||
- [Create Restore Point](dev/tweaks/Essential-Tweaks/RestorePoint.md)
|
- [Create Restore Point](../docs/dev/tweaks/Essential-Tweaks/RestorePoint.md)
|
||||||
- [Debloat Edge](dev/tweaks/Essential-Tweaks/EdgeDebloat.md)
|
- [Debloat Edge](../docs/dev/tweaks/Essential-Tweaks/EdgeDebloat.md)
|
||||||
- [Delete Temporary Files](dev/tweaks/Essential-Tweaks/DeleteTempFiles.md)
|
- [Delete Temporary Files](../docs/dev/tweaks/Essential-Tweaks/DeleteTempFiles.md)
|
||||||
- [Disable Activity History](dev/tweaks/Essential-Tweaks/AH.md)
|
- [Disable Activity History](../docs/dev/tweaks/Essential-Tweaks/AH.md)
|
||||||
- [Disable ConsumerFeatures](dev/tweaks/Essential-Tweaks/ConsumerFeatures.md)
|
- [Disable ConsumerFeatures](../docs/dev/tweaks/Essential-Tweaks/ConsumerFeatures.md)
|
||||||
- [Disable GameDVR](dev/tweaks/Essential-Tweaks/DVR.md)
|
- [Disable GameDVR](../docs/dev/tweaks/Essential-Tweaks/DVR.md)
|
||||||
- [Disable Hibernation](dev/tweaks/Essential-Tweaks/Hiber.md)
|
- [Disable Hibernation](../docs/dev/tweaks/Essential-Tweaks/Hiber.md)
|
||||||
- [Disable Homegroup](dev/tweaks/Essential-Tweaks/Home.md)
|
- [Disable Homegroup](../docs/dev/tweaks/Essential-Tweaks/Home.md)
|
||||||
- [Disable Location Tracking](dev/tweaks/Essential-Tweaks/Loc.md)
|
- [Disable Location Tracking](../docs/dev/tweaks/Essential-Tweaks/Loc.md)
|
||||||
- [Disable Powershell 7 Telemetry](dev/tweaks/Essential-Tweaks/Powershell7Tele.md)
|
- [Disable Powershell 7 Telemetry](../docs/dev/tweaks/Essential-Tweaks/Powershell7Tele.md)
|
||||||
- [Disable Storage Sense](dev/tweaks/Essential-Tweaks/Storage.md)
|
- [Disable Storage Sense](../docs/dev/tweaks/Essential-Tweaks/Storage.md)
|
||||||
- [Disable Telemetry](dev/tweaks/Essential-Tweaks/Tele.md)
|
- [Disable Telemetry](../docs/dev/tweaks/Essential-Tweaks/Tele.md)
|
||||||
- [Disable Teredo](dev/tweaks/Essential-Tweaks/Teredo.md)
|
- [Disable Wifi-Sense](../docs/dev/tweaks/Essential-Tweaks/Wifi.md)
|
||||||
- [Disable Wifi-Sense](dev/tweaks/Essential-Tweaks/Wifi.md)
|
- [Enable End Task With Right Click](../docs/dev/tweaks/Essential-Tweaks/EndTaskOnTaskbar.md)
|
||||||
- [Enable End Task With Right Click](dev/tweaks/Essential-Tweaks/EndTaskOnTaskbar.md)
|
- [Prefer IPv4 over IPv6](../docs/dev/tweaks/Essential-Tweaks/IPv46.md)
|
||||||
- [Run Disk Cleanup](dev/tweaks/Essential-Tweaks/DiskCleanup.md)
|
- [Run Disk Cleanup](../docs/dev/tweaks/Essential-Tweaks/DiskCleanup.md)
|
||||||
- [Set Hibernation as default (good for laptops)](dev/tweaks/Essential-Tweaks/LaptopHibernation.md)
|
- [Set Hibernation as default (good for laptops)](../docs/dev/tweaks/Essential-Tweaks/LaptopHibernation.md)
|
||||||
- [Set Services to Manual](dev/tweaks/Essential-Tweaks/Services.md)
|
- [Set Services to Manual](../docs/dev/tweaks/Essential-Tweaks/Services.md)
|
||||||
### Shortcuts
|
### Shortcuts
|
||||||
|
|
||||||
- [Create WinUtil Shortcut](dev/tweaks/Shortcuts/Shortcut.md)
|
- [Create WinUtil Shortcut](../docs/dev/tweaks/Shortcuts/Shortcut.md)
|
||||||
|
### z--Advanced-Tweaks---CAUTION
|
||||||
|
|
||||||
|
- [Adobe Debloat](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DebloatAdobe.md)
|
||||||
|
- [Adobe Network Block](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/BlockAdobeNet.md)
|
||||||
|
- [Disable Background Apps](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableBGapps.md)
|
||||||
|
- [Disable Fullscreen Optimizations](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableFSO.md)
|
||||||
|
- [Disable Intel MM (vPro LMS)](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableLMS1.md)
|
||||||
|
- [Disable IPv6](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/Disableipsix.md)
|
||||||
|
- [Disable Microsoft Copilot](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveCopilot.md)
|
||||||
|
- [Disable Notification Tray/Calendar](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableNotifications.md)
|
||||||
|
- [Disable Teredo](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo.md)
|
||||||
|
- [DNS](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/changedns.md)
|
||||||
|
- [Remove ALL MS Store Apps - NOT RECOMMENDED](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DeBloat.md)
|
||||||
|
- [Remove Home and Gallery from explorer](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveHomeGallery.md)
|
||||||
|
- [Remove Microsoft Edge](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveEdge.md)
|
||||||
|
- [Remove OneDrive](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveOnedrive.md)
|
||||||
|
- [Run OO Shutup 10](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/OOSUbutton.md)
|
||||||
|
- [Set Classic Right-Click Menu ](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/RightClickMenu.md)
|
||||||
|
- [Set Display for Performance](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/Display.md)
|
||||||
|
- [Set Time to UTC (Dual Boot)](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/UTC.md)
|
||||||
### Customize-Preferences
|
### Customize-Preferences
|
||||||
|
|
||||||
- [Bing Search in Start Menu](dev/tweaks/Customize-Preferences/BingSearch.md)
|
- [Bing Search in Start Menu](../docs/dev/tweaks/Customize-Preferences/BingSearch.md)
|
||||||
- [Center Taskbar Items](dev/tweaks/Customize-Preferences/TaskbarAlignment.md)
|
- [Center Taskbar Items](../docs/dev/tweaks/Customize-Preferences/TaskbarAlignment.md)
|
||||||
- [Dark Theme for Windows](dev/tweaks/Customize-Preferences/DarkMode.md)
|
- [Dark Theme for Windows](../docs/dev/tweaks/Customize-Preferences/DarkMode.md)
|
||||||
- [Detailed BSoD](dev/tweaks/Customize-Preferences/DetailedBSoD.md)
|
- [Detailed BSoD](../docs/dev/tweaks/Customize-Preferences/DetailedBSoD.md)
|
||||||
- [Mouse Acceleration](dev/tweaks/Customize-Preferences/MouseAcceleration.md)
|
- [Mouse Acceleration](../docs/dev/tweaks/Customize-Preferences/MouseAcceleration.md)
|
||||||
- [NumLock on Startup](dev/tweaks/Customize-Preferences/NumLock.md)
|
- [NumLock on Startup](../docs/dev/tweaks/Customize-Preferences/NumLock.md)
|
||||||
- [Search Button in Taskbar](dev/tweaks/Customize-Preferences/TaskbarSearch.md)
|
- [Search Button in Taskbar](../docs/dev/tweaks/Customize-Preferences/TaskbarSearch.md)
|
||||||
- [Show File Extensions](dev/tweaks/Customize-Preferences/ShowExt.md)
|
- [Show File Extensions](../docs/dev/tweaks/Customize-Preferences/ShowExt.md)
|
||||||
- [Show Hidden Files](dev/tweaks/Customize-Preferences/HiddenFiles.md)
|
- [Show Hidden Files](../docs/dev/tweaks/Customize-Preferences/HiddenFiles.md)
|
||||||
- [Snap Assist Flyout](dev/tweaks/Customize-Preferences/SnapFlyout.md)
|
- [Snap Assist Flyout](../docs/dev/tweaks/Customize-Preferences/SnapFlyout.md)
|
||||||
- [Snap Assist Suggestion](dev/tweaks/Customize-Preferences/SnapSuggestion.md)
|
- [Snap Assist Suggestion](../docs/dev/tweaks/Customize-Preferences/SnapSuggestion.md)
|
||||||
- [Snap Window](dev/tweaks/Customize-Preferences/SnapWindow.md)
|
- [Snap Window](../docs/dev/tweaks/Customize-Preferences/SnapWindow.md)
|
||||||
- [Sticky Keys](dev/tweaks/Customize-Preferences/StickyKeys.md)
|
- [Sticky Keys](../docs/dev/tweaks/Customize-Preferences/StickyKeys.md)
|
||||||
- [Task View Button in Taskbar](dev/tweaks/Customize-Preferences/TaskView.md)
|
- [Task View Button in Taskbar](../docs/dev/tweaks/Customize-Preferences/TaskView.md)
|
||||||
- [Verbose Messages During Logon](dev/tweaks/Customize-Preferences/VerboseLogon.md)
|
- [Verbose Messages During Logon](../docs/dev/tweaks/Customize-Preferences/VerboseLogon.md)
|
||||||
- [Widgets Button in Taskbar](dev/tweaks/Customize-Preferences/TaskbarWidgets.md)
|
- [Widgets Button in Taskbar](../docs/dev/tweaks/Customize-Preferences/TaskbarWidgets.md)
|
||||||
### Performance-Plans
|
### Performance-Plans
|
||||||
|
|
||||||
- [Add and Activate Ultimate Performance Profile](dev/tweaks/Performance-Plans/AddUltPerf.md)
|
- [Add and Activate Ultimate Performance Profile](../docs/dev/tweaks/Performance-Plans/AddUltPerf.md)
|
||||||
- [Remove Ultimate Performance Profile](dev/tweaks/Performance-Plans/RemoveUltPerf.md)
|
- [Remove Ultimate Performance Profile](../docs/dev/tweaks/Performance-Plans/RemoveUltPerf.md)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
### Legacy-Windows-Panels
|
|
||||||
|
|
||||||
- [Control Panel](dev/features/Legacy-Windows-Panels/control.md)
|
|
||||||
- [Network Connections](dev/features/Legacy-Windows-Panels/network.md)
|
|
||||||
- [Power Panel](dev/features/Legacy-Windows-Panels/power.md)
|
|
||||||
- [Region](dev/features/Legacy-Windows-Panels/region.md)
|
|
||||||
- [Sound Settings](dev/features/Legacy-Windows-Panels/sound.md)
|
|
||||||
- [System Properties](dev/features/Legacy-Windows-Panels/system.md)
|
|
||||||
- [User Accounts](dev/features/Legacy-Windows-Panels/user.md)
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
- [Remove Adobe Creative Cloud](dev/features/Fixes/RunAdobeCCCleanerTool.md)
|
- [Remove Adobe Creative Cloud](../docs/dev/features/Fixes/RunAdobeCCCleanerTool.md)
|
||||||
- [Reset Network](dev/features/Fixes/Network.md)
|
- [Reset Network](../docs/dev/features/Fixes/Network.md)
|
||||||
- [Reset Windows Update](dev/features/Fixes/Update.md)
|
- [Reset Windows Update](../docs/dev/features/Fixes/Update.md)
|
||||||
- [Set Up Autologin](dev/features/Fixes/Autologin.md)
|
- [Set Up Autologin](../docs/dev/features/Fixes/Autologin.md)
|
||||||
- [System Corruption Scan](dev/features/Fixes/DISM.md)
|
- [System Corruption Scan](../docs/dev/features/Fixes/DISM.md)
|
||||||
- [WinGet Reinstall](dev/features/Fixes/Winget.md)
|
- [WinGet Reinstall](../docs/dev/features/Fixes/Winget.md)
|
||||||
|
### Legacy-Windows-Panels
|
||||||
|
|
||||||
|
- [Control Panel](../docs/dev/features/Legacy-Windows-Panels/control.md)
|
||||||
|
- [Network Connections](../docs/dev/features/Legacy-Windows-Panels/network.md)
|
||||||
|
- [Power Panel](../docs/dev/features/Legacy-Windows-Panels/power.md)
|
||||||
|
- [Printer Settings](../docs/dev/features/Legacy-Windows-Panels/printer.md)
|
||||||
|
- [Region](../docs/dev/features/Legacy-Windows-Panels/region.md)
|
||||||
|
- [Sound Settings](../docs/dev/features/Legacy-Windows-Panels/sound.md)
|
||||||
|
- [System Properties](../docs/dev/features/Legacy-Windows-Panels/system.md)
|
||||||
|
- [User Accounts](../docs/dev/features/Legacy-Windows-Panels/user.md)
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
- [All .Net Framework (2,3,4)](dev/features/Features/dotnet.md)
|
- [All .Net Framework (2,3,4)](../docs/dev/features/Features/dotnet.md)
|
||||||
- [Disable Legacy F8 Boot Recovery](dev/features/Features/DisableLegacyRecovery.md)
|
- [Disable Legacy F8 Boot Recovery](../docs/dev/features/Features/DisableLegacyRecovery.md)
|
||||||
- [Disable Search Box Web Suggestions in Registry(explorer restart)](dev/features/Features/DisableSearchSuggestions.md)
|
- [Disable Search Box Web Suggestions in Registry(explorer restart)](../docs/dev/features/Features/DisableSearchSuggestions.md)
|
||||||
- [Enable Daily Registry Backup Task 12.30am](dev/features/Features/RegBackup.md)
|
- [Enable Daily Registry Backup Task 12.30am](../docs/dev/features/Features/RegBackup.md)
|
||||||
- [Enable Legacy F8 Boot Recovery](dev/features/Features/EnableLegacyRecovery.md)
|
- [Enable Legacy F8 Boot Recovery](../docs/dev/features/Features/EnableLegacyRecovery.md)
|
||||||
- [Enable Search Box Web Suggestions in Registry(explorer restart)](dev/features/Features/EnableSearchSuggestions.md)
|
- [Enable Search Box Web Suggestions in Registry(explorer restart)](../docs/dev/features/Features/EnableSearchSuggestions.md)
|
||||||
- [HyperV Virtualization](dev/features/Features/hyperv.md)
|
- [HyperV Virtualization](../docs/dev/features/Features/hyperv.md)
|
||||||
- [Install Features](dev/features/Features/Install.md)
|
- [Install Features](../docs/dev/features/Features/Install.md)
|
||||||
- [Legacy Media (WMP, DirectPlay)](dev/features/Features/legacymedia.md)
|
- [Legacy Media (WMP, DirectPlay)](../docs/dev/features/Features/legacymedia.md)
|
||||||
- [NFS - Network File System](dev/features/Features/nfs.md)
|
- [NFS - Network File System](../docs/dev/features/Features/nfs.md)
|
||||||
- [Windows Sandbox](dev/features/Features/Sandbox.md)
|
- [Windows Sandbox](../docs/dev/features/Features/Sandbox.md)
|
||||||
- [Windows Subsystem for Linux](dev/features/Features/wsl.md)
|
- [Windows Subsystem for Linux](../docs/dev/features/Features/wsl.md)
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,8 +29,14 @@
|
|||||||
* Click the `Clear Selection` button.
|
* Click the `Clear Selection` button.
|
||||||
* This will unselect all checked programs.
|
* This will unselect all checked programs.
|
||||||
|
|
||||||

|
=== "prefer Chocolatey"
|
||||||

|
* Check the `prefer Chocolatey` checkbox
|
||||||
|
* By default Winutil will use winget to install/upgrade/remove packages and fallback to Chocolatey. This option reverses the preference.
|
||||||
|
* This preference will be used for all Buttons on the Install page and persist across Winutil restarts
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
!!! tip
|
!!! tip
|
||||||
|
|
||||||
If you have trouble finding an application, press `ctrl + f` and search the name of it. Applications will filter depending on your input.
|
If you have trouble finding an application, press `ctrl + f` and search the name of it. Applications will filter depending on your input.
|
||||||
@ -38,8 +44,8 @@
|
|||||||
## Tweaks
|
## Tweaks
|
||||||
---
|
---
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
### Run Tweaks
|
### Run Tweaks
|
||||||
* **Open Tweaks Tab**: Navigate to the 'Tweaks' tab in the application.
|
* **Open Tweaks Tab**: Navigate to the 'Tweaks' tab in the application.
|
||||||
@ -71,13 +77,17 @@ The utility provides a convenient DNS selection feature, allowing users to choos
|
|||||||
|
|
||||||
* **Default**: Uses the default DNS settings configured by your ISP or network.
|
* **Default**: Uses the default DNS settings configured by your ISP or network.
|
||||||
* **DHCP**: Automatically acquires DNS settings from the DHCP server.
|
* **DHCP**: Automatically acquires DNS settings from the DHCP server.
|
||||||
* [**Google**](https://developers.google.com/speed/public-dns?hl=de): A reliable and fast DNS service provided by Google.
|
* [**Google**](https://developers.google.com/speed/public-dns?hl=en): A reliable and fast DNS service provided by Google.
|
||||||
* [**Cloudflare**](https://developers.cloudflare.com/1.1.1.1/): Known for speed and privacy, Cloudflare DNS is a popular choice for enhancing internet performance.
|
* [**Cloudflare**](https://developers.cloudflare.com/1.1.1.1/): Known for speed and privacy, Cloudflare DNS is a popular choice for enhancing internet performance.
|
||||||
* [**Cloudflare_Malware**](https://developers.cloudflare.com/1.1.1.1/setup/#:~:text=Use%20the%20following%20DNS%20resolvers%20to%20block%20malicious%20content%3A): Provides additional protection by blocking malware sites.
|
* [**Cloudflare_Malware**](https://developers.cloudflare.com/1.1.1.1/setup/#:~:text=Use%20the%20following%20DNS%20resolvers%20to%20block%20malicious%20content%3A): Provides additional protection by blocking malware sites.
|
||||||
* [**Cloudflare_Malware_Adult**](https://developers.cloudflare.com/1.1.1.1/setup/#:~:text=Use%20the%20following%20DNS%20resolvers%20to%20block%20malware%20and%20adult%20content%3A): Blocks both malware and adult content, offering more comprehensive filtering.
|
* [**Cloudflare_Malware_Adult**](https://developers.cloudflare.com/1.1.1.1/setup/#:~:text=Use%20the%20following%20DNS%20resolvers%20to%20block%20malware%20and%20adult%20content%3A): Blocks both malware and adult content, offering more comprehensive filtering.
|
||||||
* [**Level3**](https://www.lumen.com/): Another fast and reliable DNS service option.
|
|
||||||
* [**Open_DNS**](https://www.opendns.com/setupguide/#familyshield): Offers customizable filtering and enhanced security features.
|
* [**Open_DNS**](https://www.opendns.com/setupguide/#familyshield): Offers customizable filtering and enhanced security features.
|
||||||
* [**Quad9**](https://quad9.net/): Focuses on security by blocking known malicious domains.
|
* [**Quad9**](https://quad9.net/): Focuses on security by blocking known malicious domains.
|
||||||
|
* [**AdGuard_Ads_Trackers**](https://adguard-dns.io/en/welcome.html) AdGuard DNS will block ads, trackers, or any other DNS requests. Visit website and login for a dashboard, statistics and customize your experience in the server settings.
|
||||||
|
* [**AdGuard_Ads_Trackers_Malware_Adult**](https://adguard-dns.io/en/welcome.html) AdGuard DNS will block ads, trackers, adult content, and enable Safe Search and Safe Mode, where possible.
|
||||||
|
* [**dns0.eu_Open**](https://www.dns0.eu/) The European public DNS that makes your Internet safer. Offers general-purpose filtering to block malware, phishing, and tracking domains for enhanced privacy and security.
|
||||||
|
* [**dns0.eu_ZERO**](https://www.dns0.eu/zero) Provides advanced security with robust filters for highly sensitive environments, blocking high-risk domains using threat intelligence and sophisticated heuristics like Newly Registered Domains (NRD) and Domain Generation Algorithms (DGA).
|
||||||
|
* [**dns0.eu_KIDS**](https://www.dns0.eu/kids) A child-safe DNS that blocks adult content, explicit search results, mature videos, dating sites, piracy, and ads, creating a secure internet experience for children on any device or network.
|
||||||
|
|
||||||
### Customize Preferences
|
### Customize Preferences
|
||||||
|
|
||||||
@ -136,6 +146,10 @@ Open old-school Windows panels directly from WinUtil. Following Panels are avail
|
|||||||
* System Properties
|
* System Properties
|
||||||
* User Accounts
|
* User Accounts
|
||||||
|
|
||||||
|
### Remote Access
|
||||||
|
|
||||||
|
Enables OpenSSH server on your windows machine.
|
||||||
|
|
||||||
## Updates
|
## Updates
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -170,8 +184,8 @@ The utility provides three distinct settings for managing Windows updates: Defau
|
|||||||
|
|
||||||
* **MicroWin** lets you customize your Windows 10 and 11 installation images by debloating them however you want.
|
* **MicroWin** lets you customize your Windows 10 and 11 installation images by debloating them however you want.
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
#### Basic usage
|
#### Basic usage
|
||||||
|
|
||||||
@ -198,26 +212,7 @@ The utility provides three distinct settings for managing Windows updates: Defau
|
|||||||
* Selecting a scratch directory will copy the contents of the ISO file to the directory you specify instead of an automatically generated folder in the `%TEMP%` directory.
|
* Selecting a scratch directory will copy the contents of the ISO file to the directory you specify instead of an automatically generated folder in the `%TEMP%` directory.
|
||||||
* You can select an edition of Windows to debloat (**SKU**) using the convenient drop-down menu.
|
* You can select an edition of Windows to debloat (**SKU**) using the convenient drop-down menu.
|
||||||
|
|
||||||
By default, MicroWin will debloat the Pro edition, but you can choose any edition you want.
|
By default, MicroWin will debloat the Pro edition, but you can choose any edition you want.
|
||||||
|
|
||||||
|
|
||||||
##### Customization options
|
|
||||||
|
|
||||||
* **Keep Provisioned Packages**: leaving this option unticked (default) will try to remove every operating system package.
|
|
||||||
|
|
||||||
Some packages may remain after processing. This can happen if the packages in question are permanent or have been superseded by newer versions.
|
|
||||||
|
|
||||||
* **Keep Appx Packages**: leaving this option unticked (default) will try to remove every Microsoft Store app from the Windows image.
|
|
||||||
|
|
||||||
This option will exclude some applications that are essential in the event that you want or need to add a Store app later on.
|
|
||||||
|
|
||||||
* **Keep Defender**: leaving this option unticked will try to remove every part of Windows Defender, including the Windows Security app.
|
|
||||||
|
|
||||||
Leaving this option unticked is **NOT recommended** unless you plan to use a third-party antivirus solution on your MicroWin installation. In that regard, don't install AVs with bad reputations or rogueware.
|
|
||||||
|
|
||||||
* **Keep Edge**: leaving this option unticked will try to remove every part of the Microsoft Edge browser using the best methods available.
|
|
||||||
|
|
||||||
Leaving this option unticked is not recommended because it might break some applications that might depend on the `Edge WebView2` runtime. However, if that happens, you can easily [reinstall it](https://developer.microsoft.com/en-us/microsoft-edge/webview2)
|
|
||||||
|
|
||||||
|
|
||||||
##### Driver integration options
|
##### Driver integration options
|
||||||
@ -225,7 +220,15 @@ The utility provides three distinct settings for managing Windows updates: Defau
|
|||||||
* **Inject drivers** will add the drivers in the folder that you specify to the target Windows image.
|
* **Inject drivers** will add the drivers in the folder that you specify to the target Windows image.
|
||||||
* **Import drivers from the current system** will add every third-party driver that is present in your active installation.
|
* **Import drivers from the current system** will add every third-party driver that is present in your active installation.
|
||||||
|
|
||||||
This makes the target image have the same hardware compatibility as the active installation. However, this means that you will only be able to install the target Windows image and take full advantage of it on computers with **the same hardware**. To avoid this, you'll need to customize the `install.wim` file of the target ISO in the 'sources` folder.
|
This makes the target image have the same hardware compatibility as the active installation. However, this means that you will only be able to install the target Windows image and take full advantage of it on computers with **the same hardware**. To avoid this, you'll need to customize the `install.wim` file of the target ISO in the 'sources` folder.
|
||||||
|
|
||||||
|
##### Custom user settings
|
||||||
|
|
||||||
|
With MicroWin, you can also configure your user before proceeding if you don't want to use the default `User` account. To do this, simply type the account name (20 characters maximum), and a password. Then, let MicroWin do the rest.
|
||||||
|
|
||||||
|
!!! info
|
||||||
|
|
||||||
|
Please make sure that you remember your password. MicroWin will configure auto-login settings, so you won't have to enter your password. However, if you are required to enter your password, it's best that you don't forget it.
|
||||||
|
|
||||||
|
|
||||||
##### Ventoy options
|
##### Ventoy options
|
||||||
@ -240,12 +243,12 @@ The utility provides three distinct settings for managing Windows updates: Defau
|
|||||||
* Some features are available through automation. This allows you to save your config file, pass it to WinUtil, walk away and come back to a finished system. Here is how you can set it up currently with Winutil >24.01.15
|
* Some features are available through automation. This allows you to save your config file, pass it to WinUtil, walk away and come back to a finished system. Here is how you can set it up currently with Winutil >24.01.15
|
||||||
|
|
||||||
* On the Install Tab, click "Get Installed", this will get all installed apps **supported by Winutil** on the system.
|
* On the Install Tab, click "Get Installed", this will get all installed apps **supported by Winutil** on the system.
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
* Click on the Settings cog in the upper right corner and choose Export. Choose file file and location; this will export the setting file.
|
* Click on the Settings cog in the upper right corner and choose Export. Choose file file and location; this will export the setting file.
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
* Copy this file to a USB or somewhere you can use it after Windows installation.
|
* Copy this file to a USB or somewhere you can use it after Windows installation.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function Invoke-WPFMicrowin {
|
function Invoke-Microwin {
|
||||||
<#
|
<#
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
Invoke MicroWin routines...
|
Invoke MicroWin routines...
|
||||||
@ -51,10 +51,6 @@ public class PowerManagement {
|
|||||||
$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
|
|
||||||
$keepProvisionedPackages = $sync.WPFMicrowinKeepAppxPackages.IsChecked
|
|
||||||
$keepDefender = $sync.WPFMicrowinKeepDefender.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
|
||||||
@ -80,9 +76,10 @@ public class PowerManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$imgVersion = (Get-WindowsImage -ImagePath $mountDir\sources\install.wim -Index $index).Version
|
$imgVersion = (Get-WindowsImage -ImagePath $mountDir\sources\install.wim -Index $index).Version
|
||||||
|
Write-Host "The Windows Image Build Version is: $imgVersion"
|
||||||
|
|
||||||
# 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 ((Microwin-TestCompatibleImage $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
|
||||||
@ -91,6 +88,14 @@ public class PowerManagement {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Detect whether the image to process contains Windows 10 and show warning
|
||||||
|
if ((Microwin-TestCompatibleImage $imgVersion $([System.Version]::new(10,0,21996,1))) -eq $false) {
|
||||||
|
$msg = "Windows 10 has been detected in the image you want to process. While you can continue, Windows 10 is not a recommended target for MicroWin, and you may not get the full experience."
|
||||||
|
$dlg_msg = $msg
|
||||||
|
Write-Host $msg
|
||||||
|
[System.Windows.MessageBox]::Show($dlg_msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Exclamation)
|
||||||
|
}
|
||||||
|
|
||||||
$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) {
|
||||||
@ -151,34 +156,71 @@ public class PowerManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Remove Features from the image"
|
Write-Host "Remove Features from the image"
|
||||||
Remove-Features
|
Microwin-RemoveFeatures
|
||||||
Write-Host "Removing features complete!"
|
Write-Host "Removing features complete!"
|
||||||
Write-Host "Removing OS packages"
|
Write-Host "Removing OS packages"
|
||||||
Remove-Packages
|
Microwin-RemovePackages
|
||||||
Write-Host "Removing Appx Bloat"
|
Write-Host "Removing Appx Bloat"
|
||||||
Remove-ProvisionedPackages
|
Microwin-RemoveProvisionedPackages
|
||||||
|
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\LogFiles\WMI\RtBackup" -Directory
|
# Detect Windows 11 24H2 and add dependency to FileExp to prevent Explorer look from going back - thanks @WitherOrNot and @thecatontheceiling
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\DiagTrack" -Directory
|
if ((Microwin-TestCompatibleImage $imgVersion $([System.Version]::new(10,0,26100,1))) -eq $true) {
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\InboxApps" -Directory
|
try {
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\LocationNotificationWindows.exe"
|
if (Test-Path "$scratchDir\Windows\SystemApps\MicrosoftWindows.Client.FileExp_cw5n1h2txyewy\appxmanifest.xml" -PathType Leaf) {
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Photo Viewer" -Directory
|
# Found the culprit. Do the following:
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Photo Viewer" -Directory
|
# 1. Take ownership of the file, from TrustedInstaller to Administrators
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Media Player" -Directory
|
takeown /F "$scratchDir\Windows\SystemApps\MicrosoftWindows.Client.FileExp_cw5n1h2txyewy\appxmanifest.xml" /A
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Media Player" -Directory
|
# 2. Set ACLs so that we can write to it
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Mail" -Directory
|
icacls "$scratchDir\Windows\SystemApps\MicrosoftWindows.Client.FileExp_cw5n1h2txyewy\appxmanifest.xml" /grant "$(Microwin-GetLocalizedUsers -admins $true):(M)" | Out-Host
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Mail" -Directory
|
# 3. Open the file and do the modification
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Internet Explorer" -Directory
|
$appxManifest = Get-Content -Path "$scratchDir\Windows\SystemApps\MicrosoftWindows.Client.FileExp_cw5n1h2txyewy\appxmanifest.xml"
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Internet Explorer" -Directory
|
$originalLine = $appxManifest[13]
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\GameBarPresenceWriter"
|
$dependency = "`n <PackageDependency Name=`"Microsoft.WindowsAppRuntime.CBS`" MinVersion=`"1.0.0.0`" Publisher=`"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US`" />"
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\OneDriveSetup.exe"
|
$appxManifest[13] = "$originalLine$dependency"
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\OneDrive.ico"
|
Set-Content -Path "$scratchDir\Windows\SystemApps\MicrosoftWindows.Client.FileExp_cw5n1h2txyewy\appxmanifest.xml" -Value $appxManifest -Force -Encoding utf8
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*narratorquickstart*" -Directory
|
}
|
||||||
Remove-FileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*ParentalControls*" -Directory
|
}
|
||||||
|
catch {
|
||||||
|
# Do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\LogFiles\WMI\RtBackup" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Windows\DiagTrack" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Windows\InboxApps" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\LocationNotificationWindows.exe"
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Photo Viewer" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Photo Viewer" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Media Player" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Media Player" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Mail" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Mail" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Internet Explorer" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Internet Explorer" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Windows\GameBarPresenceWriter"
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\OneDriveSetup.exe"
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\OneDrive.ico"
|
||||||
|
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Windows\SystemApps" -mask "*narratorquickstart*" -Directory
|
||||||
|
Microwin-RemoveFileOrDirectory -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
|
|
||||||
|
if ($sync.MicrowinUserName.Text -eq "")
|
||||||
|
{
|
||||||
|
Microwin-NewUnattend -userName "User"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($sync.MicrowinUserPassword.Password -eq "")
|
||||||
|
{
|
||||||
|
Microwin-NewUnattend -userName "$($sync.MicrowinUserName.Text)"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Microwin-NewUnattend -userName "$($sync.MicrowinUserName.Text)" -userPassword "$($sync.MicrowinUserPassword.Password)"
|
||||||
|
}
|
||||||
|
}
|
||||||
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"
|
||||||
@ -189,7 +231,7 @@ public class PowerManagement {
|
|||||||
Write-Host "Done Copy unattend.xml"
|
Write-Host "Done Copy unattend.xml"
|
||||||
|
|
||||||
Write-Host "Create FirstRun"
|
Write-Host "Create FirstRun"
|
||||||
New-FirstRun
|
Microwin-NewFirstRun
|
||||||
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
|
||||||
@ -201,7 +243,7 @@ public class PowerManagement {
|
|||||||
dism /English /image:$($scratchDir) /set-profilepath:"$($scratchDir)\Windows\Users\Default"
|
dism /English /image:$($scratchDir) /set-profilepath:"$($scratchDir)\Windows\Users\Default"
|
||||||
|
|
||||||
Write-Host "Copy checkinstall.cmd into the ISO"
|
Write-Host "Copy checkinstall.cmd into the ISO"
|
||||||
New-CheckInstall
|
Microwin-NewCheckInstall
|
||||||
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"
|
||||||
|
|
||||||
@ -223,6 +265,9 @@ public class PowerManagement {
|
|||||||
# Write-Host Error code $LASTEXITCODE
|
# Write-Host Error code $LASTEXITCODE
|
||||||
Write-Host "Done disabling Teams"
|
Write-Host "Done disabling Teams"
|
||||||
|
|
||||||
|
Write-Host "Fix Windows Volume Mixer Issue"
|
||||||
|
reg add "HKLM\zNTUSER\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore" /f
|
||||||
|
|
||||||
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
|
||||||
@ -274,6 +319,19 @@ public class PowerManagement {
|
|||||||
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
|
||||||
|
|
||||||
|
if ((Microwin-TestCompatibleImage $imgVersion $([System.Version]::new(10,0,21996,1))) -eq $false) {
|
||||||
|
# We're dealing with Windows 10. Configure sane desktop settings. NOTE: even though stuff to disable News and Interests is there,
|
||||||
|
# it doesn't seem to work, and I don't want to waste more time dealing with an operating system that will lose support in a year (2025)
|
||||||
|
|
||||||
|
# I invite anyone to work on improving stuff for News and Interests, but that won't be me!
|
||||||
|
|
||||||
|
Write-Host "Disabling Search Highlights..."
|
||||||
|
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Feeds\DSB" /v "ShowDynamicContent" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\SearchSettings" /v "IsDynamicSearchBoxEnabled" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKLM\zSOFTWARE\Policies\Microsoft\Dsh" /v "AllowNewsAndInterests" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "TraySearchBoxVisible" /t REG_DWORD /d 1 /f
|
||||||
|
}
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
Write-Error "An unexpected error occurred: $_"
|
Write-Error "An unexpected error occurred: $_"
|
||||||
} finally {
|
} finally {
|
||||||
@ -373,7 +431,7 @@ public class PowerManagement {
|
|||||||
|
|
||||||
if ($copyToUSB) {
|
if ($copyToUSB) {
|
||||||
Write-Host "Copying target ISO to the USB drive"
|
Write-Host "Copying target ISO to the USB drive"
|
||||||
Copy-ToUSB("$($SaveDialog.FileName)")
|
Microwin-CopyToUSB("$($SaveDialog.FileName)")
|
||||||
if ($?) { Write-Host "Done Copying target ISO to USB drive!" } else { Write-Host "ISO copy failed." }
|
if ($?) { Write-Host "Done Copying target ISO to USB drive!" } else { Write-Host "ISO copy failed." }
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
function Invoke-WPFGetIso {
|
function Invoke-MicrowinGetIso {
|
||||||
<#
|
<#
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
Function to get the path to Iso file for MicroWin, unpack that isom=, read basic information and populate the UI Options
|
Function to get the path to Iso file for MicroWin, unpack that isom=, read basic information and populate the UI Options
|
||||||
@ -50,7 +50,7 @@ function Invoke-WPFGetIso {
|
|||||||
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
|
Microwin-GetOscdimg -oscdimgPath $oscdimgPath
|
||||||
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
|
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
|
||||||
if (!$oscdImgFound) {
|
if (!$oscdImgFound) {
|
||||||
$msg = "oscdimg was not downloaded can not proceed"
|
$msg = "oscdimg was not downloaded can not proceed"
|
||||||
@ -62,17 +62,79 @@ function Invoke-WPFGetIso {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
|
if ($sync["ISOmanual"].IsChecked) {
|
||||||
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
|
# Open file dialog to let user choose the ISO file
|
||||||
$openFileDialog.initialDirectory = $initialDirectory
|
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
|
||||||
$openFileDialog.filter = "ISO files (*.iso)| *.iso"
|
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
|
||||||
$openFileDialog.ShowDialog() | Out-Null
|
$openFileDialog.initialDirectory = $initialDirectory
|
||||||
$filePath = $openFileDialog.FileName
|
$openFileDialog.filter = "ISO files (*.iso)| *.iso"
|
||||||
|
$openFileDialog.ShowDialog() | Out-Null
|
||||||
|
$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
|
||||||
|
}
|
||||||
|
} elseif ($sync["ISOdownloader"].IsChecked) {
|
||||||
|
# Create folder browsers for user-specified locations
|
||||||
|
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
|
||||||
|
$isoDownloaderFBD = New-Object System.Windows.Forms.FolderBrowserDialog
|
||||||
|
$isoDownloaderFBD.Description = "Please specify the path to download the ISO file to:"
|
||||||
|
$isoDownloaderFBD.ShowNewFolderButton = $true
|
||||||
|
if ($isoDownloaderFBD.ShowDialog() -ne [System.Windows.Forms.DialogResult]::OK)
|
||||||
|
{
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
# Grab the location of the selected path
|
||||||
|
$targetFolder = $isoDownloaderFBD.SelectedPath
|
||||||
|
|
||||||
|
# Auto download newest ISO
|
||||||
|
# Credit: https://github.com/pbatard/Fido
|
||||||
|
$fidopath = "$env:temp\Fido.ps1"
|
||||||
|
$originalLocation = $PSScriptRoot
|
||||||
|
|
||||||
|
Invoke-WebRequest "https://github.com/pbatard/Fido/raw/master/Fido.ps1" -OutFile $fidopath
|
||||||
|
|
||||||
|
Set-Location -Path $env:temp
|
||||||
|
# Detect if the first option ("System language") has been selected and get a Fido-approved language from the current culture
|
||||||
|
$lang = if ($sync["ISOLanguage"].SelectedIndex -eq 0) {
|
||||||
|
Microwin-GetLangFromCulture -langName (Get-Culture).Name
|
||||||
|
} else {
|
||||||
|
$sync["ISOLanguage"].SelectedItem
|
||||||
|
}
|
||||||
|
|
||||||
|
& $fidopath -Win 'Windows 11' -Rel $sync["ISORelease"].SelectedItem -Arch "x64" -Lang $lang -Ed "Windows 11 Home/Pro/Edu"
|
||||||
|
if (-not $?)
|
||||||
|
{
|
||||||
|
Write-Host "Could not download the ISO file. Look at the output of the console for more information."
|
||||||
|
$msg = "The ISO file could not be downloaded"
|
||||||
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Set-Location $originalLocation
|
||||||
|
# Use the FullName property to only grab the file names. Using this property is necessary as, without it, you're passing the usual output of Get-ChildItem
|
||||||
|
# to the variable, and let's be honest, that does NOT exist in the file system
|
||||||
|
$filePath = (Get-ChildItem -Path "$env:temp" -Filter "Win11*.iso").FullName | Sort-Object LastWriteTime -Descending | Select-Object -First 1
|
||||||
|
$fileName = [IO.Path]::GetFileName("$filePath")
|
||||||
|
|
||||||
|
if (($targetFolder -ne "") -and (Test-Path "$targetFolder"))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
# "Let it download to $env:TEMP and then we **move** it to the file path." - CodingWonders
|
||||||
|
$destinationFilePath = "$targetFolder\$fileName"
|
||||||
|
Write-Host "Moving ISO file. Please wait..."
|
||||||
|
Move-Item -Path "$filePath" -Destination "$destinationFilePath" -Force
|
||||||
|
$filePath = $destinationFilePath
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Write-Host "Unable to move the ISO file to the location you specified. The downloaded ISO is in the `"$env:TEMP`" folder"
|
||||||
|
Write-Host "Error information: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "File path $($filePath)"
|
Write-Host "File path $($filePath)"
|
||||||
@ -114,7 +176,7 @@ function Invoke-WPFGetIso {
|
|||||||
# @ChrisTitusTech please copy this wiki and change the link below to your copy of the wiki
|
# @ChrisTitusTech please copy this wiki and change the link below to your copy of the wiki
|
||||||
Write-Error "Failed to mount the image. Error: $($_.Exception.Message)"
|
Write-Error "Failed to mount the image. Error: $($_.Exception.Message)"
|
||||||
Write-Error "This is NOT winutil's problem, your ISO might be corrupt, or there is a problem on the system"
|
Write-Error "This is NOT winutil's problem, your ISO might be corrupt, or there is a problem on the system"
|
||||||
Write-Error "Please refer to this wiki for more details https://github.com/ChrisTitusTech/winutil/blob/main/wiki/Error-in-Winutil-MicroWin-during-ISO-mounting%2Cmd"
|
Write-Host "Please refer to this wiki for more details: https://christitustech.github.io/winutil/KnownIssues/#troubleshoot-errors-during-microwin-usage" -ForegroundColor Red
|
||||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||||
return
|
return
|
||||||
}
|
}
|
10
functions/microwin/Microwin-Classes.ps1
Normal file
10
functions/microwin/Microwin-Classes.ps1
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
class ErroredPackage {
|
||||||
|
[string]$PackageName
|
||||||
|
[string]$ErrorMessage
|
||||||
|
ErroredPackage() { $this.Init(@{} )}
|
||||||
|
# Constructor for packages that have errored out
|
||||||
|
ErroredPackage([string]$pkgName, [string]$reason) {
|
||||||
|
$this.PackageName = $pkgName
|
||||||
|
$this.ErrorMessage = $reason
|
||||||
|
}
|
||||||
|
}
|
23
functions/microwin/Microwin-CopyToUSB.ps1
Normal file
23
functions/microwin/Microwin-CopyToUSB.ps1
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
function Microwin-CopyToUSB([string]$fileToCopy) {
|
||||||
|
foreach ($volume in Get-Volume) {
|
||||||
|
if ($volume -and $volume.FileSystemLabel -ieq "ventoy") {
|
||||||
|
$destinationPath = "$($volume.DriveLetter):\"
|
||||||
|
#Copy-Item -Path $fileToCopy -Destination $destinationPath -Force
|
||||||
|
# Get the total size of the file
|
||||||
|
$totalSize = (Get-Item "$fileToCopy").length
|
||||||
|
|
||||||
|
Copy-Item -Path "$fileToCopy" -Destination "$destinationPath" -Verbose -Force -Recurse -Container -PassThru |
|
||||||
|
ForEach-Object {
|
||||||
|
# Calculate the percentage completed
|
||||||
|
$completed = ($_.BytesTransferred / $totalSize) * 100
|
||||||
|
|
||||||
|
# Display the progress bar
|
||||||
|
Write-Progress -Activity "Copying File" -Status "Progress" -PercentComplete $completed -CurrentOperation ("{0:N2} MB / {1:N2} MB" -f ($_.BytesTransferred / 1MB), ($totalSize / 1MB))
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "File copied to Ventoy drive $($volume.DriveLetter)"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Write-Host "Ventoy USB Key is not inserted"
|
||||||
|
}
|
49
functions/microwin/Microwin-GetLangFromCulture.ps1
Normal file
49
functions/microwin/Microwin-GetLangFromCulture.ps1
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
function Microwin-GetLangFromCulture {
|
||||||
|
|
||||||
|
param (
|
||||||
|
[Parameter(Mandatory, Position = 0)] [string]$langName
|
||||||
|
)
|
||||||
|
|
||||||
|
switch -Wildcard ($langName)
|
||||||
|
{
|
||||||
|
"ar*" { return "Arabic" }
|
||||||
|
"pt-BR" { return "Brazilian Portuguese" }
|
||||||
|
"bg*" { return "Bulgarian" }
|
||||||
|
{($_ -eq "zh-CH") -or ($_ -like "zh-Hans*") -or ($_ -eq "zh-SG") -or ($_ -eq "zh-CHS")} { return "Chinese (Simplified)" }
|
||||||
|
{($_ -eq "zh") -or ($_ -eq "zh-Hant") -or ($_ -eq "zh-HK") -or ($_ -eq "zh-MO") -or ($_ -eq "zh-TW") -or ($_ -eq "zh-CHT")} { return "Chinese (Traditional)" }
|
||||||
|
"hr*" { return "Croatian" }
|
||||||
|
"cs*" { return "Czech" }
|
||||||
|
"da*" { return "Danish" }
|
||||||
|
"nl*" { return "Dutch" }
|
||||||
|
"en-US" { return "English" }
|
||||||
|
{($_ -like "en*") -and ($_ -ne "en-US")} { return "English International" }
|
||||||
|
"et*" { return "Estonian" }
|
||||||
|
"fi*" { return "Finnish" }
|
||||||
|
{($_ -like "fr*") -and ($_ -ne "fr-CA")} { return "French" }
|
||||||
|
"fr-CA" { return "French Canadian" }
|
||||||
|
"de*" { return "German" }
|
||||||
|
"el*" { return "Greek" }
|
||||||
|
"he*" { return "Hebrew" }
|
||||||
|
"hu*" { return "Hungarian" }
|
||||||
|
"it*" { return "Italian" }
|
||||||
|
"ja*" { return "Japanese" }
|
||||||
|
"ko*" { return "Korean" }
|
||||||
|
"lv*" { return "Latvian" }
|
||||||
|
"lt*" { return "Lituanian" }
|
||||||
|
"nb*" { return "Norwegian" }
|
||||||
|
"pl*" { return "Polish" }
|
||||||
|
{($_ -like "pt*") -and ($_ -ne "pt-BR")} { return "Portuguese" }
|
||||||
|
"ro*" { return "Romanian" }
|
||||||
|
"ru*" { return "Russian" }
|
||||||
|
"sr-Latn*" { return "Serbian Latin" }
|
||||||
|
"sk*" { return "Slovak" }
|
||||||
|
"sl*" { return "Slovenian" }
|
||||||
|
{($_ -like "es*") -and ($_ -ne "es-MX")} { return "Spanish" }
|
||||||
|
"es-MX" { return "Spanish (Mexico)" }
|
||||||
|
"sv*" { return "Swedish" }
|
||||||
|
"th*" { return "Thai" }
|
||||||
|
"tr*" { return "Turkish" }
|
||||||
|
"uk*" { return "Ukrainian" }
|
||||||
|
default { return "English" }
|
||||||
|
}
|
||||||
|
}
|
21
functions/microwin/Microwin-GetLocalizedUsers.ps1
Normal file
21
functions/microwin/Microwin-GetLocalizedUsers.ps1
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
function Microwin-GetLocalizedUsers
|
||||||
|
{
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Gets a localized user group representation for ICACLS commands (Port from DISMTools PE Helper)
|
||||||
|
.PARAMETER admins
|
||||||
|
Determines whether to get a localized user group representation for the Administrators user group
|
||||||
|
.OUTPUTS
|
||||||
|
A string containing the localized user group
|
||||||
|
.EXAMPLE
|
||||||
|
Microwin-GetLocalizedUsers -admins $true
|
||||||
|
#>
|
||||||
|
param (
|
||||||
|
[Parameter(Mandatory = $true, Position = 0)] [bool]$admins
|
||||||
|
)
|
||||||
|
if ($admins) {
|
||||||
|
return (Get-LocalGroup | Where-Object { $_.SID.Value -like "S-1-5-32-544" }).Name
|
||||||
|
} else {
|
||||||
|
return (Get-LocalGroup | Where-Object { $_.SID.Value -like "S-1-5-32-545" }).Name
|
||||||
|
}
|
||||||
|
}
|
@ -1,10 +1,10 @@
|
|||||||
function Get-Oscdimg {
|
function Microwin-GetOscdimg {
|
||||||
<#
|
<#
|
||||||
.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
|
Microwin-GetOscdimg
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param(
|
param(
|
73
functions/microwin/Microwin-NewCheckInstall.ps1
Normal file
73
functions/microwin/Microwin-NewCheckInstall.ps1
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
function Microwin-NewCheckInstall {
|
||||||
|
|
||||||
|
# using here string to embedd firstrun
|
||||||
|
$checkInstall = @'
|
||||||
|
@echo off
|
||||||
|
if exist "%HOMEDRIVE%\windows\cpu.txt" (
|
||||||
|
echo %HOMEDRIVE%\windows\cpu.txt exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\windows\cpu.txt does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\windows\SerialNumber.txt" (
|
||||||
|
echo %HOMEDRIVE%\windows\SerialNumber.txt exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\windows\SerialNumber.txt does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\unattend.xml" (
|
||||||
|
echo %HOMEDRIVE%\unattend.xml exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\unattend.xml does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\Windows\Setup\Scripts\SetupComplete.cmd" (
|
||||||
|
echo %HOMEDRIVE%\Windows\Setup\Scripts\SetupComplete.cmd exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\Windows\Setup\Scripts\SetupComplete.cmd does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\Windows\Panther\unattend.xml" (
|
||||||
|
echo %HOMEDRIVE%\Windows\Panther\unattend.xml exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\Windows\Panther\unattend.xml does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\Windows\System32\Sysprep\unattend.xml" (
|
||||||
|
echo %HOMEDRIVE%\Windows\System32\Sysprep\unattend.xml exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\Windows\System32\Sysprep\unattend.xml does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\Windows\FirstStartup.ps1" (
|
||||||
|
echo %HOMEDRIVE%\Windows\FirstStartup.ps1 exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\Windows\FirstStartup.ps1 does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\Windows\winutil.ps1" (
|
||||||
|
echo %HOMEDRIVE%\Windows\winutil.ps1 exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\Windows\winutil.ps1 does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\Windows\LogSpecialize.txt" (
|
||||||
|
echo %HOMEDRIVE%\Windows\LogSpecialize.txt exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\Windows\LogSpecialize.txt does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\Windows\LogAuditUser.txt" (
|
||||||
|
echo %HOMEDRIVE%\Windows\LogAuditUser.txt exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\Windows\LogAuditUser.txt does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\Windows\LogOobeSystem.txt" (
|
||||||
|
echo %HOMEDRIVE%\Windows\LogOobeSystem.txt exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\Windows\LogOobeSystem.txt does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\windows\csup.txt" (
|
||||||
|
echo %HOMEDRIVE%\windows\csup.txt exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\windows\csup.txt does not exist
|
||||||
|
)
|
||||||
|
if exist "%HOMEDRIVE%\windows\LogFirstRun.txt" (
|
||||||
|
echo %HOMEDRIVE%\windows\LogFirstRun.txt exists
|
||||||
|
) else (
|
||||||
|
echo %HOMEDRIVE%\windows\LogFirstRun.txt does not exist
|
||||||
|
)
|
||||||
|
'@
|
||||||
|
$checkInstall | Out-File -FilePath "$env:temp\checkinstall.cmd" -Force -Encoding Ascii
|
||||||
|
}
|
68
functions/microwin/Microwin-NewFirstRun.ps1
Normal file
68
functions/microwin/Microwin-NewFirstRun.ps1
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
function Microwin-NewFirstRun {
|
||||||
|
|
||||||
|
# using here string to embedd firstrun
|
||||||
|
$firstRun = @'
|
||||||
|
# Set the global error action preference to continue
|
||||||
|
$ErrorActionPreference = "Continue"
|
||||||
|
function Remove-RegistryValue {
|
||||||
|
param (
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$RegistryPath,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$ValueName
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check if the registry path exists
|
||||||
|
if (Test-Path -Path $RegistryPath) {
|
||||||
|
$registryValue = Get-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
# Check if the registry value exists
|
||||||
|
if ($registryValue) {
|
||||||
|
# Remove the registry value
|
||||||
|
Remove-ItemProperty -Path $RegistryPath -Name $ValueName -Force
|
||||||
|
Write-Host "Registry value '$ValueName' removed from '$RegistryPath'."
|
||||||
|
} else {
|
||||||
|
Write-Host "Registry value '$ValueName' not found in '$RegistryPath'."
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Write-Host "Registry path '$RegistryPath' not found."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"FirstStartup has worked" | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber
|
||||||
|
|
||||||
|
$taskbarPath = "$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
|
||||||
|
# Delete all files on the Taskbar
|
||||||
|
Get-ChildItem -Path $taskbarPath -File | Remove-Item -Force
|
||||||
|
Remove-RegistryValue -RegistryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -ValueName "FavoritesRemovedChanges"
|
||||||
|
Remove-RegistryValue -RegistryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -ValueName "FavoritesChanges"
|
||||||
|
Remove-RegistryValue -RegistryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -ValueName "Favorites"
|
||||||
|
|
||||||
|
# Delete Edge Icon from the desktop
|
||||||
|
$edgeShortcutFiles = Get-ChildItem -Path $desktopPath -Filter "*Edge*.lnk"
|
||||||
|
# Check if Edge shortcuts exist on the desktop
|
||||||
|
if ($edgeShortcutFiles) {
|
||||||
|
foreach ($shortcutFile in $edgeShortcutFiles) {
|
||||||
|
# Remove each Edge shortcut
|
||||||
|
Remove-Item -Path $shortcutFile.FullName -Force
|
||||||
|
Write-Host "Edge shortcut '$($shortcutFile.Name)' removed from the desktop."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Remove-Item -Path "$env:USERPROFILE\Desktop\*.lnk"
|
||||||
|
Remove-Item -Path "$env:HOMEDRIVE\Users\Default\Desktop\*.lnk"
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if ((Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -like "Recall" }).Count -gt 0)
|
||||||
|
{
|
||||||
|
Disable-WindowsOptionalFeature -Online -FeatureName "Recall" -Remove
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
'@
|
||||||
|
$firstRun | Out-File -FilePath "$env:temp\FirstStartup.ps1" -Force
|
||||||
|
}
|
@ -1,244 +1,10 @@
|
|||||||
function Test-CompatibleImage() {
|
function Microwin-NewUnattend {
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Checks the version of a Windows image and determines whether or not it is compatible with a specific feature depending on a desired version
|
|
||||||
|
|
||||||
.PARAMETER Name
|
param (
|
||||||
imgVersion - The version of the Windows image
|
[Parameter(Mandatory, Position = 0)] [string]$userName,
|
||||||
desiredVersion - The version to compare the image version with
|
[Parameter(Position = 1)] [string]$userPassword
|
||||||
#>
|
|
||||||
|
|
||||||
param
|
|
||||||
(
|
|
||||||
[Parameter(Mandatory, position=0)]
|
|
||||||
[string]$imgVersion,
|
|
||||||
|
|
||||||
[Parameter(Mandatory, position=1)]
|
|
||||||
[Version]$desiredVersion
|
|
||||||
)
|
)
|
||||||
|
|
||||||
try {
|
|
||||||
$version = [Version]$imgVersion
|
|
||||||
return $version -ge $desiredVersion
|
|
||||||
} catch {
|
|
||||||
return $False
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function Remove-Features() {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Removes certain features from ISO image
|
|
||||||
|
|
||||||
.PARAMETER Name
|
|
||||||
No Params
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Remove-Features
|
|
||||||
#>
|
|
||||||
try {
|
|
||||||
$featlist = (Get-WindowsOptionalFeature -Path $scratchDir).FeatureName
|
|
||||||
|
|
||||||
$featlist = $featlist | Where-Object {
|
|
||||||
$_ -NotLike "*Defender*" -AND
|
|
||||||
$_ -NotLike "*Printing*" -AND
|
|
||||||
$_ -NotLike "*TelnetClient*" -AND
|
|
||||||
$_ -NotLike "*PowerShell*" -AND
|
|
||||||
$_ -NotLike "*NetFx*" -AND
|
|
||||||
$_ -NotLike "*Media*" -AND
|
|
||||||
$_ -NotLike "*NFS*"
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($feature in $featlist) {
|
|
||||||
$status = "Removing feature $feature"
|
|
||||||
Write-Progress -Activity "Removing features" -Status $status -PercentComplete ($counter++/$featlist.Count*100)
|
|
||||||
Write-Debug "Removing feature $feature"
|
|
||||||
Disable-WindowsOptionalFeature -Path "$scratchDir" -FeatureName $feature -Remove -ErrorAction SilentlyContinue -NoRestart
|
|
||||||
}
|
|
||||||
Write-Progress -Activity "Removing features" -Status "Ready" -Completed
|
|
||||||
Write-Host "You can re-enable the disabled features at any time, using either Windows Update or the SxS folder in <installation media>\Sources."
|
|
||||||
} catch {
|
|
||||||
Write-Host "Unable to get information about the features. MicroWin processing will continue, but features will not be processed"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function Remove-Packages {
|
|
||||||
try {
|
|
||||||
$pkglist = (Get-WindowsPackage -Path "$scratchDir").PackageName
|
|
||||||
|
|
||||||
$pkglist = $pkglist | Where-Object {
|
|
||||||
$_ -NotLike "*ApplicationModel*" -AND
|
|
||||||
$_ -NotLike "*indows-Client-LanguagePack*" -AND
|
|
||||||
$_ -NotLike "*LanguageFeatures-Basic*" -AND
|
|
||||||
$_ -NotLike "*Package_for_ServicingStack*" -AND
|
|
||||||
$_ -NotLike "*.NET*" -AND
|
|
||||||
$_ -NotLike "*Store*" -AND
|
|
||||||
$_ -NotLike "*VCLibs*" -AND
|
|
||||||
$_ -NotLike "*AAD.BrokerPlugin",
|
|
||||||
$_ -NotLike "*LockApp*" -AND
|
|
||||||
$_ -NotLike "*Notepad*" -AND
|
|
||||||
$_ -NotLike "*immersivecontrolpanel*" -AND
|
|
||||||
$_ -NotLike "*ContentDeliveryManager*" -AND
|
|
||||||
$_ -NotLike "*PinningConfirMationDialog*" -AND
|
|
||||||
$_ -NotLike "*SecHealthUI*" -AND
|
|
||||||
$_ -NotLike "*SecureAssessmentBrowser*" -AND
|
|
||||||
$_ -NotLike "*PrintDialog*" -AND
|
|
||||||
$_ -NotLike "*AssignedAccessLockApp*" -AND
|
|
||||||
$_ -NotLike "*OOBENetworkConnectionFlow*" -AND
|
|
||||||
$_ -NotLike "*Apprep.ChxApp*" -AND
|
|
||||||
$_ -NotLike "*CBS*" -AND
|
|
||||||
$_ -NotLike "*OOBENetworkCaptivePortal*" -AND
|
|
||||||
$_ -NotLike "*PeopleExperienceHost*" -AND
|
|
||||||
$_ -NotLike "*ParentalControls*" -AND
|
|
||||||
$_ -NotLike "*Win32WebViewHost*" -AND
|
|
||||||
$_ -NotLike "*InputApp*" -AND
|
|
||||||
$_ -NotLike "*AccountsControl*" -AND
|
|
||||||
$_ -NotLike "*AsyncTextService*" -AND
|
|
||||||
$_ -NotLike "*CapturePicker*" -AND
|
|
||||||
$_ -NotLike "*CredDialogHost*" -AND
|
|
||||||
$_ -NotLike "*BioEnrollMent*" -AND
|
|
||||||
$_ -NotLike "*ShellExperienceHost*" -AND
|
|
||||||
$_ -NotLike "*DesktopAppInstaller*" -AND
|
|
||||||
$_ -NotLike "*WebMediaExtensions*" -AND
|
|
||||||
$_ -NotLike "*WMIC*" -AND
|
|
||||||
$_ -NotLike "*UI.XaML*"
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($pkg in $pkglist) {
|
|
||||||
try {
|
|
||||||
$status = "Removing $pkg"
|
|
||||||
Write-Progress -Activity "Removing Apps" -Status $status -PercentComplete ($counter++/$pkglist.Count*100)
|
|
||||||
Remove-WindowsPackage -Path "$scratchDir" -PackageName $pkg -NoRestart -ErrorAction SilentlyContinue
|
|
||||||
} catch {
|
|
||||||
# This can happen if the package that is being removed is a permanent one, like FodMetadata
|
|
||||||
Write-Host "Could not remove OS package $($pkg)"
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
|
|
||||||
} catch {
|
|
||||||
Write-Host "Unable to get information about the packages. MicroWin processing will continue, but packages will not be processed"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function Remove-ProvisionedPackages() {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Removes AppX packages from a Windows image during MicroWin processing
|
|
||||||
|
|
||||||
.PARAMETER Name
|
|
||||||
No Params
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Remove-ProvisionedPackages
|
|
||||||
#>
|
|
||||||
$appxProvisionedPackages = Get-AppxProvisionedPackage -Path "$($scratchDir)" | Where-Object {
|
|
||||||
$_.PackageName -NotLike "*AppInstaller*" -AND
|
|
||||||
$_.PackageName -NotLike "*Store*" -and
|
|
||||||
$_.PackageName -NotLike "*dism*" -and
|
|
||||||
$_.PackageName -NotLike "*Foundation*" -and
|
|
||||||
$_.PackageName -NotLike "*FodMetadata*" -and
|
|
||||||
$_.PackageName -NotLike "*LanguageFeatures*" -and
|
|
||||||
$_.PackageName -NotLike "*Notepad*" -and
|
|
||||||
$_.PackageName -NotLike "*Printing*" -and
|
|
||||||
$_.PackageName -NotLike "*Wifi*" -and
|
|
||||||
$_.PackageName -NotLike "*Foundation*" -and
|
|
||||||
$_.PackageName -NotLike "*YourPhone*" -and
|
|
||||||
$_.PackageName -NotLike "*Xbox*" -and
|
|
||||||
$_.PackageName -NotLike "*WindowsTerminal*" -and
|
|
||||||
$_.PackageName -NotLike "*Calculator*" -and
|
|
||||||
$_.PackageName -NotLike "*Photos*" -and
|
|
||||||
$_.PackageName -NotLike "*VCLibs*" -and
|
|
||||||
$_.PackageName -NotLike "*Paint*" -and
|
|
||||||
$_.PackageName -NotLike "*Gaming*" -and
|
|
||||||
$_.PackageName -NotLike "*Extension*" -and
|
|
||||||
$_.PackageName -NotLike "*SecHealthUI*"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$counter = 0
|
|
||||||
foreach ($appx in $appxProvisionedPackages) {
|
|
||||||
$status = "Removing Provisioned $($appx.PackageName)"
|
|
||||||
Write-Progress -Activity "Removing Provisioned Apps" -Status $status -PercentComplete ($counter++/$appxProvisionedPackages.Count*100)
|
|
||||||
try {
|
|
||||||
Remove-AppxProvisionedPackage -Path "$scratchDir" -PackageName $appx.PackageName -ErrorAction SilentlyContinue
|
|
||||||
} catch {
|
|
||||||
Write-Host "Application $($appx.PackageName) could not be removed"
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Write-Progress -Activity "Removing Provisioned Apps" -Status "Ready" -Completed
|
|
||||||
}
|
|
||||||
|
|
||||||
function Copy-ToUSB([string]$fileToCopy) {
|
|
||||||
foreach ($volume in Get-Volume) {
|
|
||||||
if ($volume -and $volume.FileSystemLabel -ieq "ventoy") {
|
|
||||||
$destinationPath = "$($volume.DriveLetter):\"
|
|
||||||
#Copy-Item -Path $fileToCopy -Destination $destinationPath -Force
|
|
||||||
# Get the total size of the file
|
|
||||||
$totalSize = (Get-Item "$fileToCopy").length
|
|
||||||
|
|
||||||
Copy-Item -Path "$fileToCopy" -Destination "$destinationPath" -Verbose -Force -Recurse -Container -PassThru |
|
|
||||||
ForEach-Object {
|
|
||||||
# Calculate the percentage completed
|
|
||||||
$completed = ($_.BytesTransferred / $totalSize) * 100
|
|
||||||
|
|
||||||
# Display the progress bar
|
|
||||||
Write-Progress -Activity "Copying File" -Status "Progress" -PercentComplete $completed -CurrentOperation ("{0:N2} MB / {1:N2} MB" -f ($_.BytesTransferred / 1MB), ($totalSize / 1MB))
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "File copied to Ventoy drive $($volume.DriveLetter)"
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Write-Host "Ventoy USB Key is not inserted"
|
|
||||||
}
|
|
||||||
|
|
||||||
function Remove-FileOrDirectory([string]$pathToDelete, [string]$mask = "", [switch]$Directory = $false) {
|
|
||||||
if(([string]::IsNullOrEmpty($pathToDelete))) { return }
|
|
||||||
if (-not (Test-Path -Path "$($pathToDelete)")) { return }
|
|
||||||
|
|
||||||
$yesNo = Get-LocalizedYesNo
|
|
||||||
Write-Host "[INFO] In Your local takeown expects '$($yesNo[0])' as a Yes answer."
|
|
||||||
|
|
||||||
$itemsToDelete = [System.Collections.ArrayList]::new()
|
|
||||||
|
|
||||||
if ($mask -eq "") {
|
|
||||||
Write-Debug "Adding $($pathToDelete) to array."
|
|
||||||
[void]$itemsToDelete.Add($pathToDelete)
|
|
||||||
} else {
|
|
||||||
Write-Debug "Adding $($pathToDelete) to array and mask is $($mask)"
|
|
||||||
if ($Directory) { $itemsToDelete = Get-ChildItem $pathToDelete -Include $mask -Recurse -Directory } else { $itemsToDelete = Get-ChildItem $pathToDelete -Include $mask -Recurse }
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($itemToDelete in $itemsToDelete) {
|
|
||||||
$status = "Deleting $($itemToDelete)"
|
|
||||||
Write-Progress -Activity "Removing Items" -Status $status -PercentComplete ($counter++/$itemsToDelete.Count*100)
|
|
||||||
|
|
||||||
if (Test-Path -Path "$($itemToDelete)" -PathType Container) {
|
|
||||||
$status = "Deleting directory: $($itemToDelete)"
|
|
||||||
|
|
||||||
takeown /r /d $yesNo[0] /a /f "$($itemToDelete)"
|
|
||||||
icacls "$($itemToDelete)" /q /c /t /reset
|
|
||||||
icacls $itemToDelete /setowner "*S-1-5-32-544"
|
|
||||||
icacls $itemToDelete /grant "*S-1-5-32-544:(OI)(CI)F" /t /c /q
|
|
||||||
Remove-Item -Force -Recurse "$($itemToDelete)"
|
|
||||||
}
|
|
||||||
elseif (Test-Path -Path "$($itemToDelete)" -PathType Leaf) {
|
|
||||||
$status = "Deleting file: $($itemToDelete)"
|
|
||||||
|
|
||||||
takeown /a /f "$($itemToDelete)"
|
|
||||||
icacls "$($itemToDelete)" /q /c /t /reset
|
|
||||||
icacls "$($itemToDelete)" /setowner "*S-1-5-32-544"
|
|
||||||
icacls "$($itemToDelete)" /grant "*S-1-5-32-544:(OI)(CI)F" /t /c /q
|
|
||||||
Remove-Item -Force "$($itemToDelete)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Write-Progress -Activity "Removing Items" -Status "Ready" -Completed
|
|
||||||
}
|
|
||||||
|
|
||||||
function New-Unattend {
|
|
||||||
|
|
||||||
$unattend = @'
|
$unattend = @'
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<unattend xmlns="urn:schemas-microsoft-com:unattend"
|
<unattend xmlns="urn:schemas-microsoft-com:unattend"
|
||||||
@ -261,21 +27,21 @@ function New-Unattend {
|
|||||||
<UserAccounts>
|
<UserAccounts>
|
||||||
<LocalAccounts>
|
<LocalAccounts>
|
||||||
<LocalAccount wcm:action="add">
|
<LocalAccount wcm:action="add">
|
||||||
<Name>User</Name>
|
<Name>USER-REPLACEME</Name>
|
||||||
<Group>Administrators</Group>
|
<Group>Administrators</Group>
|
||||||
<Password>
|
<Password>
|
||||||
<Value></Value>
|
<Value>PW-REPLACEME</Value>
|
||||||
<PlainText>true</PlainText>
|
<PlainText>true</PlainText>
|
||||||
</Password>
|
</Password>
|
||||||
</LocalAccount>
|
</LocalAccount>
|
||||||
</LocalAccounts>
|
</LocalAccounts>
|
||||||
</UserAccounts>
|
</UserAccounts>
|
||||||
<AutoLogon>
|
<AutoLogon>
|
||||||
<Username>User</Username>
|
<Username>USER-REPLACEME</Username>
|
||||||
<Enabled>true</Enabled>
|
<Enabled>true</Enabled>
|
||||||
<LogonCount>1</LogonCount>
|
<LogonCount>1</LogonCount>
|
||||||
<Password>
|
<Password>
|
||||||
<Value></Value>
|
<Value>PW-REPLACEME</Value>
|
||||||
<PlainText>true</PlainText>
|
<PlainText>true</PlainText>
|
||||||
</Password>
|
</Password>
|
||||||
</AutoLogon>
|
</AutoLogon>
|
||||||
@ -394,7 +160,7 @@ function New-Unattend {
|
|||||||
</RunSynchronousCommand>
|
</RunSynchronousCommand>
|
||||||
<RunSynchronousCommand wcm:action="add">
|
<RunSynchronousCommand wcm:action="add">
|
||||||
<Order>19</Order>
|
<Order>19</Order>
|
||||||
<Path>powershell.exe -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Temp\remove-packages.ps1' -Raw | Invoke-Expression;"</Path>
|
<Path>powershell.exe -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Temp\Microwin-RemovePackages.ps1' -Raw | Invoke-Expression;"</Path>
|
||||||
</RunSynchronousCommand>
|
</RunSynchronousCommand>
|
||||||
<RunSynchronousCommand wcm:action="add">
|
<RunSynchronousCommand wcm:action="add">
|
||||||
<Order>20</Order>
|
<Order>20</Order>
|
||||||
@ -528,181 +294,17 @@ function New-Unattend {
|
|||||||
</component>
|
</component>
|
||||||
</settings>
|
</settings>
|
||||||
'@
|
'@
|
||||||
if ((Test-CompatibleImage $imgVersion $([System.Version]::new(10,0,22000,1))) -eq $false) {
|
if ((Microwin-TestCompatibleImage $imgVersion $([System.Version]::new(10,0,22000,1))) -eq $false) {
|
||||||
# Replace the placeholder text with an empty string to make it valid for Windows 10 Setup
|
# Replace the placeholder text with an empty string to make it valid for Windows 10 Setup
|
||||||
$unattend = $unattend.Replace("<#REPLACEME#>", "").Trim()
|
$unattend = $unattend.Replace("<#REPLACEME#>", "").Trim()
|
||||||
} else {
|
} else {
|
||||||
# Replace the placeholder text with the Specialize pass
|
# Replace the placeholder text with the Specialize pass
|
||||||
$unattend = $unattend.Replace("<#REPLACEME#>", $specPass).Trim()
|
$unattend = $unattend.Replace("<#REPLACEME#>", $specPass).Trim()
|
||||||
}
|
}
|
||||||
|
# Replace default User and Password values with the provided parameters
|
||||||
|
$unattend = $unattend.Replace("USER-REPLACEME", $userName).Trim()
|
||||||
|
$unattend = $unattend.Replace("PW-REPLACEME", $userPassword).Trim()
|
||||||
|
|
||||||
|
# Save unattended answer file with UTF-8 encoding
|
||||||
$unattend | Out-File -FilePath "$env:temp\unattend.xml" -Force -Encoding utf8
|
$unattend | Out-File -FilePath "$env:temp\unattend.xml" -Force -Encoding utf8
|
||||||
}
|
}
|
||||||
|
|
||||||
function New-CheckInstall {
|
|
||||||
|
|
||||||
# using here string to embedd firstrun
|
|
||||||
$checkInstall = @'
|
|
||||||
@echo off
|
|
||||||
if exist "C:\windows\cpu.txt" (
|
|
||||||
echo C:\windows\cpu.txt exists
|
|
||||||
) else (
|
|
||||||
echo C:\windows\cpu.txt does not exist
|
|
||||||
)
|
|
||||||
if exist "C:\windows\SerialNumber.txt" (
|
|
||||||
echo C:\windows\SerialNumber.txt exists
|
|
||||||
) else (
|
|
||||||
echo C:\windows\SerialNumber.txt does not exist
|
|
||||||
)
|
|
||||||
if exist "C:\unattend.xml" (
|
|
||||||
echo C:\unattend.xml exists
|
|
||||||
) else (
|
|
||||||
echo C:\unattend.xml does not exist
|
|
||||||
)
|
|
||||||
if exist "C:\Windows\Setup\Scripts\SetupComplete.cmd" (
|
|
||||||
echo C:\Windows\Setup\Scripts\SetupComplete.cmd exists
|
|
||||||
) else (
|
|
||||||
echo C:\Windows\Setup\Scripts\SetupComplete.cmd does not exist
|
|
||||||
)
|
|
||||||
if exist "C:\Windows\Panther\unattend.xml" (
|
|
||||||
echo C:\Windows\Panther\unattend.xml exists
|
|
||||||
) else (
|
|
||||||
echo C:\Windows\Panther\unattend.xml does not exist
|
|
||||||
)
|
|
||||||
if exist "C:\Windows\System32\Sysprep\unattend.xml" (
|
|
||||||
echo C:\Windows\System32\Sysprep\unattend.xml exists
|
|
||||||
) else (
|
|
||||||
echo C:\Windows\System32\Sysprep\unattend.xml does not exist
|
|
||||||
)
|
|
||||||
if exist "C:\Windows\FirstStartup.ps1" (
|
|
||||||
echo C:\Windows\FirstStartup.ps1 exists
|
|
||||||
) else (
|
|
||||||
echo C:\Windows\FirstStartup.ps1 does not exist
|
|
||||||
)
|
|
||||||
if exist "C:\Windows\winutil.ps1" (
|
|
||||||
echo C:\Windows\winutil.ps1 exists
|
|
||||||
) else (
|
|
||||||
echo C:\Windows\winutil.ps1 does not exist
|
|
||||||
)
|
|
||||||
if exist "C:\Windows\LogSpecialize.txt" (
|
|
||||||
echo C:\Windows\LogSpecialize.txt exists
|
|
||||||
) else (
|
|
||||||
echo C:\Windows\LogSpecialize.txt does not exist
|
|
||||||
)
|
|
||||||
if exist "C:\Windows\LogAuditUser.txt" (
|
|
||||||
echo C:\Windows\LogAuditUser.txt exists
|
|
||||||
) else (
|
|
||||||
echo C:\Windows\LogAuditUser.txt does not exist
|
|
||||||
)
|
|
||||||
if exist "C:\Windows\LogOobeSystem.txt" (
|
|
||||||
echo C:\Windows\LogOobeSystem.txt exists
|
|
||||||
) else (
|
|
||||||
echo C:\Windows\LogOobeSystem.txt does not exist
|
|
||||||
)
|
|
||||||
if exist "c:\windows\csup.txt" (
|
|
||||||
echo c:\windows\csup.txt exists
|
|
||||||
) else (
|
|
||||||
echo c:\windows\csup.txt does not exist
|
|
||||||
)
|
|
||||||
if exist "c:\windows\LogFirstRun.txt" (
|
|
||||||
echo c:\windows\LogFirstRun.txt exists
|
|
||||||
) else (
|
|
||||||
echo c:\windows\LogFirstRun.txt does not exist
|
|
||||||
)
|
|
||||||
'@
|
|
||||||
$checkInstall | Out-File -FilePath "$env:temp\checkinstall.cmd" -Force -Encoding Ascii
|
|
||||||
}
|
|
||||||
|
|
||||||
function New-FirstRun {
|
|
||||||
|
|
||||||
# using here string to embedd firstrun
|
|
||||||
$firstRun = @'
|
|
||||||
# Set the global error action preference to continue
|
|
||||||
$ErrorActionPreference = "Continue"
|
|
||||||
function Remove-RegistryValue {
|
|
||||||
param (
|
|
||||||
[Parameter(Mandatory = $true)]
|
|
||||||
[string]$RegistryPath,
|
|
||||||
|
|
||||||
[Parameter(Mandatory = $true)]
|
|
||||||
[string]$ValueName
|
|
||||||
)
|
|
||||||
|
|
||||||
# Check if the registry path exists
|
|
||||||
if (Test-Path -Path $RegistryPath) {
|
|
||||||
$registryValue = Get-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
# Check if the registry value exists
|
|
||||||
if ($registryValue) {
|
|
||||||
# Remove the registry value
|
|
||||||
Remove-ItemProperty -Path $RegistryPath -Name $ValueName -Force
|
|
||||||
Write-Host "Registry value '$ValueName' removed from '$RegistryPath'."
|
|
||||||
} else {
|
|
||||||
Write-Host "Registry value '$ValueName' not found in '$RegistryPath'."
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Write-Host "Registry path '$RegistryPath' not found."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
"FirstStartup has worked" | Out-File -FilePath c:\windows\LogFirstRun.txt -Append -NoClobber
|
|
||||||
|
|
||||||
$taskbarPath = "$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
|
|
||||||
# Delete all files on the Taskbar
|
|
||||||
Get-ChildItem -Path $taskbarPath -File | Remove-Item -Force
|
|
||||||
Remove-RegistryValue -RegistryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -ValueName "FavoritesRemovedChanges"
|
|
||||||
Remove-RegistryValue -RegistryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -ValueName "FavoritesChanges"
|
|
||||||
Remove-RegistryValue -RegistryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -ValueName "Favorites"
|
|
||||||
|
|
||||||
# Delete Edge Icon from the desktop
|
|
||||||
$edgeShortcutFiles = Get-ChildItem -Path $desktopPath -Filter "*Edge*.lnk"
|
|
||||||
# Check if Edge shortcuts exist on the desktop
|
|
||||||
if ($edgeShortcutFiles) {
|
|
||||||
foreach ($shortcutFile in $edgeShortcutFiles) {
|
|
||||||
# Remove each Edge shortcut
|
|
||||||
Remove-Item -Path $shortcutFile.FullName -Force
|
|
||||||
Write-Host "Edge shortcut '$($shortcutFile.Name)' removed from the desktop."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Remove-Item -Path "$env:USERPROFILE\Desktop\*.lnk"
|
|
||||||
Remove-Item -Path "C:\Users\Default\Desktop\*.lnk"
|
|
||||||
|
|
||||||
# ************************************************
|
|
||||||
# Create WinUtil shortcut on the desktop
|
|
||||||
#
|
|
||||||
$desktopPath = "$($env:USERPROFILE)\Desktop"
|
|
||||||
# Specify the target PowerShell command
|
|
||||||
$command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'irm https://christitus.com/win | iex'"
|
|
||||||
# Specify the path for the shortcut
|
|
||||||
$shortcutPath = Join-Path $desktopPath 'winutil.lnk'
|
|
||||||
# Create a shell object
|
|
||||||
$shell = New-Object -ComObject WScript.Shell
|
|
||||||
|
|
||||||
# Create a shortcut object
|
|
||||||
$shortcut = $shell.CreateShortcut($shortcutPath)
|
|
||||||
|
|
||||||
if (Test-Path -Path "c:\Windows\cttlogo.png") {
|
|
||||||
$shortcut.IconLocation = "c:\Windows\cttlogo.png"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Set properties of the shortcut
|
|
||||||
$shortcut.TargetPath = "powershell.exe"
|
|
||||||
$shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -Command `"$command`""
|
|
||||||
# Save the shortcut
|
|
||||||
$shortcut.Save()
|
|
||||||
|
|
||||||
# Make the shortcut have 'Run as administrator' property on
|
|
||||||
$bytes = [System.IO.File]::ReadAllBytes($shortcutPath)
|
|
||||||
# Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex
|
|
||||||
$bytes[0x15] = $bytes[0x15] -bor 0x20
|
|
||||||
[System.IO.File]::WriteAllBytes($shortcutPath, $bytes)
|
|
||||||
|
|
||||||
Write-Host "Shortcut created at: $shortcutPath"
|
|
||||||
#
|
|
||||||
# Done create WinUtil shortcut on the desktop
|
|
||||||
# ************************************************
|
|
||||||
|
|
||||||
Start-Process explorer
|
|
||||||
|
|
||||||
'@
|
|
||||||
$firstRun | Out-File -FilePath "$env:temp\FirstStartup.ps1" -Force
|
|
||||||
}
|
|
40
functions/microwin/Microwin-RemoveFeatures.ps1
Normal file
40
functions/microwin/Microwin-RemoveFeatures.ps1
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
function Microwin-RemoveFeatures() {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Removes certain features from ISO image
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
No Params
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Microwin-RemoveFeatures
|
||||||
|
#>
|
||||||
|
try {
|
||||||
|
$featlist = (Get-WindowsOptionalFeature -Path $scratchDir)
|
||||||
|
|
||||||
|
$featlist = $featlist | Where-Object {
|
||||||
|
$_.FeatureName -NotLike "*Defender*" -AND
|
||||||
|
$_.FeatureName -NotLike "*Printing*" -AND
|
||||||
|
$_.FeatureName -NotLike "*TelnetClient*" -AND
|
||||||
|
$_.FeatureName -NotLike "*PowerShell*" -AND
|
||||||
|
$_.FeatureName -NotLike "*NetFx*" -AND
|
||||||
|
$_.FeatureName -NotLike "*Media*" -AND
|
||||||
|
$_.FeatureName -NotLike "*NFS*" -AND
|
||||||
|
$_.FeatureName -NotLike "*SearchEngine*" -AND
|
||||||
|
$_.FeatureName -NotLike "*RemoteDesktop*" -AND
|
||||||
|
$_.State -ne "Disabled"
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($feature in $featlist) {
|
||||||
|
$status = "Removing feature $($feature.FeatureName)"
|
||||||
|
Write-Progress -Activity "Removing features" -Status $status -PercentComplete ($counter++/$featlist.Count*100)
|
||||||
|
Write-Debug "Removing feature $($feature.FeatureName)"
|
||||||
|
Disable-WindowsOptionalFeature -Path "$scratchDir" -FeatureName $($feature.FeatureName) -Remove -ErrorAction SilentlyContinue -NoRestart
|
||||||
|
}
|
||||||
|
Write-Progress -Activity "Removing features" -Status "Ready" -Completed
|
||||||
|
Write-Host "You can re-enable the disabled features at any time, using either Windows Update or the SxS folder in <installation media>\Sources."
|
||||||
|
} catch {
|
||||||
|
Write-Host "Unable to get information about the features. MicroWin processing will continue, but features will not be processed"
|
||||||
|
Write-Host "Error information: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
}
|
42
functions/microwin/Microwin-RemoveFileOrDirectory.ps1
Normal file
42
functions/microwin/Microwin-RemoveFileOrDirectory.ps1
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
function Microwin-RemoveFileOrDirectory([string]$pathToDelete, [string]$mask = "", [switch]$Directory = $false) {
|
||||||
|
if(([string]::IsNullOrEmpty($pathToDelete))) { return }
|
||||||
|
if (-not (Test-Path -Path "$($pathToDelete)")) { return }
|
||||||
|
|
||||||
|
$yesNo = Get-LocalizedYesNo
|
||||||
|
Write-Host "[INFO] In Your local takeown expects '$($yesNo[0])' as a Yes answer."
|
||||||
|
|
||||||
|
$itemsToDelete = [System.Collections.ArrayList]::new()
|
||||||
|
|
||||||
|
if ($mask -eq "") {
|
||||||
|
Write-Debug "Adding $($pathToDelete) to array."
|
||||||
|
[void]$itemsToDelete.Add($pathToDelete)
|
||||||
|
} else {
|
||||||
|
Write-Debug "Adding $($pathToDelete) to array and mask is $($mask)"
|
||||||
|
if ($Directory) { $itemsToDelete = Get-ChildItem $pathToDelete -Include $mask -Recurse -Directory } else { $itemsToDelete = Get-ChildItem $pathToDelete -Include $mask -Recurse }
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($itemToDelete in $itemsToDelete) {
|
||||||
|
$status = "Deleting $($itemToDelete)"
|
||||||
|
Write-Progress -Activity "Removing Items" -Status $status -PercentComplete ($counter++/$itemsToDelete.Count*100)
|
||||||
|
|
||||||
|
if (Test-Path -Path "$($itemToDelete)" -PathType Container) {
|
||||||
|
$status = "Deleting directory: $($itemToDelete)"
|
||||||
|
|
||||||
|
takeown /r /d $yesNo[0] /a /f "$($itemToDelete)"
|
||||||
|
icacls "$($itemToDelete)" /q /c /t /reset
|
||||||
|
icacls $itemToDelete /setowner "*S-1-5-32-544"
|
||||||
|
icacls $itemToDelete /grant "*S-1-5-32-544:(OI)(CI)F" /t /c /q
|
||||||
|
Remove-Item -Force -Recurse "$($itemToDelete)"
|
||||||
|
}
|
||||||
|
elseif (Test-Path -Path "$($itemToDelete)" -PathType Leaf) {
|
||||||
|
$status = "Deleting file: $($itemToDelete)"
|
||||||
|
|
||||||
|
takeown /a /f "$($itemToDelete)"
|
||||||
|
icacls "$($itemToDelete)" /q /c /t /reset
|
||||||
|
icacls "$($itemToDelete)" /setowner "*S-1-5-32-544"
|
||||||
|
icacls "$($itemToDelete)" /grant "*S-1-5-32-544:(OI)(CI)F" /t /c /q
|
||||||
|
Remove-Item -Force "$($itemToDelete)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Write-Progress -Activity "Removing Items" -Status "Ready" -Completed
|
||||||
|
}
|
96
functions/microwin/Microwin-RemovePackages.ps1
Normal file
96
functions/microwin/Microwin-RemovePackages.ps1
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
function Microwin-RemovePackages {
|
||||||
|
try {
|
||||||
|
$pkglist = (Get-WindowsPackage -Path "$scratchDir").PackageName
|
||||||
|
|
||||||
|
$pkglist = $pkglist | Where-Object {
|
||||||
|
$_ -NotLike "*ApplicationModel*" -AND
|
||||||
|
$_ -NotLike "*indows-Client-LanguagePack*" -AND
|
||||||
|
$_ -NotLike "*LanguageFeatures-Basic*" -AND
|
||||||
|
$_ -NotLike "*Package_for_ServicingStack*" -AND
|
||||||
|
$_ -NotLike "*.NET*" -AND
|
||||||
|
$_ -NotLike "*Store*" -AND
|
||||||
|
$_ -NotLike "*VCLibs*" -AND
|
||||||
|
$_ -NotLike "*AAD.BrokerPlugin",
|
||||||
|
$_ -NotLike "*LockApp*" -AND
|
||||||
|
$_ -NotLike "*Notepad*" -AND
|
||||||
|
$_ -NotLike "*immersivecontrolpanel*" -AND
|
||||||
|
$_ -NotLike "*ContentDeliveryManager*" -AND
|
||||||
|
$_ -NotLike "*PinningConfirMationDialog*" -AND
|
||||||
|
$_ -NotLike "*SecHealthUI*" -AND
|
||||||
|
$_ -NotLike "*SecureAssessmentBrowser*" -AND
|
||||||
|
$_ -NotLike "*PrintDialog*" -AND
|
||||||
|
$_ -NotLike "*AssignedAccessLockApp*" -AND
|
||||||
|
$_ -NotLike "*OOBENetworkConnectionFlow*" -AND
|
||||||
|
$_ -NotLike "*Apprep.ChxApp*" -AND
|
||||||
|
$_ -NotLike "*CBS*" -AND
|
||||||
|
$_ -NotLike "*OOBENetworkCaptivePortal*" -AND
|
||||||
|
$_ -NotLike "*PeopleExperienceHost*" -AND
|
||||||
|
$_ -NotLike "*ParentalControls*" -AND
|
||||||
|
$_ -NotLike "*Win32WebViewHost*" -AND
|
||||||
|
$_ -NotLike "*InputApp*" -AND
|
||||||
|
$_ -NotLike "*DirectPlay*" -AND
|
||||||
|
$_ -NotLike "*AccountsControl*" -AND
|
||||||
|
$_ -NotLike "*AsyncTextService*" -AND
|
||||||
|
$_ -NotLike "*CapturePicker*" -AND
|
||||||
|
$_ -NotLike "*CredDialogHost*" -AND
|
||||||
|
$_ -NotLike "*BioEnrollMent*" -AND
|
||||||
|
$_ -NotLike "*ShellExperienceHost*" -AND
|
||||||
|
$_ -NotLike "*DesktopAppInstaller*" -AND
|
||||||
|
$_ -NotLike "*WebMediaExtensions*" -AND
|
||||||
|
$_ -NotLike "*WMIC*" -AND
|
||||||
|
$_ -NotLike "*UI.XaML*" -AND
|
||||||
|
$_ -NotLike "*Ethernet*" -AND
|
||||||
|
$_ -NotLike "*Wifi*" -AND
|
||||||
|
$_ -NotLike "*FodMetadata*" -AND
|
||||||
|
$_ -NotLike "*Foundation*" -AND
|
||||||
|
$_ -NotLike "*LanguageFeatures*" -AND
|
||||||
|
$_ -NotLike "*VBSCRIPT*" -AND
|
||||||
|
$_ -NotLike "*License*"
|
||||||
|
}
|
||||||
|
|
||||||
|
$failedCount = 0
|
||||||
|
|
||||||
|
$erroredPackages = [System.Collections.Generic.List[ErroredPackage]]::new()
|
||||||
|
|
||||||
|
foreach ($pkg in $pkglist) {
|
||||||
|
try {
|
||||||
|
$status = "Removing $pkg"
|
||||||
|
Write-Progress -Activity "Removing Packages" -Status $status -PercentComplete ($counter++/$pkglist.Count*100)
|
||||||
|
Remove-WindowsPackage -Path "$scratchDir" -PackageName $pkg -NoRestart -ErrorAction SilentlyContinue
|
||||||
|
} catch {
|
||||||
|
# This can happen if the package that is being removed is a permanent one
|
||||||
|
$erroredPackages.Add([ErroredPackage]::new($pkg, $_.Exception.Message))
|
||||||
|
$failedCount += 1
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Write-Progress -Activity "Removing Packages" -Status "Ready" -Completed
|
||||||
|
if ($failedCount -gt 0)
|
||||||
|
{
|
||||||
|
Write-Host "$failedCount package(s) could not be removed. Your image will still work fine, however. Below is information on what packages failed to be removed and why."
|
||||||
|
if ($erroredPackages.Count -gt 0)
|
||||||
|
{
|
||||||
|
$erroredPackages = $erroredPackages | Sort-Object -Property ErrorMessage
|
||||||
|
|
||||||
|
$previousErroredPackage = $erroredPackages[0]
|
||||||
|
$counter = 0
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "- $($previousErroredPackage.ErrorMessage)"
|
||||||
|
foreach ($erroredPackage in $erroredPackages) {
|
||||||
|
if ($erroredPackage.ErrorMessage -ne $previousErroredPackage.ErrorMessage) {
|
||||||
|
Write-Host ""
|
||||||
|
$counter = 0
|
||||||
|
Write-Host "- $($erroredPackage.ErrorMessage)"
|
||||||
|
}
|
||||||
|
$counter += 1
|
||||||
|
Write-Host " $counter) $($erroredPackage.PackageName)"
|
||||||
|
$previousErroredPackage = $erroredPackage
|
||||||
|
}
|
||||||
|
Write-Host ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Host "Unable to get information about the packages. MicroWin processing will continue, but packages will not be processed"
|
||||||
|
Write-Host "Error information: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
}
|
51
functions/microwin/Microwin-RemoveProvisionedPackages.ps1
Normal file
51
functions/microwin/Microwin-RemoveProvisionedPackages.ps1
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
function Microwin-RemoveProvisionedPackages() {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Removes AppX packages from a Windows image during MicroWin processing
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
No Params
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Microwin-RemoveProvisionedPackages
|
||||||
|
#>
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$appxProvisionedPackages = Get-AppxProvisionedPackage -Path "$($scratchDir)" | Where-Object {
|
||||||
|
$_.PackageName -NotLike "*AppInstaller*" -AND
|
||||||
|
$_.PackageName -NotLike "*Store*" -and
|
||||||
|
$_.PackageName -NotLike "*Notepad*" -and
|
||||||
|
$_.PackageName -NotLike "*Printing*" -and
|
||||||
|
$_.PackageName -NotLike "*YourPhone*" -and
|
||||||
|
$_.PackageName -NotLike "*Xbox*" -and
|
||||||
|
$_.PackageName -NotLike "*WindowsTerminal*" -and
|
||||||
|
$_.PackageName -NotLike "*Calculator*" -and
|
||||||
|
$_.PackageName -NotLike "*Photos*" -and
|
||||||
|
$_.PackageName -NotLike "*VCLibs*" -and
|
||||||
|
$_.PackageName -NotLike "*Paint*" -and
|
||||||
|
$_.PackageName -NotLike "*Gaming*" -and
|
||||||
|
$_.PackageName -NotLike "*Extension*" -and
|
||||||
|
$_.PackageName -NotLike "*SecHealthUI*" -and
|
||||||
|
$_.PackageName -NotLike "*ScreenSketch*"
|
||||||
|
}
|
||||||
|
|
||||||
|
$counter = 0
|
||||||
|
foreach ($appx in $appxProvisionedPackages) {
|
||||||
|
$status = "Removing Provisioned $($appx.PackageName)"
|
||||||
|
Write-Progress -Activity "Removing Provisioned Apps" -Status $status -PercentComplete ($counter++/$appxProvisionedPackages.Count*100)
|
||||||
|
try {
|
||||||
|
Remove-AppxProvisionedPackage -Path "$scratchDir" -PackageName $appx.PackageName -ErrorAction SilentlyContinue
|
||||||
|
} catch {
|
||||||
|
Write-Host "Application $($appx.PackageName) could not be removed"
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Write-Progress -Activity "Removing Provisioned Apps" -Status "Ready" -Completed
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
# This can happen if getting AppX packages fails
|
||||||
|
Write-Host "Unable to get information about the AppX packages. MicroWin processing will continue, but AppX packages will not be processed"
|
||||||
|
Write-Host "Error information: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
}
|
26
functions/microwin/Microwin-TestCompatibleImage.ps1
Normal file
26
functions/microwin/Microwin-TestCompatibleImage.ps1
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
function Microwin-TestCompatibleImage() {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks the version of a Windows image and determines whether or not it is compatible with a specific feature depending on a desired version
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
imgVersion - The version of the Windows image
|
||||||
|
desiredVersion - The version to compare the image version with
|
||||||
|
#>
|
||||||
|
|
||||||
|
param
|
||||||
|
(
|
||||||
|
[Parameter(Mandatory, position=0)]
|
||||||
|
[string]$imgVersion,
|
||||||
|
|
||||||
|
[Parameter(Mandatory, position=1)]
|
||||||
|
[Version]$desiredVersion
|
||||||
|
)
|
||||||
|
|
||||||
|
try {
|
||||||
|
$version = [Version]$imgVersion
|
||||||
|
return $version -ge $desiredVersion
|
||||||
|
} catch {
|
||||||
|
return $False
|
||||||
|
}
|
||||||
|
}
|
@ -1,92 +0,0 @@
|
|||||||
function ConvertTo-Icon {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.DESCRIPTION
|
|
||||||
This function will convert BMP, GIF, EXIF, JPG, PNG and TIFF to ICO file
|
|
||||||
|
|
||||||
.PARAMETER bitmapPath
|
|
||||||
The file path to bitmap image to make '.ico' file out of.
|
|
||||||
Supported file types according to Microsoft Documentation is the following:
|
|
||||||
BMP, GIF, EXIF, JPG, PNG and TIFF.
|
|
||||||
|
|
||||||
.PARAMETER iconPath
|
|
||||||
The file path to write the new '.ico' resource.
|
|
||||||
|
|
||||||
.PARAMETER overrideIconFile
|
|
||||||
An optional boolean Parameter that makes the function overrides
|
|
||||||
the Icon File Path if the file exists. Defaults to $true.
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
try {
|
|
||||||
ConvertTo-Icon -bitmapPath "$env:TEMP\cttlogo.png" -iconPath "$env:TEMP\cttlogo.ico"
|
|
||||||
} catch [System.IO.FileNotFoundException] {
|
|
||||||
# Handle the thrown exception here...
|
|
||||||
}
|
|
||||||
|
|
||||||
This Example makes a '.ico' file at "$env:TEMP\cttlogo.ico" File Path using the bitmap file
|
|
||||||
found in "$env:TEMP\cttlogo.png", the function overrides the '.ico' File if it's found.
|
|
||||||
this function will throw a FileNotFound Exception at the event of not finding the provided bitmap File Path.
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
try {
|
|
||||||
ConvertTo-Icon "$env:TEMP\cttlogo.png" "$env:TEMP\cttlogo.ico"
|
|
||||||
} catch [System.IO.FileNotFoundException] {
|
|
||||||
# Handle the thrown exception here...
|
|
||||||
}
|
|
||||||
|
|
||||||
This Example is the same as Example 1, but uses Positional Parameters instead.
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
if (Test-Path "$env:TEMP\cttlogo.png") {
|
|
||||||
ConvertTo-Icon -bitmapPath "$env:TEMP\cttlogo.png" -iconPath "$env:TEMP\cttlogo.ico"
|
|
||||||
}
|
|
||||||
|
|
||||||
This Example is same as Example 1, but checks if the bitmap File exists before calling 'ConvertTo-Icon' Function.
|
|
||||||
This's the recommended way of using this function, as it doesn't require any try-catch blocks.
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
try {
|
|
||||||
ConvertTo-Icon -bitmapPath "$env:TEMP\cttlogo.png" -iconPath "$env:TEMP\cttlogo.ico" -overrideIconFile $false
|
|
||||||
} catch [System.IO.FileNotFoundException] {
|
|
||||||
# Handle the thrown exception here...
|
|
||||||
}
|
|
||||||
|
|
||||||
This Example make use of '-overrideIconFile' Optional Parameter, the default for this parameter is $true.
|
|
||||||
By doing '-overrideIconFile $false', the 'ConvertTo-Icon' function will raise an exception that needs to be catched throw a 'catch' Code Block,
|
|
||||||
otherwise it'll crash the running PowerShell instance/process.
|
|
||||||
|
|
||||||
#>
|
|
||||||
param(
|
|
||||||
[Parameter(Mandatory, position=0)]
|
|
||||||
[string]$bitmapPath,
|
|
||||||
[Parameter(Mandatory, position=1)]
|
|
||||||
[string]$iconPath,
|
|
||||||
[Parameter(position=2)]
|
|
||||||
[bool]$overrideIconFile = $true
|
|
||||||
)
|
|
||||||
|
|
||||||
Add-Type -AssemblyName System.Drawing
|
|
||||||
|
|
||||||
if (Test-Path $bitmapPath) {
|
|
||||||
if ((Test-Path $iconPath) -AND ($overrideIconFile -eq $false)) {
|
|
||||||
Write-Host "[ConvertTo-Icon] Icon File is found at '$iconPath', and the 'overrideIconFile' Parameter is set to '$overrideIconFile'. Skipping the bitmap to icon convertion..." -ForegroundColor Yellow
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# Load bitmap file into memory, and make an Icon version out of it
|
|
||||||
$b = [System.Drawing.Bitmap]::FromFile($bitmapPath)
|
|
||||||
$icon = [System.Drawing.Icon]::FromHandle($b.GetHicon())
|
|
||||||
|
|
||||||
# Create the folder for the new icon file if it doesn't exists
|
|
||||||
$iconFolder = (New-Object System.IO.FileInfo($iconPath)).Directory.FullName
|
|
||||||
[System.IO.Directory]::CreateDirectory($iconFolder) | Out-Null
|
|
||||||
|
|
||||||
# Write the Icon File and do some cleaning-up
|
|
||||||
$file = New-Object System.IO.FileStream($iconPath, 'OpenOrCreate')
|
|
||||||
$icon.Save($file)
|
|
||||||
$file.Close()
|
|
||||||
$icon.Dispose()
|
|
||||||
} else {
|
|
||||||
throw [System.IO.FileNotFoundException] "[ConvertTo-Icon] The provided bitmap File Path is not found at '$bitmapPath'."
|
|
||||||
}
|
|
||||||
}
|
|
@ -19,10 +19,10 @@ function Copy-Files {
|
|||||||
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) file(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 = "Copying file {0} of {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, ''
|
||||||
|
|
||||||
@ -37,7 +37,11 @@ function Copy-Files {
|
|||||||
}
|
}
|
||||||
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-Host "Unable to Copy all the files due to an unhandled exception" -ForegroundColor Yellow
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
Write-Host "Error information: $($_.Exception.Message)`n" -ForegroundColor Yellow
|
||||||
|
Write-Host "Additional information:" -ForegroundColor Yellow
|
||||||
|
Write-Host $PSItem.Exception.StackTrace
|
||||||
|
# Write possible suggestions
|
||||||
|
Write-Host "`nIf you are using an antivirus, try configuring exclusions"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,221 +0,0 @@
|
|||||||
function Get-TabXaml {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
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
|
|
||||||
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
|
|
||||||
Note: the 'tabname' parameter must equal one of the json files found in $sync.configs variable
|
|
||||||
Otherwise, it'll throw an exception
|
|
||||||
|
|
||||||
.PARAMETER columncount
|
|
||||||
The number of columns to display the applications in, default is 0
|
|
||||||
|
|
||||||
.OUTPUTS
|
|
||||||
The XAML for the tab
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Get-TabXaml "applications" 3
|
|
||||||
#>
|
|
||||||
|
|
||||||
|
|
||||||
param(
|
|
||||||
[Parameter(Mandatory, position=0)]
|
|
||||||
[string]$tabname,
|
|
||||||
|
|
||||||
[Parameter(position=1)]
|
|
||||||
[ValidateRange(0,10)] # 10 panels as max number is more then enough
|
|
||||||
[int]$columncount = 0
|
|
||||||
)
|
|
||||||
|
|
||||||
# Validate tabname
|
|
||||||
if ($sync.configs.$tabname -eq $null) {
|
|
||||||
throw "Invalid parameter passed, can't find '$tabname' in '`$sync.configs' variable, please double check any calls to 'Get-TabXaml' function."
|
|
||||||
}
|
|
||||||
|
|
||||||
$organizedData = @{}
|
|
||||||
# Iterate through JSON data and organize by panel and category
|
|
||||||
foreach ($appName in $sync.configs.$tabname.PSObject.Properties.Name) {
|
|
||||||
$appInfo = $sync.configs.$tabname.$appName
|
|
||||||
|
|
||||||
# Create an object for the application
|
|
||||||
$appObject = [PSCustomObject]@{
|
|
||||||
Name = $appName
|
|
||||||
Category = $appInfo.Category
|
|
||||||
Content = $appInfo.Content
|
|
||||||
Choco = $appInfo.choco
|
|
||||||
Winget = $appInfo.winget
|
|
||||||
Panel = if ($columncount -gt 0 ) { "0" } else {$appInfo.panel}
|
|
||||||
Link = $appInfo.link
|
|
||||||
Description = $appInfo.description
|
|
||||||
# Type is (Checkbox,Toggle,Button,Combobox ) (Default is Checkbox)
|
|
||||||
Type = $appInfo.type
|
|
||||||
ComboItems = $appInfo.ComboItems
|
|
||||||
# Checked is the property to set startup checked status of checkbox (Default is false)
|
|
||||||
Checked = $appInfo.Checked
|
|
||||||
ButtonWidth = $appInfo.ButtonWidth
|
|
||||||
}
|
|
||||||
|
|
||||||
if (-not $organizedData.ContainsKey($appObject.panel)) {
|
|
||||||
$organizedData[$appObject.panel] = @{}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (-not $organizedData[$appObject.panel].ContainsKey($appObject.Category)) {
|
|
||||||
$organizedData[$appObject.panel][$appObject.Category] = @{}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Store application data in a sub-array under the category
|
|
||||||
# Add Order property to keep the original order of tweaks and features
|
|
||||||
$organizedData[$appObject.panel][$appInfo.Category]["$($appInfo.order)$appName"] = $appObject
|
|
||||||
}
|
|
||||||
|
|
||||||
# Same tab amount in last line of 'inputXML.xaml' file
|
|
||||||
# TODO: Get the base repeat (amount) of tabs from last line (or even lines)
|
|
||||||
# so it can dynamicly react to whatever is before this generated XML string.
|
|
||||||
# .. may be solve this even before calling this function, and pass the result as a parameter?
|
|
||||||
$tab_repeat = 7
|
|
||||||
$spaces_per_tab = 4 # The convenction used across the code base
|
|
||||||
$tab_as_spaces = $(" " * $spaces_per_tab)
|
|
||||||
$precal_indent = $($tab_as_spaces * $tab_repeat)
|
|
||||||
$precal_indent_p1 = $($tab_as_spaces * ($tab_repeat + 1))
|
|
||||||
$precal_indent_p2 = $($tab_as_spaces * ($tab_repeat + 2))
|
|
||||||
$precal_indent_m1 = $($tab_as_spaces * ($tab_repeat - 1))
|
|
||||||
$precal_indent_m2 = $($tab_as_spaces * ($tab_repeat - 2))
|
|
||||||
|
|
||||||
# Calculate the needed number of panels
|
|
||||||
$panelcount = 0
|
|
||||||
$paneltotal = $organizedData.Keys.Count
|
|
||||||
if ($columncount -gt 0) {
|
|
||||||
$appcount = $sync.configs.$tabname.PSObject.Properties.Name.count + $organizedData["0"].Keys.count
|
|
||||||
$maxcount = [Math]::Round( $appcount / $columncount + 0.5)
|
|
||||||
$paneltotal = $columncount
|
|
||||||
}
|
|
||||||
# add ColumnDefinitions to evenly draw colums
|
|
||||||
$blockXml = "<Grid.ColumnDefinitions>"
|
|
||||||
$blockXml += $("`r`n" + " " * ($spaces_per_tab * $tab_repeat) +
|
|
||||||
"<ColumnDefinition Width=""*""/>") * $paneltotal
|
|
||||||
$blockXml += $("`r`n" + " " * ($spaces_per_tab * ($tab_repeat - 1))) +
|
|
||||||
"</Grid.ColumnDefinitions>" + "`r`n"
|
|
||||||
|
|
||||||
# Iterate through 'organizedData' by panel, category, and application
|
|
||||||
$count = 0
|
|
||||||
foreach ($panel in ($organizedData.Keys | Sort-Object)) {
|
|
||||||
$blockXml += $precal_indent_m1 + "<Border Grid.Row=""1"" Grid.Column=""$panelcount"">" + "`r`n"
|
|
||||||
$blockXml += $precal_indent + "<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">" + "`r`n"
|
|
||||||
$panelcount++
|
|
||||||
foreach ($category in ($organizedData[$panel].Keys | Sort-Object)) {
|
|
||||||
$count++
|
|
||||||
if ($columncount -gt 0) {
|
|
||||||
$panelcount2 = [Int](($count)/$maxcount-0.5)
|
|
||||||
if ($panelcount -eq $panelcount2 ) {
|
|
||||||
$blockXml += $precal_indent_p2 + "</StackPanel>" + "`r`n"
|
|
||||||
$blockXml += $precal_indent_p1 + "</Border>" + "`r`n"
|
|
||||||
$blockXml += $precal_indent_p1 + "<Border Grid.Row=""1"" Grid.Column=""$panelcount"">" + "`r`n"
|
|
||||||
$blockXml += $precal_indent_p2 + "<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">" + "`r`n"
|
|
||||||
$panelcount++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Dot-source the Get-WPFObjectName function
|
|
||||||
. "$($sync.PSScriptRoot)\functions\private\Get-WPFObjectName.ps1"
|
|
||||||
|
|
||||||
$categorycontent = $($category -replace '^.__', '')
|
|
||||||
$categoryname = Get-WPFObjectName -type "Label" -name $categorycontent
|
|
||||||
$blockXml += $("`r`n" + " " * ($spaces_per_tab * $tab_repeat)) +
|
|
||||||
"<Label Name=""$categoryname"" Content=""$categorycontent""" + " " +
|
|
||||||
"FontSize=""{FontSizeHeading}"" FontFamily=""{HeaderFontFamily}""/>" + "`r`n" + "`r`n"
|
|
||||||
$sortedApps = $organizedData[$panel][$category].Keys | Sort-Object
|
|
||||||
foreach ($appName in $sortedApps) {
|
|
||||||
$count++
|
|
||||||
|
|
||||||
if ($columncount -gt 0) {
|
|
||||||
$panelcount2 = [Int](($count)/$maxcount-0.5)
|
|
||||||
# Verify the indentation actually works...
|
|
||||||
if ($panelcount -eq $panelcount2 ) {
|
|
||||||
$blockXml += $precal_indent_m1 +
|
|
||||||
"</StackPanel>" + "`r`n"
|
|
||||||
$blockXml += $precal_indent_m2 +
|
|
||||||
"</Border>" + "`r`n"
|
|
||||||
$blockXml += $precal_indent_m2 +
|
|
||||||
"<Border Grid.Row=""1"" Grid.Column=""$panelcount"">" + "`r`n"
|
|
||||||
$blockXml += $precal_indent_m1 +
|
|
||||||
"<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">" + "`r`n"
|
|
||||||
$panelcount++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$appInfo = $organizedData[$panel][$category][$appName]
|
|
||||||
switch ($appInfo.Type) {
|
|
||||||
"Toggle" {
|
|
||||||
$blockXml += $precal_indent_m1 +
|
|
||||||
"<DockPanel LastChildFill=""True"">" + "`r`n"
|
|
||||||
$blockXml += $precal_indent +
|
|
||||||
"<CheckBox Name=""$($appInfo.Name)"" Style=""{StaticResource ColorfulToggleSwitchStyle}"" Margin=""4,0""" + " " +
|
|
||||||
"HorizontalAlignment=""Right"" FontSize=""{FontSize}""/>" + "`r`n"
|
|
||||||
$blockXml += $precal_indent +
|
|
||||||
"<Label Content=""$($appInfo.Content)"" ToolTip=""$($appInfo.Description)""" + " " +
|
|
||||||
"HorizontalAlignment=""Left"" FontSize=""{FontSize}""/>" + "`r`n"
|
|
||||||
$blockXml += $precal_indent_m1 +
|
|
||||||
"</DockPanel>" + "`r`n"
|
|
||||||
}
|
|
||||||
|
|
||||||
"Combobox" {
|
|
||||||
$blockXml += $precal_indent_m1 +
|
|
||||||
"<StackPanel Orientation=""Horizontal"" Margin=""0,5,0,0"">" + "`r`n"
|
|
||||||
$blockXml += $precal_indent + "<Label Content=""$($appInfo.Content)"" HorizontalAlignment=""Left""" + " " +
|
|
||||||
"VerticalAlignment=""Center"" FontSize=""{FontSize}""/>" + "`r`n"
|
|
||||||
$blockXml += $precal_indent +
|
|
||||||
"<ComboBox Name=""$($appInfo.Name)"" Height=""32"" Width=""186"" HorizontalAlignment=""Left""" + " " +
|
|
||||||
"VerticalAlignment=""Center"" Margin=""5,5"" FontSize=""{FontSize}"">" + "`r`n"
|
|
||||||
|
|
||||||
$addfirst="IsSelected=""True"""
|
|
||||||
foreach ($comboitem in ($appInfo.ComboItems -split " ")) {
|
|
||||||
$blockXml += $precal_indent_p1 +
|
|
||||||
"<ComboBoxItem $addfirst Content=""$comboitem"" FontSize=""{FontSize}""/>" + "`r`n"
|
|
||||||
$addfirst=""
|
|
||||||
}
|
|
||||||
|
|
||||||
$blockXml += $precal_indent_p1 + "</ComboBox>" + "`r`n"
|
|
||||||
$blockXml += $precal_indent + "</StackPanel>" + "`r`n"
|
|
||||||
}
|
|
||||||
|
|
||||||
"Button" {
|
|
||||||
if ($appInfo.ButtonWidth -ne $null) {
|
|
||||||
$ButtonWidthStr = "Width=""$($appInfo.ButtonWidth)"""
|
|
||||||
}
|
|
||||||
$blockXml += $precal_indent +
|
|
||||||
"<Button Name=""$($appInfo.Name)"" Content=""$($appInfo.Content)""" + " " +
|
|
||||||
"HorizontalAlignment=""Left"" Margin=""5"" Padding=""20,5"" $($ButtonWidthStr)/>" + "`r`n"
|
|
||||||
}
|
|
||||||
|
|
||||||
# else it is a checkbox
|
|
||||||
default {
|
|
||||||
$checkedStatus = If ($appInfo.Checked -eq $null) {""} else {" IsChecked=""$($appInfo.Checked)"""}
|
|
||||||
if ($appInfo.Link -eq $null) {
|
|
||||||
$blockXml += $precal_indent +
|
|
||||||
"<CheckBox Name=""$($appInfo.Name)"" Content=""$($appInfo.Content)""$($checkedStatus) Margin=""5,0""" + " " +
|
|
||||||
"ToolTip=""$($appInfo.Description)""/>" + "`r`n"
|
|
||||||
} else {
|
|
||||||
$blockXml += $precal_indent +
|
|
||||||
"<StackPanel Orientation=""Horizontal"">" + "`r`n"
|
|
||||||
$blockXml += $precal_indent_p1 +
|
|
||||||
"<CheckBox Name=""$($appInfo.Name)"" Content=""$($appInfo.Content)""$($checkedStatus)" + " " +
|
|
||||||
"ToolTip=""$($appInfo.Description)"" Margin=""0,0,2,0""/>" + "`r`n"
|
|
||||||
$blockXml += $precal_indent_p1 +
|
|
||||||
"<TextBlock Name=""$($appInfo.Name)Link"" Style=""{StaticResource HoverTextBlockStyle}"" Text=""(?)""" + " " +
|
|
||||||
"ToolTip=""$($appInfo.Link)""/>" + "`r`n"
|
|
||||||
$blockXml += $precal_indent +
|
|
||||||
"</StackPanel>" + "`r`n"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$blockXml += $precal_indent_p1 + "</StackPanel>" + "`r`n"
|
|
||||||
$blockXml += $precal_indent + "</Border>" + "`r`n"
|
|
||||||
}
|
|
||||||
return ($blockXml)
|
|
||||||
}
|
|
@ -13,139 +13,48 @@ Function Get-WinUtilToggleStatus {
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
Param($ToggleSwitch)
|
Param($ToggleSwitch)
|
||||||
if($ToggleSwitch -eq "WPFToggleDarkMode") {
|
|
||||||
$app = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').AppsUseLightTheme
|
|
||||||
$system = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').SystemUsesLightTheme
|
|
||||||
if($app -eq 0 -and $system -eq 0) {
|
|
||||||
return $true
|
|
||||||
} else {
|
|
||||||
return $false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($ToggleSwitch -eq "WPFToggleBingSearch") {
|
|
||||||
$bingsearch = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Search').BingSearchEnabled
|
|
||||||
if($bingsearch -eq 0) {
|
|
||||||
return $false
|
|
||||||
} else {
|
|
||||||
return $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($ToggleSwitch -eq "WPFToggleNumLock") {
|
|
||||||
$numlockvalue = (Get-ItemProperty -path 'HKCU:\Control Panel\Keyboard').InitialKeyboardIndicators
|
|
||||||
if($numlockvalue -eq 2) {
|
|
||||||
return $true
|
|
||||||
} else {
|
|
||||||
return $false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($ToggleSwitch -eq "WPFToggleVerboseLogon") {
|
|
||||||
$VerboseStatusvalue = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System').VerboseStatus
|
|
||||||
if($VerboseStatusvalue -eq 1) {
|
|
||||||
return $true
|
|
||||||
} else {
|
|
||||||
return $false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($ToggleSwitch -eq "WPFToggleShowExt") {
|
|
||||||
$hideextvalue = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').HideFileExt
|
|
||||||
if($hideextvalue -eq 0) {
|
|
||||||
return $true
|
|
||||||
} else {
|
|
||||||
return $false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($ToggleSwitch -eq "WPFToggleSnapWindow") {
|
|
||||||
$hidesnap = (Get-ItemProperty -path 'HKCU:\Control Panel\Desktop').WindowArrangementActive
|
|
||||||
if($hidesnap -eq 0) {
|
|
||||||
return $false
|
|
||||||
} else {
|
|
||||||
return $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($ToggleSwitch -eq "WPFToggleSnapFlyout") {
|
|
||||||
$hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').EnableSnapAssistFlyout
|
|
||||||
if($hidesnap -eq 0) {
|
|
||||||
return $false
|
|
||||||
} else {
|
|
||||||
return $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($ToggleSwitch -eq "WPFToggleSnapSuggestion") {
|
|
||||||
$hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').SnapAssist
|
|
||||||
if($hidesnap -eq 0) {
|
|
||||||
return $false
|
|
||||||
} else {
|
|
||||||
return $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($ToggleSwitch -eq "WPFToggleMouseAcceleration") {
|
|
||||||
$MouseSpeed = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseSpeed
|
|
||||||
$MouseThreshold1 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold1
|
|
||||||
$MouseThreshold2 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold2
|
|
||||||
|
|
||||||
if($MouseSpeed -eq 1 -and $MouseThreshold1 -eq 6 -and $MouseThreshold2 -eq 10) {
|
$ToggleSwitchReg = $sync.configs.tweaks.$ToggleSwitch.registry
|
||||||
return $true
|
|
||||||
} else {
|
try {
|
||||||
return $false
|
if (($ToggleSwitchReg.path -imatch "hku") -and !(Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) {
|
||||||
}
|
$null = (New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS)
|
||||||
}
|
if (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue) {
|
||||||
if($ToggleSwitch -eq "WPFToggleTaskbarSearch") {
|
Write-Debug "HKU drive created successfully"
|
||||||
$SearchButton = (Get-ItemProperty -path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search").SearchboxTaskbarMode
|
} else {
|
||||||
if($SearchButton -eq 0) {
|
Write-Debug "Failed to create HKU drive"
|
||||||
return $false
|
}
|
||||||
} else {
|
|
||||||
return $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ToggleSwitch -eq "WPFToggleStickyKeys") {
|
|
||||||
$StickyKeys = (Get-ItemProperty -path 'HKCU:\Control Panel\Accessibility\StickyKeys').Flags
|
|
||||||
if($StickyKeys -eq 58) {
|
|
||||||
return $false
|
|
||||||
} else {
|
|
||||||
return $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ToggleSwitch -eq "WPFToggleTaskView") {
|
|
||||||
$TaskView = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').ShowTaskViewButton
|
|
||||||
if($TaskView -eq 0) {
|
|
||||||
return $false
|
|
||||||
} else {
|
|
||||||
return $true
|
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Error "An error occurred regarding the HKU Drive: $_"
|
||||||
|
return $false
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ToggleSwitch -eq "WPFToggleHiddenFiles") {
|
if ($ToggleSwitchReg) {
|
||||||
$HiddenFiles = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').Hidden
|
$count = 0
|
||||||
if($HiddenFiles -eq 0) {
|
|
||||||
return $false
|
|
||||||
} else {
|
|
||||||
return $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($ToggleSwitch -eq "WPFToggleTaskbarWidgets") {
|
foreach ($regentry in $ToggleSwitchReg) {
|
||||||
$TaskbarWidgets = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskBarDa
|
try {
|
||||||
if($TaskbarWidgets -eq 0) {
|
$regstate = (Get-ItemProperty -path $regentry.Path).$($regentry.Name)
|
||||||
return $false
|
if ($regstate -eq $regentry.Value) {
|
||||||
} else {
|
$count += 1
|
||||||
return $true
|
Write-Debug "$($regentry.Name) is true (state: $regstate, value: $($regentry.Value), original: $($regentry.OriginalValue))"
|
||||||
|
} else {
|
||||||
|
Write-Debug "$($regentry.Name) is false (state: $regstate, value: $($regentry.Value), original: $($regentry.OriginalValue))"
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Error "An error occurred while accessing registry entry $($regentry.Path): $_"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ($ToggleSwitch -eq "WPFToggleTaskbarAlignment") {
|
if ($count -eq $ToggleSwitchReg.Count) {
|
||||||
$TaskbarAlignment = (Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskbarAl
|
Write-Debug "$($ToggleSwitchReg.Name) is true (count: $count)"
|
||||||
if($TaskbarAlignment -eq 0) {
|
|
||||||
return $false
|
|
||||||
} else {
|
|
||||||
return $true
|
return $true
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ToggleSwitch -eq "WPFToggleDetailedBSoD") {
|
|
||||||
$DetailedBSoD1 = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisplayParameters
|
|
||||||
$DetailedBSoD2 = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisableEmoticon
|
|
||||||
if (($DetailedBSoD1 -eq 0) -or ($DetailedBSoD2 -eq 0) -or !$DetailedBSoD1 -or !$DetailedBSoD2) {
|
|
||||||
return $false
|
|
||||||
} else {
|
} else {
|
||||||
return $true
|
Write-Debug "$($ToggleSwitchReg.Name) is false (count: $count)"
|
||||||
|
return $false
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +1,104 @@
|
|||||||
function Get-WinUtilWingetLatest {
|
function Get-WinUtilWingetLatest {
|
||||||
|
[CmdletBinding()]
|
||||||
|
param()
|
||||||
|
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Uses GitHub API to check for the latest release of Winget.
|
Uses GitHub API to check for the latest release of Winget.
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This function grabs the latest version of Winget and returns the download path to Install-WinUtilWinget for installation.
|
This function first attempts to update WinGet using winget itself, then falls back to manual installation if needed.
|
||||||
#>
|
#>
|
||||||
# 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
|
$ProgressPreference = "SilentlyContinue"
|
||||||
$PreviousProgressPreference = $ProgressPreference
|
$InformationPreference = 'Continue'
|
||||||
$ProgressPreference = "silentlyContinue"
|
|
||||||
try {
|
try {
|
||||||
# Grabs the latest release of Winget from the Github API for the install process.
|
$wingetCmd = Get-Command winget -ErrorAction Stop
|
||||||
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/Winget-cli/releases/latest" -Method Get -ErrorAction Stop
|
Write-Information "Attempting to update WinGet using WinGet..."
|
||||||
$latestVersion = $response.tag_name #Stores version number of latest release.
|
$result = Start-Process -FilePath "`"$($wingetCmd.Source)`"" -ArgumentList "install -e --accept-source-agreements --accept-package-agreements Microsoft.AppInstaller" -Wait -NoNewWindow -PassThru
|
||||||
$licenseWingetUrl = $response.assets.browser_download_url | Where-Object {$_ -like "*License1.xml"} #Index value for License file.
|
if ($result.ExitCode -ne 0) {
|
||||||
Write-Host "Latest Version:`t$($latestVersion)`n"
|
throw "WinGet update failed with exit code: $($result.ExitCode)"
|
||||||
Write-Host "Downloading..."
|
}
|
||||||
$assetUrl = $response.assets.browser_download_url | Where-Object {$_ -like "*Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"}
|
return $true
|
||||||
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.
|
catch {
|
||||||
Invoke-WebRequest -Uri $assetUrl -OutFile $ENV:TEMP\Microsoft.DesktopAppInstaller.msixbundle
|
Write-Information "WinGet not found or update failed. Attempting to install from Microsoft Store..."
|
||||||
} catch {
|
try {
|
||||||
throw [WingetFailedInstall]::new('Failed to get latest Winget release and license')
|
# Try to close any running WinGet processes
|
||||||
|
Get-Process -Name "DesktopAppInstaller", "winget" -ErrorAction SilentlyContinue | ForEach-Object {
|
||||||
|
Write-Information "Stopping running WinGet process..."
|
||||||
|
$_.Kill()
|
||||||
|
Start-Sleep -Seconds 2
|
||||||
|
}
|
||||||
|
|
||||||
|
# Try to load Windows Runtime assemblies more reliably
|
||||||
|
$null = [System.Runtime.WindowsRuntime.WindowsRuntimeSystemExtensions]
|
||||||
|
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
||||||
|
|
||||||
|
# Load required assemblies from Windows SDK
|
||||||
|
$null = @(
|
||||||
|
[Windows.Management.Deployment.PackageManager, Windows.Management.Deployment, ContentType = WindowsRuntime]
|
||||||
|
[Windows.Foundation.Uri, Windows.Foundation, ContentType = WindowsRuntime]
|
||||||
|
[Windows.Management.Deployment.DeploymentOptions, Windows.Management.Deployment, ContentType = WindowsRuntime]
|
||||||
|
)
|
||||||
|
|
||||||
|
# Initialize PackageManager
|
||||||
|
$packageManager = New-Object Windows.Management.Deployment.PackageManager
|
||||||
|
|
||||||
|
# Rest of the Microsoft Store installation logic
|
||||||
|
$appxPackage = "https://aka.ms/getwinget"
|
||||||
|
$uri = New-Object Windows.Foundation.Uri($appxPackage)
|
||||||
|
$deploymentOperation = $packageManager.AddPackageAsync($uri, $null, "Add")
|
||||||
|
|
||||||
|
# Add timeout check for deployment operation
|
||||||
|
$timeout = 300
|
||||||
|
$timer = [System.Diagnostics.Stopwatch]::StartNew()
|
||||||
|
|
||||||
|
while ($deploymentOperation.Status -eq 0) {
|
||||||
|
if ($timer.Elapsed.TotalSeconds -gt $timeout) {
|
||||||
|
throw "Installation timed out after $timeout seconds"
|
||||||
|
}
|
||||||
|
Start-Sleep -Milliseconds 100
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($deploymentOperation.Status -eq 1) {
|
||||||
|
Write-Information "Successfully installed WinGet from Microsoft Store"
|
||||||
|
return $true
|
||||||
|
} else {
|
||||||
|
throw "Installation failed with status: $($deploymentOperation.Status)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch [System.Management.Automation.RuntimeException] {
|
||||||
|
Write-Information "Windows Runtime components not available. Attempting manual download..."
|
||||||
|
try {
|
||||||
|
# Try to close any running WinGet processes
|
||||||
|
Get-Process -Name "DesktopAppInstaller", "winget" -ErrorAction SilentlyContinue | ForEach-Object {
|
||||||
|
Write-Information "Stopping running WinGet process..."
|
||||||
|
$_.Kill()
|
||||||
|
Start-Sleep -Seconds 2
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fallback to direct download from GitHub
|
||||||
|
$apiUrl = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
|
||||||
|
$release = Invoke-RestMethod -Uri $apiUrl
|
||||||
|
$msixBundleUrl = ($release.assets | Where-Object { $_.name -like "*.msixbundle" }).browser_download_url
|
||||||
|
|
||||||
|
$tempFile = Join-Path $env:TEMP "Microsoft.DesktopAppInstaller.msixbundle"
|
||||||
|
Invoke-WebRequest -Uri $msixBundleUrl -OutFile $tempFile
|
||||||
|
|
||||||
|
Add-AppxPackage -Path $tempFile -ErrorAction Stop
|
||||||
|
Remove-Item $tempFile -Force
|
||||||
|
|
||||||
|
Write-Information "Successfully installed WinGet from GitHub release"
|
||||||
|
return $true
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
Write-Error "Failed to install WinGet: $_"
|
||||||
|
return $false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
Write-Error "Failed to install WinGet: $_"
|
||||||
|
return $false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$ProgressPreference = $PreviousProgressPreference
|
|
||||||
}
|
}
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
function Get-WinUtilWingetPrerequisites {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Downloads the Winget Prereqs.
|
|
||||||
.DESCRIPTION
|
|
||||||
Downloads Prereqs for Winget. Version numbers are coded as variables and can be updated as uncommonly as Microsoft updates the prereqs.
|
|
||||||
#>
|
|
||||||
|
|
||||||
# I don't know of a way to detect the prereqs automatically, so if someone has a better way of defining these, that would be great.
|
|
||||||
# Microsoft.VCLibs version rarely changes, but for future compatibility I made it a variable.
|
|
||||||
$versionVCLibs = "14.00"
|
|
||||||
$fileVCLibs = "https://aka.ms/Microsoft.VCLibs.x64.${versionVCLibs}.Desktop.appx"
|
|
||||||
# Write-Host "$fileVCLibs"
|
|
||||||
# Microsoft.UI.Xaml version changed recently, so I made the version numbers variables.
|
|
||||||
$versionUIXamlMinor = "2.8"
|
|
||||||
$versionUIXamlPatch = "2.8.6"
|
|
||||||
$fileUIXaml = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v${versionUIXamlPatch}/Microsoft.UI.Xaml.${versionUIXamlMinor}.x64.appx"
|
|
||||||
# Write-Host "$fileUIXaml"
|
|
||||||
|
|
||||||
try {
|
|
||||||
Write-Host "Downloading Microsoft.VCLibs Dependency..."
|
|
||||||
Invoke-WebRequest -Uri $fileVCLibs -OutFile $ENV:TEMP\Microsoft.VCLibs.x64.Desktop.appx
|
|
||||||
Write-Host "Downloading Microsoft.UI.Xaml Dependency...`n"
|
|
||||||
Invoke-WebRequest -Uri $fileUIXaml -OutFile $ENV:TEMP\Microsoft.UI.Xaml.x64.appx
|
|
||||||
} catch {
|
|
||||||
throw [WingetFailedInstall]::new('Failed to install prerequsites')
|
|
||||||
}
|
|
||||||
}
|
|
@ -13,10 +13,11 @@ function Install-WinUtilChoco {
|
|||||||
if((Test-WinUtilPackageManager -choco) -eq "installed") {
|
if((Test-WinUtilPackageManager -choco) -eq "installed") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
# Install logic taken from https://chocolatey.org/install#individual
|
||||||
Write-Host "Seems Chocolatey is not installed, installing now."
|
Write-Host "Seems Chocolatey is not installed, installing now."
|
||||||
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;
|
||||||
powershell choco feature enable -n allowGlobalConfirmation
|
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
|
||||||
|
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "===========================================" -Foregroundcolor Red
|
Write-Host "===========================================" -Foregroundcolor Red
|
||||||
|
@ -1,102 +1,258 @@
|
|||||||
function Install-WinUtilProgramChoco {
|
function Install-WinUtilProgramChoco {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Manages the provided programs using Chocolatey
|
Manages the installation or uninstallation of a list of Chocolatey packages.
|
||||||
|
|
||||||
.PARAMETER ProgramsToInstall
|
.PARAMETER Programs
|
||||||
A list of programs to manage
|
A string array containing the programs to be installed or uninstalled.
|
||||||
|
|
||||||
.PARAMETER manage
|
.PARAMETER Action
|
||||||
The action to perform on the programs, can be either 'Installing' or 'Uninstalling'
|
Specifies the action to perform: "Install" or "Uninstall". The default value is "Install".
|
||||||
|
|
||||||
.NOTES
|
.DESCRIPTION
|
||||||
The triple quotes are required any time you need a " in a normal script block.
|
This function processes a list of programs to be managed using Chocolatey. Depending on the specified action, it either installs or uninstalls each program in the list, updating the taskbar progress accordingly. After all operations are completed, temporary output files are cleaned up.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Install-WinUtilProgramChoco -Programs @("7zip","chrome") -Action "Uninstall"
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory, Position=0)]
|
[Parameter(Mandatory, Position = 0)]
|
||||||
[PsCustomObject]$ProgramsToInstall,
|
[string[]]$Programs,
|
||||||
|
|
||||||
[Parameter(Position=1)]
|
[Parameter(Position = 1)]
|
||||||
[String]$manage = "Installing"
|
[String]$Action = "Install"
|
||||||
)
|
)
|
||||||
|
|
||||||
$x = 0
|
function Initialize-OutputFile {
|
||||||
$count = $ProgramsToInstall.Count
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Initializes an output file by removing any existing file and creating a new, empty file at the specified path.
|
||||||
|
|
||||||
# This check isn't really necessary, as there's a couple of checks before this Private Function gets called, but just to make sure ;)
|
.PARAMETER filePath
|
||||||
if($count -le 0) {
|
The full path to the file to be initialized.
|
||||||
throw "Private Function 'Install-WinUtilProgramChoco' expected Parameter 'ProgramsToInstall' to be of size 1 or greater, instead got $count,`nPlease double check your code and re-compile WinUtil."
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This function ensures that the specified file is reset by removing any existing file at the provided path and then creating a new, empty file. It is useful when preparing a log or output file for subsequent operations.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Initialize-OutputFile -filePath "C:\temp\output.txt"
|
||||||
|
#>
|
||||||
|
|
||||||
|
param ($filePath)
|
||||||
|
Remove-Item -Path $filePath -Force -ErrorAction SilentlyContinue
|
||||||
|
New-Item -ItemType File -Path $filePath | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Progress -Activity "$manage Applications" -Status "Starting" -PercentComplete 0
|
function Invoke-ChocoCommand {
|
||||||
Write-Host "==========================================="
|
<#
|
||||||
Write-Host "-- Configuring Chocolatey pacakages ---"
|
.SYNOPSIS
|
||||||
Write-Host "==========================================="
|
Executes a Chocolatey command with the specified arguments and returns the exit code.
|
||||||
Foreach ($Program in $ProgramsToInstall) {
|
|
||||||
Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.choco) $($x + 1) of $count" -PercentComplete $($x/$count*100)
|
.PARAMETER arguments
|
||||||
if($manage -eq "Installing") {
|
The arguments to be passed to the Chocolatey command.
|
||||||
write-host "Starting install of $($Program.choco) with Chocolatey."
|
|
||||||
try {
|
.DESCRIPTION
|
||||||
$tryUpgrade = $false
|
This function runs a specified Chocolatey command by passing the provided arguments to the `choco` executable. It waits for the process to complete and then returns the exit code, allowing the caller to determine success or failure based on the exit code.
|
||||||
$installOutputFilePath = "$env:TEMP\Install-WinUtilProgramChoco.install-command.output.txt"
|
|
||||||
New-Item -ItemType File -Path $installOutputFilePath
|
.RETURNS
|
||||||
$chocoInstallStatus = $(Start-Process -FilePath "choco" -ArgumentList "install $($Program.choco) -y" -Wait -PassThru -RedirectStandardOutput $installOutputFilePath).ExitCode
|
[int]
|
||||||
if(($chocoInstallStatus -eq 0) -AND (Test-Path -Path $installOutputFilePath)) {
|
The exit code of the Chocolatey command.
|
||||||
$keywordsFound = Get-Content -Path $installOutputFilePath | Where-Object {$_ -match "reinstall" -OR $_ -match "already installed"}
|
|
||||||
if ($keywordsFound) {
|
.EXAMPLE
|
||||||
$tryUpgrade = $true
|
$exitCode = Invoke-ChocoCommand -arguments "install 7zip -y"
|
||||||
|
#>
|
||||||
|
|
||||||
|
param ($arguments)
|
||||||
|
return (Start-Process -FilePath "choco" -ArgumentList $arguments -Wait -PassThru).ExitCode
|
||||||
|
}
|
||||||
|
|
||||||
|
function Test-UpgradeNeeded {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks if an upgrade is needed for a Chocolatey package based on the content of a log file.
|
||||||
|
|
||||||
|
.PARAMETER filePath
|
||||||
|
The path to the log file that contains the output of a Chocolatey install command.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This function reads the specified log file and checks for keywords that indicate whether an upgrade is needed. It returns a boolean value indicating whether the terms "reinstall" or "already installed" are present, which suggests that the package might need an upgrade.
|
||||||
|
|
||||||
|
.RETURNS
|
||||||
|
[bool]
|
||||||
|
True if the log file indicates that an upgrade is needed; otherwise, false.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
$isUpgradeNeeded = Test-UpgradeNeeded -filePath "C:\temp\install-output.txt"
|
||||||
|
#>
|
||||||
|
|
||||||
|
param ($filePath)
|
||||||
|
return Get-Content -Path $filePath | Select-String -Pattern "reinstall|already installed" -Quiet
|
||||||
|
}
|
||||||
|
|
||||||
|
function Update-TaskbarProgress {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Updates the taskbar progress based on the current installation progress.
|
||||||
|
|
||||||
|
.PARAMETER currentIndex
|
||||||
|
The current index of the program being installed or uninstalled.
|
||||||
|
|
||||||
|
.PARAMETER totalPrograms
|
||||||
|
The total number of programs to be installed or uninstalled.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This function calculates the progress of the installation or uninstallation process and updates the taskbar accordingly. The taskbar is set to "Normal" if all programs have been processed, otherwise, it is set to "Error" as a placeholder.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Update-TaskbarProgress -currentIndex 3 -totalPrograms 10
|
||||||
|
#>
|
||||||
|
|
||||||
|
param (
|
||||||
|
[int]$currentIndex,
|
||||||
|
[int]$totalPrograms
|
||||||
|
)
|
||||||
|
$progressState = if ($currentIndex -eq $totalPrograms) { "Normal" } else { "Error" }
|
||||||
|
$sync.form.Dispatcher.Invoke([action] { Set-WinUtilTaskbaritem -state $progressState -value ($currentIndex / $totalPrograms) })
|
||||||
|
}
|
||||||
|
|
||||||
|
function Install-ChocoPackage {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Installs a Chocolatey package and optionally upgrades it if needed.
|
||||||
|
|
||||||
|
.PARAMETER Program
|
||||||
|
A string containing the name of the Chocolatey package to be installed.
|
||||||
|
|
||||||
|
.PARAMETER currentIndex
|
||||||
|
The current index of the program in the list of programs to be managed.
|
||||||
|
|
||||||
|
.PARAMETER totalPrograms
|
||||||
|
The total number of programs to be installed.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This function installs a Chocolatey package by running the `choco install` command. If the installation output indicates that an upgrade might be needed, the function will attempt to upgrade the package. The taskbar progress is updated after each package is processed.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Install-ChocoPackage -Program $Program -currentIndex 0 -totalPrograms 5
|
||||||
|
#>
|
||||||
|
|
||||||
|
param (
|
||||||
|
[string]$Program,
|
||||||
|
[int]$currentIndex,
|
||||||
|
[int]$totalPrograms
|
||||||
|
)
|
||||||
|
|
||||||
|
$installOutputFile = "$env:TEMP\Install-WinUtilProgramChoco.install-command.output.txt"
|
||||||
|
Initialize-OutputFile $installOutputFile
|
||||||
|
|
||||||
|
Write-Host "Starting installation of $Program with Chocolatey."
|
||||||
|
|
||||||
|
try {
|
||||||
|
$installStatusCode = Invoke-ChocoCommand "install $Program -y --log-file $installOutputFile"
|
||||||
|
if ($installStatusCode -eq 0) {
|
||||||
|
|
||||||
|
if (Test-UpgradeNeeded $installOutputFile) {
|
||||||
|
$upgradeStatusCode = Invoke-ChocoCommand "upgrade $Program -y"
|
||||||
|
Write-Host "$Program was" $(if ($upgradeStatusCode -eq 0) { "upgraded successfully." } else { "not upgraded." })
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Host "$Program installed successfully."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# 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.
|
else {
|
||||||
if ($tryUpgrade) {
|
Write-Host "Failed to install $Program."
|
||||||
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)) {
|
|
||||||
Write-Host "$($Program.choco) installed successfully using Chocolatey."
|
|
||||||
$X++
|
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value ($x/$count) })
|
|
||||||
continue
|
|
||||||
} else {
|
|
||||||
Write-Host "Failed to install $($Program.choco) using Chocolatey, Chocolatey output:`n`n$(Get-Content -Path $installOutputFilePath)."
|
|
||||||
$X++
|
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) })
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
Write-Host "Failed to install $($Program.choco) due to an error: $_"
|
|
||||||
$X++
|
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch {
|
||||||
|
Write-Host "Failed to install $Program due to an error: $_"
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
Update-TaskbarProgress $currentIndex $totalPrograms
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($manage -eq "Uninstalling") {
|
function Uninstall-ChocoPackage {
|
||||||
write-host "Starting uninstall of $($Program.choco) with Chocolatey."
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Uninstalls a Chocolatey package and any related metapackages.
|
||||||
|
|
||||||
|
.PARAMETER Program
|
||||||
|
A string containing the name of the Chocolatey package to be uninstalled.
|
||||||
|
|
||||||
|
.PARAMETER currentIndex
|
||||||
|
The current index of the program in the list of programs to be managed.
|
||||||
|
|
||||||
|
.PARAMETER totalPrograms
|
||||||
|
The total number of programs to be uninstalled.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This function uninstalls a Chocolatey package and any related metapackages (e.g., .install or .portable variants). It updates the taskbar progress after processing each package.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Uninstall-ChocoPackage -Program $Program -currentIndex 0 -totalPrograms 5
|
||||||
|
#>
|
||||||
|
|
||||||
|
param (
|
||||||
|
[string]$Program,
|
||||||
|
[int]$currentIndex,
|
||||||
|
[int]$totalPrograms
|
||||||
|
)
|
||||||
|
|
||||||
|
$uninstallOutputFile = "$env:TEMP\Install-WinUtilProgramChoco.uninstall-command.output.txt"
|
||||||
|
Initialize-OutputFile $uninstallOutputFile
|
||||||
|
|
||||||
|
Write-Host "Searching for metapackages of $Program (.install or .portable)"
|
||||||
|
$chocoPackages = ((choco list | Select-String -Pattern "$Program(\.install|\.portable)?").Matches.Value) -join " "
|
||||||
|
if ($chocoPackages) {
|
||||||
|
Write-Host "Starting uninstallation of $chocoPackages with Chocolatey."
|
||||||
try {
|
try {
|
||||||
$uninstallOutputFilePath = "$env:TEMP\Install-WinUtilProgramChoco.uninstall-command.output.txt"
|
$uninstallStatusCode = Invoke-ChocoCommand "uninstall $chocoPackages -y"
|
||||||
New-Item -ItemType File -Path $uninstallOutputFilePath
|
Write-Host "$Program" $(if ($uninstallStatusCode -eq 0) { "uninstalled successfully." } else { "failed to uninstall." })
|
||||||
$chocoUninstallStatus = $(Start-Process -FilePath "choco" -ArgumentList "uninstall $($Program.choco) -y" -Wait -PassThru).ExitCode
|
|
||||||
if($chocoUninstallStatus -eq 0) {
|
|
||||||
Write-Host "$($Program.choco) uninstalled successfully using Chocolatey."
|
|
||||||
$x++
|
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value ($x/$count) })
|
|
||||||
continue
|
|
||||||
} else {
|
|
||||||
Write-Host "Failed to uninstall $($Program.choco) using Chocolatey, Chocolatey output:`n`n$(Get-Content -Path $uninstallOutputFilePath)."
|
|
||||||
$x++
|
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) })
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
Write-Host "Failed to uninstall $($Program.choco) due to an error: $_"
|
|
||||||
$x++
|
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) })
|
|
||||||
}
|
}
|
||||||
|
catch {
|
||||||
|
Write-Host "Failed to uninstall $Program due to an error: $_"
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
Update-TaskbarProgress $currentIndex $totalPrograms
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Host "$Program is not installed."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$totalPrograms = $Programs.Count
|
||||||
|
if ($totalPrograms -le 0) {
|
||||||
|
throw "Parameter 'Programs' must have at least one item."
|
||||||
}
|
}
|
||||||
Write-Progress -Activity "$manage Applications" -Status "Finished" -Completed
|
|
||||||
|
|
||||||
# Cleanup leftovers files
|
Write-Host "==========================================="
|
||||||
if(Test-Path -Path $installOutputFilePath) { Remove-Item -Path $installOutputFilePath }
|
Write-Host "-- Configuring Chocolatey packages ---"
|
||||||
if(Test-Path -Path $uninstallOutputFilePath) { Remove-Item -Path $uninstallOutputFilePath }
|
Write-Host "==========================================="
|
||||||
|
|
||||||
return;
|
for ($currentIndex = 0; $currentIndex -lt $totalPrograms; $currentIndex++) {
|
||||||
|
$Program = $Programs[$currentIndex]
|
||||||
|
Set-WinUtilProgressBar -label "$Action $($Program)" -percent ($currentIndex / $totalPrograms * 100)
|
||||||
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($currentIndex / $totalPrograms)})
|
||||||
|
|
||||||
|
switch ($Action) {
|
||||||
|
"Install" {
|
||||||
|
Install-ChocoPackage -Program $Program -currentIndex $currentIndex -totalPrograms $totalPrograms
|
||||||
|
}
|
||||||
|
"Uninstall" {
|
||||||
|
Uninstall-ChocoPackage -Program $Program -currentIndex $currentIndex -totalPrograms $totalPrograms
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
throw "Invalid action parameter value: '$Action'."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Set-WinUtilProgressBar -label "$($Action)ation done" -percent 100
|
||||||
|
# Cleanup Output Files
|
||||||
|
$outputFiles = @("$env:TEMP\Install-WinUtilProgramChoco.install-command.output.txt", "$env:TEMP\Install-WinUtilProgramChoco.uninstall-command.output.txt")
|
||||||
|
foreach ($filePath in $outputFiles) {
|
||||||
|
Remove-Item -Path $filePath -Force -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Function Invoke-WinUtilWingetProgram {
|
Function Install-WinUtilProgramWinget {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Runs the designated action on the provided programs using Winget
|
Runs the designated action on the provided programs using Winget
|
@ -35,15 +35,8 @@ function Install-WinUtilWinget {
|
|||||||
|
|
||||||
# Install Winget via GitHub method.
|
# Install Winget via GitHub method.
|
||||||
# Used part of my own script with some modification: ruxunderscore/windows-initialization
|
# Used part of my own script with some modification: ruxunderscore/windows-initialization
|
||||||
Write-Host "Downloading Winget Prerequsites`n"
|
|
||||||
Get-WinUtilWingetPrerequisites
|
|
||||||
Write-Host "Downloading Winget and License File`r"
|
Write-Host "Downloading Winget and License File`r"
|
||||||
Get-WinUtilWingetLatest
|
Get-WinUtilWingetLatest
|
||||||
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
|
|
||||||
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.
|
|
||||||
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
|
||||||
Install-Module -Name Microsoft.WinGet.Client -Force
|
Install-Module -Name Microsoft.WinGet.Client -Force
|
||||||
@ -51,18 +44,7 @@ function Install-WinUtilWinget {
|
|||||||
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-Error "Failed to install Winget: $($_.Exception.Message)"
|
||||||
# In case install fails via GitHub method.
|
|
||||||
try {
|
|
||||||
# Install Choco if not already present
|
|
||||||
Install-WinUtilChoco
|
|
||||||
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget-cli"
|
|
||||||
Write-Host "Winget Installed" -ForegroundColor Green
|
|
||||||
Write-Output "Refreshing Environment Variables...`n"
|
|
||||||
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
|
||||||
} catch {
|
|
||||||
throw [WingetFailedInstall]::new('Failed to install!')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
199
functions/private/Invoke-WinUtilAssets.ps1
Normal file
199
functions/private/Invoke-WinUtilAssets.ps1
Normal file
@ -0,0 +1,199 @@
|
|||||||
|
function Invoke-WinUtilAssets {
|
||||||
|
param (
|
||||||
|
$type,
|
||||||
|
$Size,
|
||||||
|
[switch]$render
|
||||||
|
)
|
||||||
|
|
||||||
|
# Create the Viewbox and set its size
|
||||||
|
$LogoViewbox = New-Object Windows.Controls.Viewbox
|
||||||
|
$LogoViewbox.Width = $Size
|
||||||
|
$LogoViewbox.Height = $Size
|
||||||
|
|
||||||
|
# Create a Canvas to hold the paths
|
||||||
|
$canvas = New-Object Windows.Controls.Canvas
|
||||||
|
$canvas.Width = 100
|
||||||
|
$canvas.Height = 100
|
||||||
|
|
||||||
|
# Define a scale factor for the content inside the Canvas
|
||||||
|
$scaleFactor = $Size / 100
|
||||||
|
|
||||||
|
# Apply a scale transform to the Canvas content
|
||||||
|
$scaleTransform = New-Object Windows.Media.ScaleTransform($scaleFactor, $scaleFactor)
|
||||||
|
$canvas.LayoutTransform = $scaleTransform
|
||||||
|
|
||||||
|
switch ($type) {
|
||||||
|
'logo' {
|
||||||
|
$LogoPathData1 = @"
|
||||||
|
M 18.00,14.00
|
||||||
|
C 18.00,14.00 45.00,27.74 45.00,27.74
|
||||||
|
45.00,27.74 57.40,34.63 57.40,34.63
|
||||||
|
57.40,34.63 59.00,43.00 59.00,43.00
|
||||||
|
59.00,43.00 59.00,83.00 59.00,83.00
|
||||||
|
55.35,81.66 46.99,77.79 44.72,74.79
|
||||||
|
41.17,70.10 42.01,59.80 42.00,54.00
|
||||||
|
42.00,51.62 42.20,48.29 40.98,46.21
|
||||||
|
38.34,41.74 25.78,38.60 21.28,33.79
|
||||||
|
16.81,29.02 18.00,20.20 18.00,14.00 Z
|
||||||
|
"@
|
||||||
|
$LogoPath1 = New-Object Windows.Shapes.Path
|
||||||
|
$LogoPath1.Data = [Windows.Media.Geometry]::Parse($LogoPathData1)
|
||||||
|
$LogoPath1.Fill = [System.Windows.Media.BrushConverter]::new().ConvertFromString("#0567ff")
|
||||||
|
|
||||||
|
$LogoPathData2 = @"
|
||||||
|
M 107.00,14.00
|
||||||
|
C 109.01,19.06 108.93,30.37 104.66,34.21
|
||||||
|
100.47,37.98 86.38,43.10 84.60,47.21
|
||||||
|
83.94,48.74 84.01,51.32 84.00,53.00
|
||||||
|
83.97,57.04 84.46,68.90 83.26,72.00
|
||||||
|
81.06,77.70 72.54,81.42 67.00,83.00
|
||||||
|
67.00,83.00 67.00,43.00 67.00,43.00
|
||||||
|
67.00,43.00 67.99,35.63 67.99,35.63
|
||||||
|
67.99,35.63 80.00,28.26 80.00,28.26
|
||||||
|
80.00,28.26 107.00,14.00 107.00,14.00 Z
|
||||||
|
"@
|
||||||
|
$LogoPath2 = New-Object Windows.Shapes.Path
|
||||||
|
$LogoPath2.Data = [Windows.Media.Geometry]::Parse($LogoPathData2)
|
||||||
|
$LogoPath2.Fill = [System.Windows.Media.BrushConverter]::new().ConvertFromString("#0567ff")
|
||||||
|
|
||||||
|
$LogoPathData3 = @"
|
||||||
|
M 19.00,46.00
|
||||||
|
C 21.36,47.14 28.67,50.71 30.01,52.63
|
||||||
|
31.17,54.30 30.99,57.04 31.00,59.00
|
||||||
|
31.04,65.41 30.35,72.16 33.56,78.00
|
||||||
|
38.19,86.45 46.10,89.04 54.00,93.31
|
||||||
|
56.55,94.69 60.10,97.20 63.00,97.22
|
||||||
|
65.50,97.24 68.77,95.36 71.00,94.25
|
||||||
|
76.42,91.55 84.51,87.78 88.82,83.68
|
||||||
|
94.56,78.20 95.96,70.59 96.00,63.00
|
||||||
|
96.01,60.24 95.59,54.63 97.02,52.39
|
||||||
|
98.80,49.60 103.95,47.87 107.00,47.00
|
||||||
|
107.00,47.00 107.00,67.00 107.00,67.00
|
||||||
|
106.90,87.69 96.10,93.85 80.00,103.00
|
||||||
|
76.51,104.98 66.66,110.67 63.00,110.52
|
||||||
|
60.33,110.41 55.55,107.53 53.00,106.25
|
||||||
|
46.21,102.83 36.63,98.57 31.04,93.68
|
||||||
|
16.88,81.28 19.00,62.88 19.00,46.00 Z
|
||||||
|
"@
|
||||||
|
$LogoPath3 = New-Object Windows.Shapes.Path
|
||||||
|
$LogoPath3.Data = [Windows.Media.Geometry]::Parse($LogoPathData3)
|
||||||
|
$LogoPath3.Fill = [System.Windows.Media.BrushConverter]::new().ConvertFromString("#a3a4a6")
|
||||||
|
|
||||||
|
$canvas.Children.Add($LogoPath1) | Out-Null
|
||||||
|
$canvas.Children.Add($LogoPath2) | Out-Null
|
||||||
|
$canvas.Children.Add($LogoPath3) | Out-Null
|
||||||
|
}
|
||||||
|
'checkmark' {
|
||||||
|
$canvas.Width = 512
|
||||||
|
$canvas.Height = 512
|
||||||
|
|
||||||
|
$scaleFactor = $Size / 2.54
|
||||||
|
$scaleTransform = New-Object Windows.Media.ScaleTransform($scaleFactor, $scaleFactor)
|
||||||
|
$canvas.LayoutTransform = $scaleTransform
|
||||||
|
|
||||||
|
# Define the circle path
|
||||||
|
$circlePathData = "M 1.27,0 A 1.27,1.27 0 1,0 1.27,2.54 A 1.27,1.27 0 1,0 1.27,0"
|
||||||
|
$circlePath = New-Object Windows.Shapes.Path
|
||||||
|
$circlePath.Data = [Windows.Media.Geometry]::Parse($circlePathData)
|
||||||
|
$circlePath.Fill = [System.Windows.Media.BrushConverter]::new().ConvertFromString("#39ba00")
|
||||||
|
|
||||||
|
# Define the checkmark path
|
||||||
|
$checkmarkPathData = "M 0.873 1.89 L 0.41 1.391 A 0.17 0.17 0 0 1 0.418 1.151 A 0.17 0.17 0 0 1 0.658 1.16 L 1.016 1.543 L 1.583 1.013 A 0.17 0.17 0 0 1 1.599 1 L 1.865 0.751 A 0.17 0.17 0 0 1 2.105 0.759 A 0.17 0.17 0 0 1 2.097 0.999 L 1.282 1.759 L 0.999 2.022 L 0.874 1.888 Z"
|
||||||
|
$checkmarkPath = New-Object Windows.Shapes.Path
|
||||||
|
$checkmarkPath.Data = [Windows.Media.Geometry]::Parse($checkmarkPathData)
|
||||||
|
$checkmarkPath.Fill = [Windows.Media.Brushes]::White
|
||||||
|
|
||||||
|
# Add the paths to the Canvas
|
||||||
|
$canvas.Children.Add($circlePath) | Out-Null
|
||||||
|
$canvas.Children.Add($checkmarkPath) | Out-Null
|
||||||
|
}
|
||||||
|
'warning' {
|
||||||
|
$canvas.Width = 512
|
||||||
|
$canvas.Height = 512
|
||||||
|
|
||||||
|
# Define a scale factor for the content inside the Canvas
|
||||||
|
$scaleFactor = $Size / 512 # Adjust scaling based on the canvas size
|
||||||
|
$scaleTransform = New-Object Windows.Media.ScaleTransform($scaleFactor, $scaleFactor)
|
||||||
|
$canvas.LayoutTransform = $scaleTransform
|
||||||
|
|
||||||
|
# Define the circle path
|
||||||
|
$circlePathData = "M 256,0 A 256,256 0 1,0 256,512 A 256,256 0 1,0 256,0"
|
||||||
|
$circlePath = New-Object Windows.Shapes.Path
|
||||||
|
$circlePath.Data = [Windows.Media.Geometry]::Parse($circlePathData)
|
||||||
|
$circlePath.Fill = [System.Windows.Media.BrushConverter]::new().ConvertFromString("#f41b43")
|
||||||
|
|
||||||
|
# Define the exclamation mark path
|
||||||
|
$exclamationPathData = "M 256 307.2 A 35.89 35.89 0 0 1 220.14 272.74 L 215.41 153.3 A 35.89 35.89 0 0 1 251.27 116 H 260.73 A 35.89 35.89 0 0 1 296.59 153.3 L 291.86 272.74 A 35.89 35.89 0 0 1 256 307.2 Z"
|
||||||
|
$exclamationPath = New-Object Windows.Shapes.Path
|
||||||
|
$exclamationPath.Data = [Windows.Media.Geometry]::Parse($exclamationPathData)
|
||||||
|
$exclamationPath.Fill = [Windows.Media.Brushes]::White
|
||||||
|
|
||||||
|
# Get the bounds of the exclamation mark path
|
||||||
|
$exclamationBounds = $exclamationPath.Data.Bounds
|
||||||
|
|
||||||
|
# Calculate the center position for the exclamation mark path
|
||||||
|
$exclamationCenterX = ($canvas.Width - $exclamationBounds.Width) / 2 - $exclamationBounds.X
|
||||||
|
$exclamationPath.SetValue([Windows.Controls.Canvas]::LeftProperty, $exclamationCenterX)
|
||||||
|
|
||||||
|
# Define the rounded rectangle at the bottom (dot of exclamation mark)
|
||||||
|
$roundedRectangle = New-Object Windows.Shapes.Rectangle
|
||||||
|
$roundedRectangle.Width = 80
|
||||||
|
$roundedRectangle.Height = 80
|
||||||
|
$roundedRectangle.RadiusX = 30
|
||||||
|
$roundedRectangle.RadiusY = 30
|
||||||
|
$roundedRectangle.Fill = [Windows.Media.Brushes]::White
|
||||||
|
|
||||||
|
# Calculate the center position for the rounded rectangle
|
||||||
|
$centerX = ($canvas.Width - $roundedRectangle.Width) / 2
|
||||||
|
$roundedRectangle.SetValue([Windows.Controls.Canvas]::LeftProperty, $centerX)
|
||||||
|
$roundedRectangle.SetValue([Windows.Controls.Canvas]::TopProperty, 324.34)
|
||||||
|
|
||||||
|
# Add the paths to the Canvas
|
||||||
|
$canvas.Children.Add($circlePath) | Out-Null
|
||||||
|
$canvas.Children.Add($exclamationPath) | Out-Null
|
||||||
|
$canvas.Children.Add($roundedRectangle) | Out-Null
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
Write-Host "Invalid type: $type"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add the Canvas to the Viewbox
|
||||||
|
$LogoViewbox.Child = $canvas
|
||||||
|
|
||||||
|
if ($render) {
|
||||||
|
# Measure and arrange the canvas to ensure proper rendering
|
||||||
|
$canvas.Measure([Windows.Size]::new($canvas.Width, $canvas.Height))
|
||||||
|
$canvas.Arrange([Windows.Rect]::new(0, 0, $canvas.Width, $canvas.Height))
|
||||||
|
$canvas.UpdateLayout()
|
||||||
|
|
||||||
|
# Initialize RenderTargetBitmap correctly with dimensions
|
||||||
|
$renderTargetBitmap = New-Object Windows.Media.Imaging.RenderTargetBitmap($canvas.Width, $canvas.Height, 96, 96, [Windows.Media.PixelFormats]::Pbgra32)
|
||||||
|
|
||||||
|
# Render the canvas to the bitmap
|
||||||
|
$renderTargetBitmap.Render($canvas)
|
||||||
|
|
||||||
|
# Create a BitmapFrame from the RenderTargetBitmap
|
||||||
|
$bitmapFrame = [Windows.Media.Imaging.BitmapFrame]::Create($renderTargetBitmap)
|
||||||
|
|
||||||
|
# Create a PngBitmapEncoder and add the frame
|
||||||
|
$bitmapEncoder = [Windows.Media.Imaging.PngBitmapEncoder]::new()
|
||||||
|
$bitmapEncoder.Frames.Add($bitmapFrame)
|
||||||
|
|
||||||
|
# Save to a memory stream
|
||||||
|
$imageStream = New-Object System.IO.MemoryStream
|
||||||
|
$bitmapEncoder.Save($imageStream)
|
||||||
|
$imageStream.Position = 0
|
||||||
|
|
||||||
|
# Load the stream into a BitmapImage
|
||||||
|
$bitmapImage = [Windows.Media.Imaging.BitmapImage]::new()
|
||||||
|
$bitmapImage.BeginInit()
|
||||||
|
$bitmapImage.StreamSource = $imageStream
|
||||||
|
$bitmapImage.CacheOption = [Windows.Media.Imaging.BitmapCacheOption]::OnLoad
|
||||||
|
$bitmapImage.EndInit()
|
||||||
|
|
||||||
|
return $bitmapImage
|
||||||
|
} else {
|
||||||
|
return $LogoViewbox
|
||||||
|
}
|
||||||
|
}
|
@ -1,30 +0,0 @@
|
|||||||
function Invoke-WinUtilBingSearch {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Disables/Enables Bing Search
|
|
||||||
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable Bing Search
|
|
||||||
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Bing Search"
|
|
||||||
$value = 1
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Bing Search"
|
|
||||||
$value = 0
|
|
||||||
}
|
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search"
|
|
||||||
Set-ItemProperty -Path $Path -Name BingSearchEnabled -Value $value
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -13,6 +13,16 @@ Function Invoke-WinUtilCurrentSystem {
|
|||||||
param(
|
param(
|
||||||
$CheckBox
|
$CheckBox
|
||||||
)
|
)
|
||||||
|
if ($CheckBox -eq "choco") {
|
||||||
|
$apps = (choco list | Select-String -Pattern "^\S+").Matches.Value
|
||||||
|
$filter = Get-WinUtilVariables -Type Checkbox | Where-Object {$psitem -like "WPFInstall*"}
|
||||||
|
$sync.GetEnumerator() | Where-Object {$psitem.Key -in $filter} | ForEach-Object {
|
||||||
|
$dependencies = @($sync.configs.applications.$($psitem.Key).choco -split ";")
|
||||||
|
if ($dependencies -in $apps) {
|
||||||
|
Write-Output $psitem.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($checkbox -eq "winget") {
|
if ($checkbox -eq "winget") {
|
||||||
|
|
||||||
@ -33,7 +43,7 @@ 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:\')) {$null = (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 {
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
Function Invoke-WinUtilDarkMode {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Enables/Disables Dark Mode
|
|
||||||
|
|
||||||
.PARAMETER DarkMoveEnabled
|
|
||||||
Indicates the current dark mode state
|
|
||||||
|
|
||||||
#>
|
|
||||||
Param($DarkMoveEnabled)
|
|
||||||
try {
|
|
||||||
if ($DarkMoveEnabled -eq $false) {
|
|
||||||
Write-Host "Enabling Dark Mode"
|
|
||||||
$DarkMoveValue = 0
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Dark Mode"
|
|
||||||
$DarkMoveValue = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
$Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
|
|
||||||
Set-ItemProperty -Path $Path -Name AppsUseLightTheme -Value $DarkMoveValue
|
|
||||||
Set-ItemProperty -Path $Path -Name SystemUsesLightTheme -Value $DarkMoveValue
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
Function Invoke-WinUtilDetailedBSoD {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Enables/Disables Detailed BSoD
|
|
||||||
(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'DisplayParameters').DisplayParameters
|
|
||||||
|
|
||||||
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Detailed BSoD"
|
|
||||||
$value = 1
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Detailed BSoD"
|
|
||||||
$value =0
|
|
||||||
}
|
|
||||||
|
|
||||||
$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl"
|
|
||||||
$dwords = ("DisplayParameters", "DisableEmoticon")
|
|
||||||
foreach ($name in $dwords) {
|
|
||||||
Set-ItemProperty -Path $Path -Name $name -Value $value
|
|
||||||
}
|
|
||||||
Set-ItemProperty -Path $Path -Name DisplayParameters -Value $value
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
43
functions/private/Invoke-WinUtilExplorerUpdate.ps1
Normal file
43
functions/private/Invoke-WinUtilExplorerUpdate.ps1
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
function Invoke-WinUtilExplorerUpdate {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Refreshes the Windows Explorer
|
||||||
|
#>
|
||||||
|
|
||||||
|
param (
|
||||||
|
[string]$action = "refresh"
|
||||||
|
)
|
||||||
|
|
||||||
|
if ($action -eq "refresh") {
|
||||||
|
Invoke-WPFRunspace -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
|
# Send the WM_SETTINGCHANGE message to all windows
|
||||||
|
Add-Type -TypeDefinition @"
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
public class Win32 {
|
||||||
|
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
|
||||||
|
public static extern IntPtr SendMessageTimeout(
|
||||||
|
IntPtr hWnd,
|
||||||
|
uint Msg,
|
||||||
|
IntPtr wParam,
|
||||||
|
string lParam,
|
||||||
|
uint fuFlags,
|
||||||
|
uint uTimeout,
|
||||||
|
out IntPtr lpdwResult);
|
||||||
|
}
|
||||||
|
"@
|
||||||
|
|
||||||
|
$HWND_BROADCAST = [IntPtr]0xffff
|
||||||
|
$WM_SETTINGCHANGE = 0x1A
|
||||||
|
$SMTO_ABORTIFHUNG = 0x2
|
||||||
|
$timeout = 100
|
||||||
|
|
||||||
|
# Send the broadcast message to all windows
|
||||||
|
[Win32]::SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, [IntPtr]::Zero, "ImmersiveColorSet", $SMTO_ABORTIFHUNG, $timeout, [ref]([IntPtr]::Zero))
|
||||||
|
}
|
||||||
|
} elseif ($action -eq "restart") {
|
||||||
|
# Restart the Windows Explorer
|
||||||
|
taskkill.exe /F /IM "explorer.exe"
|
||||||
|
Start-Process "explorer.exe"
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,9 @@ function Invoke-WinUtilGPU {
|
|||||||
"*NVIDIA GeForce*Laptop*",
|
"*NVIDIA GeForce*Laptop*",
|
||||||
"*NVIDIA GeForce*GT*",
|
"*NVIDIA GeForce*GT*",
|
||||||
"*AMD Radeon(TM)*",
|
"*AMD Radeon(TM)*",
|
||||||
|
"*Intel(R) HD Graphics*",
|
||||||
"*UHD*"
|
"*UHD*"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach ($gpu in $gpuInfo) {
|
foreach ($gpu in $gpuInfo) {
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
function Invoke-WinUtilHiddenFiles {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Enable/Disable Hidden Files
|
|
||||||
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable Hidden Files
|
|
||||||
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Hidden Files"
|
|
||||||
$value = 1
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Hidden Files"
|
|
||||||
$value = 0
|
|
||||||
}
|
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
|
||||||
Set-ItemProperty -Path $Path -Name Hidden -Value $value
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
103
functions/private/Invoke-WinUtilInstallPSProfile.ps1
Normal file
103
functions/private/Invoke-WinUtilInstallPSProfile.ps1
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
function Invoke-WinUtilInstallPSProfile {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Backs up your original profile then installs and applies the CTT PowerShell profile.
|
||||||
|
#>
|
||||||
|
|
||||||
|
Invoke-WPFRunspace -ArgumentList $PROFILE -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
|
# Remap the automatic built-in $PROFILE variable to the parameter named $PSProfile.
|
||||||
|
param ($PSProfile)
|
||||||
|
|
||||||
|
function Invoke-PSSetup {
|
||||||
|
# Define the URL used to download Chris Titus Tech's PowerShell profile.
|
||||||
|
$url = "https://raw.githubusercontent.com/ChrisTitusTech/powershell-profile/main/Microsoft.PowerShell_profile.ps1"
|
||||||
|
|
||||||
|
# Get the file hash for the user's current PowerShell profile.
|
||||||
|
$OldHash = Get-FileHash $PSProfile -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
# Download Chris Titus Tech's PowerShell profile to the 'TEMP' folder.
|
||||||
|
Invoke-RestMethod $url -OutFile "$env:TEMP/Microsoft.PowerShell_profile.ps1"
|
||||||
|
|
||||||
|
# Get the file hash for Chris Titus Tech's PowerShell profile.
|
||||||
|
$NewHash = Get-FileHash "$env:TEMP/Microsoft.PowerShell_profile.ps1"
|
||||||
|
|
||||||
|
# Store the file hash of Chris Titus Tech's PowerShell profile.
|
||||||
|
if (!(Test-Path "$PSProfile.hash")) {
|
||||||
|
$NewHash.Hash | Out-File "$PSProfile.hash"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if the new profile's hash doesn't match the old profile's hash.
|
||||||
|
if ($NewHash.Hash -ne $OldHash.Hash) {
|
||||||
|
# Check if oldprofile.ps1 exists and use it as a profile backup source.
|
||||||
|
if (Test-Path "$env:USERPROFILE\oldprofile.ps1") {
|
||||||
|
Write-Host "===> Backup File Exists... <===" -ForegroundColor Yellow
|
||||||
|
Write-Host "===> Moving Backup File... <===" -ForegroundColor Yellow
|
||||||
|
Copy-Item "$env:USERPROFILE\oldprofile.ps1" "$PSProfile.bak"
|
||||||
|
Write-Host "===> Profile Backup: Done. <===" -ForegroundColor Yellow
|
||||||
|
} else {
|
||||||
|
# If oldprofile.ps1 does not exist use $PSProfile as a profile backup source.
|
||||||
|
# Check if the profile backup file has not already been created on the disk.
|
||||||
|
if ((Test-Path $PSProfile) -and (-not (Test-Path "$PSProfile.bak"))) {
|
||||||
|
# Let the user know their PowerShell profile is being backed up.
|
||||||
|
Write-Host "===> Backing Up Profile... <===" -ForegroundColor Yellow
|
||||||
|
|
||||||
|
# Copy the user's current PowerShell profile to the backup file path.
|
||||||
|
Copy-Item -Path $PSProfile -Destination "$PSProfile.bak"
|
||||||
|
|
||||||
|
# Let the user know the profile backup has been completed successfully.
|
||||||
|
Write-Host "===> Profile Backup: Done. <===" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Let the user know Chris Titus Tech's PowerShell profile is being installed.
|
||||||
|
Write-Host "===> Installing Profile... <===" -ForegroundColor Yellow
|
||||||
|
|
||||||
|
# Start a new hidden PowerShell instance because setup.ps1 does not work in runspaces.
|
||||||
|
Start-Process -FilePath "pwsh" -ArgumentList "-ExecutionPolicy Bypass -NoProfile -Command `"Invoke-Expression (Invoke-WebRequest `'https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1`')`"" -WindowStyle Hidden -Wait
|
||||||
|
|
||||||
|
# Let the user know Chris Titus Tech's PowerShell profile has been installed successfully.
|
||||||
|
Write-Host "Profile has been installed. Please restart your shell to reflect the changes!" -ForegroundColor Magenta
|
||||||
|
|
||||||
|
# Let the user know Chris Titus Tech's PowerShell profile has been setup successfully.
|
||||||
|
Write-Host "===> Finished Profile Setup <===" -ForegroundColor Yellow
|
||||||
|
} else {
|
||||||
|
# Let the user know Chris Titus Tech's PowerShell profile is already fully up-to-date.
|
||||||
|
Write-Host "Profile is up to date" -ForegroundColor Magenta
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if PowerShell Core is currently installed as a program and is available as a command.
|
||||||
|
if (Get-Command "pwsh" -ErrorAction SilentlyContinue) {
|
||||||
|
# Check if the version of PowerShell Core currently in use is version 7 or higher.
|
||||||
|
if ($PSVersionTable.PSVersion.Major -ge 7) {
|
||||||
|
# Invoke the PowerShell Profile setup script to install Chris Titus Tech's PowerShell Profile.
|
||||||
|
Invoke-PSSetup
|
||||||
|
} else {
|
||||||
|
# Let the user know that PowerShell 7 is installed but is not currently in use.
|
||||||
|
Write-Host "This profile requires Powershell 7, which is currently installed but not used!" -ForegroundColor Red
|
||||||
|
|
||||||
|
# Load the necessary .NET library required to use Windows Forms to show dialog boxes.
|
||||||
|
Add-Type -AssemblyName System.Windows.Forms
|
||||||
|
|
||||||
|
# Display the message box asking if the user wants to install PowerShell 7 or not.
|
||||||
|
$question = [System.Windows.Forms.MessageBox]::Show(
|
||||||
|
"Profile requires Powershell 7, which is currently installed but not used! Do you want to install the profile for Powershell 7?",
|
||||||
|
"Question",
|
||||||
|
[System.Windows.Forms.MessageBoxButtons]::YesNo,
|
||||||
|
[System.Windows.Forms.MessageBoxIcon]::Question
|
||||||
|
)
|
||||||
|
|
||||||
|
# Proceed with the installation and setup of the profile as the user pressed the 'Yes' button.
|
||||||
|
if ($question -eq [System.Windows.Forms.DialogResult]::Yes) {
|
||||||
|
Invoke-PSSetup
|
||||||
|
} else {
|
||||||
|
# Let the user know the setup of the profile will not proceed as they pressed the 'No' button.
|
||||||
|
Write-Host "Not proceeding with the profile setup!" -ForegroundColor Magenta
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# Let the user know that the profile requires PowerShell Core but it is not currently installed.
|
||||||
|
Write-Host "This profile requires Powershell Core, which is currently not installed!" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,38 +0,0 @@
|
|||||||
Function Invoke-WinUtilMouseAcceleration {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Enables/Disables Mouse Acceleration
|
|
||||||
|
|
||||||
.PARAMETER DarkMoveEnabled
|
|
||||||
Indicates the current Mouse Acceleration State
|
|
||||||
|
|
||||||
#>
|
|
||||||
Param($MouseAccelerationEnabled)
|
|
||||||
try {
|
|
||||||
if ($MouseAccelerationEnabled -eq $false) {
|
|
||||||
Write-Host "Enabling Mouse Acceleration"
|
|
||||||
$MouseSpeed = 1
|
|
||||||
$MouseThreshold1 = 6
|
|
||||||
$MouseThreshold2 = 10
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Mouse Acceleration"
|
|
||||||
$MouseSpeed = 0
|
|
||||||
$MouseThreshold1 = 0
|
|
||||||
$MouseThreshold2 = 0
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$Path = "HKCU:\Control Panel\Mouse"
|
|
||||||
Set-ItemProperty -Path $Path -Name MouseSpeed -Value $MouseSpeed
|
|
||||||
Set-ItemProperty -Path $Path -Name MouseThreshold1 -Value $MouseThreshold1
|
|
||||||
Set-ItemProperty -Path $Path -Name MouseThreshold2 -Value $MouseThreshold2
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
function Invoke-WinUtilNumLock {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Disables/Enables NumLock on startup
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable Numlock on startup
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Numlock on startup"
|
|
||||||
$value = 2
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Numlock on startup"
|
|
||||||
$value = 0
|
|
||||||
}
|
|
||||||
New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS
|
|
||||||
$HKUPath = "HKU:\.Default\Control Panel\Keyboard"
|
|
||||||
$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] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
81
functions/private/Invoke-WinUtilSSHServer.ps1
Normal file
81
functions/private/Invoke-WinUtilSSHServer.ps1
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
function Invoke-WinUtilSSHServer {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Enables OpenSSH server to remote into your windows device
|
||||||
|
#>
|
||||||
|
|
||||||
|
# Get the latest version of OpenSSH Server
|
||||||
|
$FeatureName = Get-WindowsCapability -Online | Where-Object { $_.Name -like "OpenSSH.Server*" }
|
||||||
|
|
||||||
|
# Install the OpenSSH Server feature if not already installed
|
||||||
|
if ($FeatureName.State -ne "Installed") {
|
||||||
|
Write-Host "Enabling OpenSSH Server"
|
||||||
|
Add-WindowsCapability -Online -Name $FeatureName.Name
|
||||||
|
}
|
||||||
|
|
||||||
|
# Sets up the OpenSSH Server service
|
||||||
|
Write-Host "Starting the services"
|
||||||
|
Start-Service -Name sshd
|
||||||
|
Set-Service -Name sshd -StartupType Automatic
|
||||||
|
|
||||||
|
# Sets up the ssh-agent service
|
||||||
|
Start-Service 'ssh-agent'
|
||||||
|
Set-Service -Name 'ssh-agent' -StartupType 'Automatic'
|
||||||
|
|
||||||
|
# Confirm the required services are running
|
||||||
|
$SSHDaemonService = Get-Service -Name sshd
|
||||||
|
$SSHAgentService = Get-Service -Name 'ssh-agent'
|
||||||
|
|
||||||
|
if ($SSHDaemonService.Status -eq 'Running') {
|
||||||
|
Write-Host "OpenSSH Server is running."
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
Write-Host "OpenSSH Server is not running. Attempting to restart..."
|
||||||
|
Restart-Service -Name sshd -Force
|
||||||
|
Write-Host "OpenSSH Server has been restarted successfully."
|
||||||
|
} catch {
|
||||||
|
Write-Host "Failed to restart OpenSSH Server: $_"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($SSHAgentService.Status -eq 'Running') {
|
||||||
|
Write-Host "ssh-agent is running."
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
Write-Host "ssh-agent is not running. Attempting to restart..."
|
||||||
|
Restart-Service -Name sshd -Force
|
||||||
|
Write-Host "ssh-agent has been restarted successfully."
|
||||||
|
} catch {
|
||||||
|
Write-Host "Failed to restart ssh-agent : $_"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Adding Firewall rule for port 22
|
||||||
|
Write-Host "Setting up firewall rules"
|
||||||
|
$firewallRule = (Get-NetFirewallRule -Name 'sshd').Enabled
|
||||||
|
if ($firewallRule) {
|
||||||
|
Write-Host "Firewall rule for OpenSSH Server (sshd) already exists."
|
||||||
|
} else {
|
||||||
|
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
|
||||||
|
Write-Host "Firewall rule for OpenSSH Server created and enabled."
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check for the authorized_keys file
|
||||||
|
$sshFolderPath = "$env:HOMEDRIVE\$env:HOMEPATH\.ssh"
|
||||||
|
$authorizedKeysPath = "$sshFolderPath\authorized_keys"
|
||||||
|
|
||||||
|
if (-not (Test-Path -Path $sshFolderPath)) {
|
||||||
|
Write-Host "Creating ssh directory..."
|
||||||
|
New-Item -Path $sshFolderPath -ItemType Directory -Force
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not (Test-Path -Path $authorizedKeysPath)) {
|
||||||
|
Write-Host "Creating authorized_keys file..."
|
||||||
|
New-Item -Path $authorizedKeysPath -ItemType File -Force
|
||||||
|
Write-Host "authorized_keys file created at $authorizedKeysPath."
|
||||||
|
} else {
|
||||||
|
Write-Host "authorized_keys file already exists at $authorizedKeysPath."
|
||||||
|
}
|
||||||
|
Write-Host "OpenSSH server was successfully enabled."
|
||||||
|
Write-Host "The config file can be located at C:\ProgramData\ssh\sshd_config "
|
||||||
|
Write-Host "Add your public keys to this file -> $authorizedKeysPath"
|
||||||
|
}
|
@ -1,27 +0,0 @@
|
|||||||
function Invoke-WinUtilShowExt {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Disables/Enables Show file Extentions
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable Show file extentions
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Showing file extentions"
|
|
||||||
$value = 0
|
|
||||||
} else {
|
|
||||||
Write-Host "hiding file extensions"
|
|
||||||
$value = 1
|
|
||||||
}
|
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
|
||||||
Set-ItemProperty -Path $Path -Name HideFileExt -Value $value
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
function Invoke-WinUtilSnapFlyout {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Disables/Enables Snap Assist Flyout on startup
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable Snap Assist Flyout on startup
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Snap Assist Flyout On startup"
|
|
||||||
$value = 1
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Snap Assist Flyout On startup"
|
|
||||||
$value = 0
|
|
||||||
}
|
|
||||||
# taskkill.exe /F /IM "explorer.exe"
|
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
|
||||||
taskkill.exe /F /IM "explorer.exe"
|
|
||||||
Set-ItemProperty -Path $Path -Name EnableSnapAssistFlyout -Value $value
|
|
||||||
Start-Process "explorer.exe"
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
function Invoke-WinUtilSnapSuggestion {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Disables/Enables Snap Assist Suggestions on startup
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable Snap Assist Suggestions on startup
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Snap Assist Suggestion On startup"
|
|
||||||
$value = 1
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Snap Assist Suggestion On startup"
|
|
||||||
$value = 0
|
|
||||||
}
|
|
||||||
# taskkill.exe /F /IM "explorer.exe"
|
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
|
||||||
taskkill.exe /F /IM "explorer.exe"
|
|
||||||
Set-ItemProperty -Path $Path -Name SnapAssist -Value $value
|
|
||||||
Start-Process "explorer.exe"
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
function Invoke-WinUtilSnapWindow {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Disables/Enables Snapping Windows on startup
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable Snapping Windows on startup
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Snap Windows On startup | Relogin Required"
|
|
||||||
$value = 1
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Snap Windows On startup | Relogin Required"
|
|
||||||
$value = 0
|
|
||||||
}
|
|
||||||
$Path = "HKCU:\Control Panel\Desktop"
|
|
||||||
Set-ItemProperty -Path $Path -Name WindowArrangementActive -Value $value
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
Function Invoke-WinUtilStickyKeys {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Disables/Enables Sticky Keyss on startup
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable Sticky Keys on startup
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Sticky Keys On startup"
|
|
||||||
$value = 510
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Sticky Keys On startup"
|
|
||||||
$value = 58
|
|
||||||
}
|
|
||||||
$Path = "HKCU:\Control Panel\Accessibility\StickyKeys"
|
|
||||||
Set-ItemProperty -Path $Path -Name Flags -Value $value
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
function Invoke-WinUtilTaskView {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Enable/Disable Task View
|
|
||||||
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable Task View
|
|
||||||
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Task View"
|
|
||||||
$value = 1
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Task View"
|
|
||||||
$value = 0
|
|
||||||
}
|
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
|
||||||
Set-ItemProperty -Path $Path -Name ShowTaskViewButton -Value $value
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
function Invoke-WinUtilTaskbarAlignment {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Switches between Center & Left Taskbar Alignment
|
|
||||||
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to make Taskbar Alignment Center or Left
|
|
||||||
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Making Taskbar Alignment to the Center"
|
|
||||||
$value = 1
|
|
||||||
} else {
|
|
||||||
Write-Host "Making Taskbar Alignment to the Left"
|
|
||||||
$value = 0
|
|
||||||
}
|
|
||||||
$Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
|
||||||
Set-ItemProperty -Path $Path -Name "TaskbarAl" -Value $value
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
function Invoke-WinUtilTaskbarSearch {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Enable/Disable Taskbar Search Button.
|
|
||||||
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable Taskbar Search Button.
|
|
||||||
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Search Button"
|
|
||||||
$value = 1
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Search Button"
|
|
||||||
$value = 0
|
|
||||||
}
|
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search\"
|
|
||||||
Set-ItemProperty -Path $Path -Name SearchboxTaskbarMode -Value $value
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
function Invoke-WinUtilTaskbarWidgets {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Enable/Disable Taskbar Widgets
|
|
||||||
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable Taskbar Widgets
|
|
||||||
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Taskbar Widgets"
|
|
||||||
$value = 1
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Taskbar Widgets"
|
|
||||||
$value = 0
|
|
||||||
}
|
|
||||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
|
||||||
Set-ItemProperty -Path $Path -Name TaskbarDa -Value $value
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
@ -21,6 +21,10 @@ function Invoke-WinUtilTweaks {
|
|||||||
$KeepServiceStartup = $true
|
$KeepServiceStartup = $true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if ($Checkbox -contains "Toggle") {
|
||||||
|
$CheckBox = $sync.configs.tweaks.$CheckBox
|
||||||
|
}
|
||||||
|
|
||||||
Write-Debug "Tweaks: $($CheckBox)"
|
Write-Debug "Tweaks: $($CheckBox)"
|
||||||
if($undo) {
|
if($undo) {
|
||||||
$Values = @{
|
$Values = @{
|
||||||
@ -73,6 +77,14 @@ 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))"
|
||||||
|
if (($psitem.Path -imatch "hku") -and !(Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) {
|
||||||
|
$null = (New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS)
|
||||||
|
if (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue) {
|
||||||
|
Write-Debug "HKU drive created successfully"
|
||||||
|
} else {
|
||||||
|
Write-Debug "Failed to create HKU drive"
|
||||||
|
}
|
||||||
|
}
|
||||||
Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry)
|
Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
187
functions/private/Invoke-WinUtilUninstallPSProfile.ps1
Normal file
187
functions/private/Invoke-WinUtilUninstallPSProfile.ps1
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
function Invoke-WinUtilUninstallPSProfile {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
# Uninstalls the CTT PowerShell profile then restores the original profile.
|
||||||
|
#>
|
||||||
|
|
||||||
|
Invoke-WPFRunspace -ArgumentList $PROFILE -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
|
# Remap the automatic built-in $PROFILE variable to the parameter named $PSProfile.
|
||||||
|
param ($PSProfile)
|
||||||
|
|
||||||
|
# Helper function used to uninstall a specific Nerd Fonts font package.
|
||||||
|
function Uninstall-NerdFonts {
|
||||||
|
# Define the parameters block for the Uninstall-NerdFonts function.
|
||||||
|
param (
|
||||||
|
[string]$FontsPath = "$env:LOCALAPPDATA\Microsoft\Windows\Fonts",
|
||||||
|
[string]$FontFamilyName = "CaskaydiaCoveNerdFont"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Get the list of installed fonts as specified by the FontFamilyName parameter.
|
||||||
|
$Fonts = Get-ChildItem $FontsPath -Recurse -Filter "*.ttf" | Where-Object { $_.Name -match $FontFamilyName }
|
||||||
|
|
||||||
|
# Check if the specified fonts are currently installed on the system.
|
||||||
|
if ($Fonts) {
|
||||||
|
# Let the user know that the Nerd Fonts are currently being uninstalled.
|
||||||
|
Write-Host "===> Uninstalling: Nerd Fonts... <===" -ForegroundColor Yellow
|
||||||
|
|
||||||
|
# Loop over the font files and remove each installed font file one-by-one.
|
||||||
|
$Fonts | ForEach-Object {
|
||||||
|
# Check if the font file exists on the disk before attempting to remove it.
|
||||||
|
if (Test-Path "$($_.FullName)") {
|
||||||
|
# Remove the found font files from the disk; uninstalling the font.
|
||||||
|
Remove-Item "$($_.FullName)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Let the user know that the Nerd Fonts package has been uninstalled from the system.
|
||||||
|
if (-not $Fonts) {
|
||||||
|
Write-Host "===> Successfully Uninstalled: Nerd Fonts. <===" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if Chris Titus Tech's PowerShell profile is currently available in the PowerShell profile folder.
|
||||||
|
if (Test-Path $PSProfile -PathType Leaf) {
|
||||||
|
# Set the GitHub repo path used for looking up the name of Chris Titus Tech's powershell-profile repo.
|
||||||
|
$GitHubRepoPath = "ChrisTitusTech/powershell-profile"
|
||||||
|
|
||||||
|
# Get the unique identifier used to test for the presence of Chris Titus Tech's PowerShell profile.
|
||||||
|
$PSProfileIdentifier = (Invoke-RestMethod "https://api.github.com/repos/$GitHubRepoPath").full_name
|
||||||
|
|
||||||
|
# Check if Chris Titus Tech's PowerShell profile is currently installed in the PowerShell profile folder.
|
||||||
|
if ((Get-Content $PSProfile) -match $PSProfileIdentifier) {
|
||||||
|
# Attempt to uninstall Chris Titus Tech's PowerShell profile from the PowerShell profile folder.
|
||||||
|
try {
|
||||||
|
# Get the content of the backup PowerShell profile and store it in-memory.
|
||||||
|
$PSProfileContent = Get-Content "$PSProfile.bak"
|
||||||
|
|
||||||
|
# Store the flag used to check if OhMyPosh is in use by the backup PowerShell profile.
|
||||||
|
$OhMyPoshInUse = $PSProfileContent -match "oh-my-posh init"
|
||||||
|
|
||||||
|
# Check if OhMyPosh is not currently in use by the backup PowerShell profile.
|
||||||
|
if (-not $OhMyPoshInUse) {
|
||||||
|
# If OhMyPosh is currently installed attempt to uninstall it from the system.
|
||||||
|
if (Get-Command oh-my-posh -ErrorAction SilentlyContinue) {
|
||||||
|
# Let the user know that OhMyPosh is currently being uninstalled from their system.
|
||||||
|
Write-Host "===> Uninstalling: OhMyPosh... <===" -ForegroundColor Yellow
|
||||||
|
|
||||||
|
# Attempt to uninstall OhMyPosh from the system with the WinGet package manager.
|
||||||
|
winget uninstall -e --id JanDeDobbeleer.OhMyPosh
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# Let the user know that the uninstallation of OhMyPosh has been skipped because it is in use.
|
||||||
|
Write-Host "===> Skipped Uninstall: OhMyPosh In-Use. <===" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
# Let the user know that an error was encountered when uninstalling OhMyPosh.
|
||||||
|
Write-Host "Failed to uninstall OhMyPosh. Error: $_" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
|
||||||
|
# Attempt to uninstall the specified Nerd Fonts package from the system.
|
||||||
|
try {
|
||||||
|
# Specify the directory that the specified font package will be uninstalled from.
|
||||||
|
[string]$FontsPath = "$env:LOCALAPPDATA\Microsoft\Windows\Fonts"
|
||||||
|
|
||||||
|
# Specify the name of the font package that is to be uninstalled from the system.
|
||||||
|
[string]$FontFamilyName = "CaskaydiaCoveNerdFont"
|
||||||
|
|
||||||
|
# Call the function used to uninstall the specified Nerd Fonts package from the system.
|
||||||
|
Uninstall-NerdFonts -FontsPath $FontsPath -FontFamilyName $FontFamilyName
|
||||||
|
} catch {
|
||||||
|
# Let the user know that an error was encountered when uninstalling Nerd Fonts.
|
||||||
|
Write-Host "Failed to uninstall Nerd Fonts. Error: $_" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
|
||||||
|
# Attempt to uninstall the Terminal-Icons PowerShell module from the system.
|
||||||
|
try {
|
||||||
|
# Get the content of the backup PowerShell profile and store it in-memory.
|
||||||
|
$PSProfileContent = Get-Content "$PSProfile.bak"
|
||||||
|
|
||||||
|
# Store the flag used to check if Terminal-Icons is in use by the backup PowerShell profile.
|
||||||
|
$TerminalIconsInUse = $PSProfileContent -match "Import-Module" -and $PSProfileContent -match "Terminal-Icons"
|
||||||
|
|
||||||
|
# Check if Terminal-Icons is not currently in use by the backup PowerShell profile.
|
||||||
|
if (-not $TerminalIconsInUse) {
|
||||||
|
# If Terminal-Icons is currently installed attempt to uninstall it from the system.
|
||||||
|
if (Get-Module -ListAvailable Terminal-Icons) {
|
||||||
|
# Let the user know that Terminal-Icons is currently being uninstalled from their system.
|
||||||
|
Write-Host "===> Uninstalling: Terminal-Icons... <===" -ForegroundColor Yellow
|
||||||
|
|
||||||
|
# Attempt to uninstall Terminal-Icons from the system with Uninstall-Module.
|
||||||
|
Uninstall-Module -Name Terminal-Icons
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# Let the user know that the uninstallation of Terminal-Icons has been skipped because it is in use.
|
||||||
|
Write-Host "===> Skipped Uninstall: Terminal-Icons In-Use. <===" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
# Let the user know that an error was encountered when uninstalling Terminal-Icons.
|
||||||
|
Write-Host "Failed to uninstall Terminal-Icons. Error: $_" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
|
||||||
|
# Attempt to uninstall the Zoxide application from the system.
|
||||||
|
try {
|
||||||
|
# Get the content of the backup PowerShell profile and store it in-memory.
|
||||||
|
$PSProfileContent = Get-Content "$PSProfile.bak"
|
||||||
|
|
||||||
|
# Store the flag used to check if Zoxide is in use by the backup PowerShell profile.
|
||||||
|
$ZoxideInUse = $PSProfileContent -match "zoxide init"
|
||||||
|
|
||||||
|
# Check if Zoxide is not currently in use by the backup PowerShell profile.
|
||||||
|
if (-not $ZoxideInUse) {
|
||||||
|
# If Zoxide is currently installed attempt to uninstall it from the system.
|
||||||
|
if (Get-Command zoxide -ErrorAction SilentlyContinue) {
|
||||||
|
# Let the user know that Zoxide is currently being uninstalled from their system.
|
||||||
|
Write-Host "===> Uninstalling: Zoxide... <===" -ForegroundColor Yellow
|
||||||
|
|
||||||
|
# Attempt to uninstall Zoxide from the system with the WinGet package manager.
|
||||||
|
winget uninstall -e --id ajeetdsouza.zoxide
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# Let the user know that the uninstallation of Zoxide been skipped because it is in use.
|
||||||
|
Write-Host "===> Skipped Uninstall: Zoxide In-Use. <===" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
# Let the user know that an error was encountered when uninstalling Zoxide.
|
||||||
|
Write-Host "Failed to uninstall Zoxide. Error: $_" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
|
||||||
|
# Attempt to uninstall the CTT PowerShell profile from the system.
|
||||||
|
try {
|
||||||
|
# Try and remove the CTT PowerShell Profile file from the disk with Remove-Item.
|
||||||
|
Remove-Item $PSProfile
|
||||||
|
|
||||||
|
# Let the user know that the CTT PowerShell profile has been uninstalled from the system.
|
||||||
|
Write-Host "Profile has been uninstalled. Please restart your shell to reflect the changes!" -ForegroundColor Magenta
|
||||||
|
} catch {
|
||||||
|
# Let the user know that an error was encountered when uninstalling the profile.
|
||||||
|
Write-Host "Failed to uninstall profile. Error: $_" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
|
||||||
|
# Attempt to move the user's original PowerShell profile backup back to its original location.
|
||||||
|
try {
|
||||||
|
# Check if the backup PowerShell profile exists before attempting to restore the backup.
|
||||||
|
if (Test-Path "$PSProfile.bak") {
|
||||||
|
# Restore the backup PowerShell profile and move it to its original location.
|
||||||
|
Move-Item "$PSProfile.bak" $PSProfile
|
||||||
|
|
||||||
|
# Let the user know that their PowerShell profile backup has been successfully restored.
|
||||||
|
Write-Host "===> Restored Profile Backup. <===" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
# Let the user know that an error was encountered when restoring the profile backup.
|
||||||
|
Write-Host "Failed to restore profile backup. Error: $_" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
|
||||||
|
# Silently cleanup the oldprofile.ps1 file that was created when the CTT PowerShell profile was installed.
|
||||||
|
Remove-Item "$env:USERPROFILE\oldprofile.ps1" | Out-Null
|
||||||
|
} else {
|
||||||
|
# Let the user know that the CTT PowerShell profile is not installed and that the uninstallation was skipped.
|
||||||
|
Write-Host "===> Chris Titus Tech's PowerShell Profile Not Found. Skipped Uninstallation. <===" -ForegroundColor Magenta
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# Let the user know that no PowerShell profile was found and that the uninstallation was skipped.
|
||||||
|
Write-Host "===> No PowerShell Profile Found. Skipped Uninstallation. <===" -ForegroundColor Magenta
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,27 +0,0 @@
|
|||||||
function Invoke-WinUtilVerboseLogon {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Disables/Enables VerboseLogon Messages
|
|
||||||
.PARAMETER Enabled
|
|
||||||
Indicates whether to enable or disable VerboseLogon messages
|
|
||||||
#>
|
|
||||||
Param($Enabled)
|
|
||||||
try {
|
|
||||||
if ($Enabled -eq $false) {
|
|
||||||
Write-Host "Enabling Verbose Logon Messages"
|
|
||||||
$value = 1
|
|
||||||
} else {
|
|
||||||
Write-Host "Disabling Verbose Logon Messages"
|
|
||||||
$value = 0
|
|
||||||
}
|
|
||||||
$Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
|
|
||||||
Set-ItemProperty -Path $Path -Name VerboseStatus -Value $value
|
|
||||||
} catch [System.Security.SecurityException] {
|
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
|
||||||
Write-Warning $psitem.Exception.ErrorRecord
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
}
|
|
50
functions/private/Invoke-WinUtilpsProfile.ps1
Normal file
50
functions/private/Invoke-WinUtilpsProfile.ps1
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
function Invoke-WinUtilpsProfile {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Installs & applies the CTT Powershell Profile
|
||||||
|
#>
|
||||||
|
Invoke-WPFRunspace -Argumentlist $PROFILE -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
|
param ( $psprofile)
|
||||||
|
function Invoke-PSSetup {
|
||||||
|
$url = "https://raw.githubusercontent.com/ChrisTitusTech/powershell-profile/main/Microsoft.PowerShell_profile.ps1"
|
||||||
|
$oldhash = Get-FileHash $psprofile -ErrorAction SilentlyContinue
|
||||||
|
Invoke-RestMethod $url -OutFile "$env:temp/Microsoft.PowerShell_profile.ps1"
|
||||||
|
$newhash = Get-FileHash "$env:temp/Microsoft.PowerShell_profile.ps1"
|
||||||
|
if ($newhash.Hash -ne $oldhash.Hash) {
|
||||||
|
write-host "===> Installing Profile.. <===" -ForegroundColor Yellow
|
||||||
|
# Starting new hidden shell process bc setup does not work in a runspace
|
||||||
|
Start-Process -FilePath "pwsh" -ArgumentList "-ExecutionPolicy Bypass -NoProfile -Command `"Invoke-Expression (Invoke-WebRequest `'https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1`')`"" -WindowStyle Hidden -Wait
|
||||||
|
Write-Host "Profile has been installed. Please restart your shell to reflect changes!" -ForegroundColor Magenta
|
||||||
|
write-host "===> Finished <===" -ForegroundColor Yellow
|
||||||
|
} else {
|
||||||
|
Write-Host "Profile is up to date" -ForegroundColor Green
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Get-Command "pwsh" -ErrorAction SilentlyContinue) {
|
||||||
|
if ($PSVersionTable.PSVersion.Major -ge 7) {
|
||||||
|
Invoke-PSSetup
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
write-host "Profile requires Powershell 7, which is currently installed but not used!" -ForegroundColor Red
|
||||||
|
# Load the necessary assembly for Windows Forms
|
||||||
|
Add-Type -AssemblyName System.Windows.Forms
|
||||||
|
# Display the Yes/No message box
|
||||||
|
$question = [System.Windows.Forms.MessageBox]::Show("Profile requires Powershell 7, which is currently installed but not used! Do you want to install Profile for Powershell 7?", "Question",
|
||||||
|
[System.Windows.Forms.MessageBoxButtons]::YesNo,
|
||||||
|
[System.Windows.Forms.MessageBoxIcon]::Question)
|
||||||
|
|
||||||
|
# Check the result
|
||||||
|
if ($question -eq [System.Windows.Forms.DialogResult]::Yes) {
|
||||||
|
Invoke-PSSetup
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Host "Not proceeding with the profile setup!"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
write-host "Profile requires Powershell 7, which is not installed!" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
180
functions/private/Invoke-WinutilThemeChange.ps1
Normal file
180
functions/private/Invoke-WinutilThemeChange.ps1
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
function Invoke-WinutilThemeChange {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Toggles between light and dark themes for a Windows utility application.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This function toggles the theme of the user interface between 'Light' and 'Dark' modes,
|
||||||
|
modifying various UI elements such as colors, margins, corner radii, font families, etc.
|
||||||
|
If the '-init' switch is used, it initializes the theme based on the system's current dark mode setting.
|
||||||
|
|
||||||
|
.PARAMETER init
|
||||||
|
A switch parameter. If set to $true, the function initializes the theme based on the system’s current dark mode setting.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Invoke-WinutilThemeChange
|
||||||
|
# Toggles the theme between 'Light' and 'Dark'.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Invoke-WinutilThemeChange -init
|
||||||
|
# Initializes the theme based on the system's dark mode and applies the shared theme.
|
||||||
|
#>
|
||||||
|
param (
|
||||||
|
[switch]$init = $false,
|
||||||
|
[string]$theme
|
||||||
|
)
|
||||||
|
|
||||||
|
function Set-WinutilTheme {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Applies the specified theme to the application's user interface.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This internal function applies the given theme by setting the relevant properties
|
||||||
|
like colors, font families, corner radii, etc., in the UI. It uses the
|
||||||
|
'Set-ThemeResourceProperty' helper function to modify the application's resources.
|
||||||
|
|
||||||
|
.PARAMETER currentTheme
|
||||||
|
The name of the theme to be applied. Common values are "Light", "Dark", or "shared".
|
||||||
|
#>
|
||||||
|
param (
|
||||||
|
[string]$currentTheme
|
||||||
|
)
|
||||||
|
|
||||||
|
function Set-ThemeResourceProperty {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Sets a specific UI property in the application's resources.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This helper function sets a property (e.g., color, margin, corner radius) in the
|
||||||
|
application's resources, based on the provided type and value. It includes
|
||||||
|
error handling to manage potential issues while setting a property.
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
The name of the resource property to modify (e.g., "MainBackgroundColor", "ButtonBackgroundMouseoverColor").
|
||||||
|
|
||||||
|
.PARAMETER Value
|
||||||
|
The value to assign to the resource property (e.g., "#FFFFFF" for a color).
|
||||||
|
|
||||||
|
.PARAMETER Type
|
||||||
|
The type of the resource, such as "ColorBrush", "CornerRadius", "GridLength", or "FontFamily".
|
||||||
|
#>
|
||||||
|
param($Name, $Value, $Type)
|
||||||
|
try {
|
||||||
|
# Set the resource property based on its type
|
||||||
|
$sync.Form.Resources[$Name] = switch ($Type) {
|
||||||
|
"ColorBrush" { [Windows.Media.SolidColorBrush]::new($Value) }
|
||||||
|
"Color" {
|
||||||
|
# Convert hex string to RGB values
|
||||||
|
$hexColor = $Value.TrimStart("#")
|
||||||
|
$r = [Convert]::ToInt32($hexColor.Substring(0,2), 16)
|
||||||
|
$g = [Convert]::ToInt32($hexColor.Substring(2,2), 16)
|
||||||
|
$b = [Convert]::ToInt32($hexColor.Substring(4,2), 16)
|
||||||
|
[Windows.Media.Color]::FromRgb($r, $g, $b)
|
||||||
|
}
|
||||||
|
"CornerRadius" { [System.Windows.CornerRadius]::new($Value) }
|
||||||
|
"GridLength" { [System.Windows.GridLength]::new($Value) }
|
||||||
|
"Thickness" {
|
||||||
|
# Parse the Thickness value (supports 1, 2, or 4 inputs)
|
||||||
|
$values = $Value -split ","
|
||||||
|
switch ($values.Count) {
|
||||||
|
1 { [System.Windows.Thickness]::new([double]$values[0]) }
|
||||||
|
2 { [System.Windows.Thickness]::new([double]$values[0], [double]$values[1]) }
|
||||||
|
4 { [System.Windows.Thickness]::new([double]$values[0], [double]$values[1], [double]$values[2], [double]$values[3]) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"FontFamily" { [Windows.Media.FontFamily]::new($Value) }
|
||||||
|
"Double" { [double]$Value }
|
||||||
|
default { $Value }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
# Log a warning if there's an issue setting the property
|
||||||
|
Write-Warning "Failed to set property $($Name): $_"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Retrieve all theme properties from the theme configuration
|
||||||
|
$themeProperties = $sync.configs.themes.$currentTheme.PSObject.Properties
|
||||||
|
foreach ($_ in $themeProperties) {
|
||||||
|
# Apply properties that deal with colors
|
||||||
|
if ($_.Name -like "*color*") {
|
||||||
|
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "ColorBrush"
|
||||||
|
# For certain color properties, also set complementary values (e.g., BorderColor -> CBorderColor) This is required because e.g DropShadowEffect requires a <Color> and not a <SolidColorBrush> object
|
||||||
|
if ($_.Name -in @("BorderColor", "ButtonBackgroundMouseoverColor")) {
|
||||||
|
Set-ThemeResourceProperty -Name "C$($_.Name)" -Value $_.Value -Type "Color"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Apply corner radius properties
|
||||||
|
elseif ($_.Name -like "*Radius*") {
|
||||||
|
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "CornerRadius"
|
||||||
|
}
|
||||||
|
# Apply row height properties
|
||||||
|
elseif ($_.Name -like "*RowHeight*") {
|
||||||
|
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "GridLength"
|
||||||
|
}
|
||||||
|
# Apply thickness or margin properties
|
||||||
|
elseif (($_.Name -like "*Thickness*") -or ($_.Name -like "*margin")) {
|
||||||
|
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "Thickness"
|
||||||
|
}
|
||||||
|
# Apply font family properties
|
||||||
|
elseif ($_.Name -like "*FontFamily*") {
|
||||||
|
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "FontFamily"
|
||||||
|
}
|
||||||
|
# Apply any other properties as doubles (numerical values)
|
||||||
|
else {
|
||||||
|
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "Double"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$LightPreferencePath = "$env:LOCALAPPDATA\winutil\LightTheme.ini"
|
||||||
|
$DarkPreferencePath = "$env:LOCALAPPDATA\winutil\DarkTheme.ini"
|
||||||
|
|
||||||
|
if ($init) {
|
||||||
|
Set-WinutilTheme -currentTheme "shared"
|
||||||
|
if (Test-Path $LightPreferencePath) {
|
||||||
|
$theme = "Light"
|
||||||
|
}
|
||||||
|
elseif (Test-Path $DarkPreferencePath) {
|
||||||
|
$theme = "Dark"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$theme = "Auto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($theme) {
|
||||||
|
"Auto" {
|
||||||
|
$systemUsesDarkMode = Get-WinUtilToggleStatus WPFToggleDarkMode
|
||||||
|
if ($systemUsesDarkMode) {
|
||||||
|
Set-WinutilTheme -currentTheme "Dark"
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Set-WinutilTheme -currentTheme "Light"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$themeButtonIcon = [char]0xF08C
|
||||||
|
Remove-Item $LightPreferencePath -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item $DarkPreferencePath -Force -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
|
"Dark" {
|
||||||
|
Set-WinutilTheme -currentTheme $theme
|
||||||
|
$themeButtonIcon = [char]0xE708
|
||||||
|
$null = New-Item $DarkPreferencePath -Force
|
||||||
|
Remove-Item $LightPreferencePath -Force -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
|
"Light" {
|
||||||
|
Set-WinutilTheme -currentTheme $theme
|
||||||
|
$themeButtonIcon = [char]0xE706
|
||||||
|
$null = New-Item $LightPreferencePath -Force
|
||||||
|
Remove-Item $DarkPreferencePath -Force -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Update the theme selector button with the appropriate icon
|
||||||
|
$ThemeButton = $sync.Form.FindName("ThemeButton")
|
||||||
|
$ThemeButton.Content = [string]$themeButtonIcon
|
||||||
|
}
|
@ -35,8 +35,14 @@ function Set-WinUtilRegistry {
|
|||||||
New-Item -Path $Path -Force -ErrorAction Stop | Out-Null
|
New-Item -Path $Path -Force -ErrorAction Stop | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Set $Path\$Name to $Value"
|
if ($Value -ne "<RemoveEntry>") {
|
||||||
Set-ItemProperty -Path $Path -Name $Name -Type $Type -Value $Value -Force -ErrorAction Stop | Out-Null
|
Write-Host "Set $Path\$Name to $Value"
|
||||||
|
Set-ItemProperty -Path $Path -Name $Name -Type $Type -Value $Value -Force -ErrorAction Stop | Out-Null
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Write-Host "Remove $Path\$Name"
|
||||||
|
Remove-ItemProperty -Path $Path -Name $Name -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] {
|
||||||
|
@ -61,13 +61,13 @@ function Set-WinUtilTaskbaritem {
|
|||||||
if ($overlay) {
|
if ($overlay) {
|
||||||
switch ($overlay) {
|
switch ($overlay) {
|
||||||
'logo' {
|
'logo' {
|
||||||
$sync["Form"].taskbarItemInfo.Overlay = "$env:LOCALAPPDATA\winutil\cttlogo.png"
|
$sync["Form"].taskbarItemInfo.Overlay = $sync["logorender"]
|
||||||
}
|
}
|
||||||
'checkmark' {
|
'checkmark' {
|
||||||
$sync["Form"].taskbarItemInfo.Overlay = "$env:LOCALAPPDATA\winutil\checkmark.png"
|
$sync["Form"].taskbarItemInfo.Overlay = $sync["checkmarkrender"]
|
||||||
}
|
}
|
||||||
'warning' {
|
'warning' {
|
||||||
$sync["Form"].taskbarItemInfo.Overlay = "$env:LOCALAPPDATA\winutil\warning.png"
|
$sync["Form"].taskbarItemInfo.Overlay = $sync["warningrender"]
|
||||||
}
|
}
|
||||||
'None' {
|
'None' {
|
||||||
$sync["Form"].taskbarItemInfo.Overlay = $null
|
$sync["Form"].taskbarItemInfo.Overlay = $null
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
function Set-WinUtilUITheme {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Sets the theme of the XAML file
|
|
||||||
|
|
||||||
.PARAMETER inputXML
|
|
||||||
A string representing the XAML object to modify
|
|
||||||
|
|
||||||
.PARAMETER themeName
|
|
||||||
The name of the theme to set the XAML to. Defaults to 'matrix'
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Set-WinUtilUITheme -inputXAML $inputXAML
|
|
||||||
#>
|
|
||||||
|
|
||||||
param
|
|
||||||
(
|
|
||||||
[Parameter(Mandatory, position=0)]
|
|
||||||
[string]$inputXML,
|
|
||||||
[Parameter(position=1)]
|
|
||||||
[string]$themeName = 'matrix'
|
|
||||||
)
|
|
||||||
|
|
||||||
try {
|
|
||||||
# Convert the JSON to a PowerShell object
|
|
||||||
$themes = $sync.configs.themes
|
|
||||||
# Select the specified theme
|
|
||||||
$selectedTheme = $themes.$themeName
|
|
||||||
|
|
||||||
if ($selectedTheme) {
|
|
||||||
# Loop through all key-value pairs in the selected theme
|
|
||||||
foreach ($property in $selectedTheme.PSObject.Properties) {
|
|
||||||
$key = $property.Name
|
|
||||||
$value = $property.Value
|
|
||||||
# Add curly braces around the key
|
|
||||||
$formattedKey = "{$key}"
|
|
||||||
# Replace the key with the value in the input XML
|
|
||||||
$inputXML = $inputXML.Replace($formattedKey, $value)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Write-Host "Theme '$themeName' not found."
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to apply theme"
|
|
||||||
Write-Warning $psitem.Exception.StackTrace
|
|
||||||
}
|
|
||||||
|
|
||||||
return $inputXML;
|
|
||||||
}
|
|
@ -6,6 +6,9 @@ function Show-CustomDialog {
|
|||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This function creates a custom dialog box with the specified message and additional elements such as an image, heading, and an OK button. The dialog box is designed with a green border, rounded corners, and a black background.
|
This function creates a custom dialog box with the specified message and additional elements such as an image, heading, and an OK button. The dialog box is designed with a green border, rounded corners, and a black background.
|
||||||
|
|
||||||
|
.PARAMETER Title
|
||||||
|
The Title to use for the dialog window's Title Bar, this will not be visible by the user, as window styling is set to None.
|
||||||
|
|
||||||
.PARAMETER Message
|
.PARAMETER Message
|
||||||
The message to be displayed in the dialog box.
|
The message to be displayed in the dialog box.
|
||||||
|
|
||||||
@ -16,60 +19,102 @@ function Show-CustomDialog {
|
|||||||
The height of the custom dialog window.
|
The height of the custom dialog window.
|
||||||
|
|
||||||
.PARAMETER FontSize
|
.PARAMETER FontSize
|
||||||
The Font Size for text shown inside the custom dialog window.
|
The Font Size of message shown inside custom dialog window.
|
||||||
|
|
||||||
.PARAMETER HeaderFontSize
|
.PARAMETER HeaderFontSize
|
||||||
The Font Size for the Header of the custom dialog window.
|
The Font Size for the Header of custom dialog window.
|
||||||
|
|
||||||
.PARAMETER IconSize
|
.PARAMETER LogoSize
|
||||||
The Size to use for Icon inside the custom dialog window.
|
The Size of the Logo used inside the custom dialog window.
|
||||||
|
|
||||||
|
.PARAMETER ForegroundColor
|
||||||
|
The Foreground Color of dialog window title & message.
|
||||||
|
|
||||||
|
.PARAMETER BackgroundColor
|
||||||
|
The Background Color of dialog window.
|
||||||
|
|
||||||
|
.PARAMETER BorderColor
|
||||||
|
The Color for dialog window border.
|
||||||
|
|
||||||
|
.PARAMETER ButtonBackgroundColor
|
||||||
|
The Background Color for Buttons in dialog window.
|
||||||
|
|
||||||
|
.PARAMETER ButtonForegroundColor
|
||||||
|
The Foreground Color for Buttons in dialog window.
|
||||||
|
|
||||||
|
.PARAMETER ShadowColor
|
||||||
|
The Color used when creating the Drop-down Shadow effect for dialog window.
|
||||||
|
|
||||||
|
.PARAMETER LogoColor
|
||||||
|
The Color of WinUtil Text found next to WinUtil's Logo inside dialog window.
|
||||||
|
|
||||||
|
.PARAMETER LinkForegroundColor
|
||||||
|
The Foreground Color for Links inside dialog window.
|
||||||
|
|
||||||
|
.PARAMETER LinkHoverForegroundColor
|
||||||
|
The Foreground Color for Links when the mouse pointer hovers over them inside dialog window.
|
||||||
|
|
||||||
.PARAMETER EnableScroll
|
.PARAMETER EnableScroll
|
||||||
A flag indicating whether to enable scrolling if the content exceeds the window size.
|
A flag indicating whether to enable scrolling if the content exceeds the window size.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Show-CustomDialog -Message "This is a custom dialog with a message and an image above." -Width 300 -Height 200
|
Show-CustomDialog -Title "My Custom Dialog" -Message "This is a custom dialog with a message and an image above." -Width 300 -Height 200
|
||||||
|
|
||||||
|
Makes a new Custom Dialog with the title 'My Custom Dialog' and a message 'This is a custom dialog with a message and an image above.', with dimensions of 300 by 200 pixels.
|
||||||
|
Other styling options are grabbed from '$sync.Form.Resources' global variable.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
$foregroundColor = New-Object System.Windows.Media.SolidColorBrush("#0088e5")
|
||||||
|
$backgroundColor = New-Object System.Windows.Media.SolidColorBrush("#1e1e1e")
|
||||||
|
$linkForegroundColor = New-Object System.Windows.Media.SolidColorBrush("#0088e5")
|
||||||
|
$linkHoverForegroundColor = New-Object System.Windows.Media.SolidColorBrush("#005289")
|
||||||
|
Show-CustomDialog -Title "My Custom Dialog" -Message "This is a custom dialog with a message and an image above." -Width 300 -Height 200 -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor -LinkForegroundColor $linkForegroundColor -LinkHoverForegroundColor $linkHoverForegroundColor
|
||||||
|
|
||||||
|
Makes a new Custom Dialog with the title 'My Custom Dialog' and a message 'This is a custom dialog with a message and an image above.', with dimensions of 300 by 200 pixels, with a link foreground (and general foreground) colors of '#0088e5', background color of '#1e1e1e', and Link Color on Hover of '005289', all of which are in Hexadecimal (the '#' Symbol is required by SolidColorBrush Constructor).
|
||||||
|
Other styling options are grabbed from '$sync.Form.Resources' global variable.
|
||||||
|
|
||||||
#>
|
#>
|
||||||
param(
|
param(
|
||||||
|
[string]$Title,
|
||||||
[string]$Message,
|
[string]$Message,
|
||||||
[int]$Width = 300,
|
[int]$Width = $sync.Form.Resources.CustomDialogWidth,
|
||||||
[int]$Height = 200,
|
[int]$Height = $sync.Form.Resources.CustomDialogHeight,
|
||||||
[int]$FontSize = 10,
|
|
||||||
[int]$HeaderFontSize = 14,
|
[System.Windows.Media.FontFamily]$FontFamily = $sync.Form.Resources.FontFamily,
|
||||||
[int]$IconSize = 25,
|
[int]$FontSize = $sync.Form.Resources.CustomDialogFontSize,
|
||||||
|
[int]$HeaderFontSize = $sync.Form.Resources.CustomDialogFontSizeHeader,
|
||||||
|
[int]$LogoSize = $sync.Form.Resources.CustomDialogLogoSize,
|
||||||
|
|
||||||
|
[System.Windows.Media.Color]$ShadowColor = "#AAAAAAAA",
|
||||||
|
[System.Windows.Media.SolidColorBrush]$LogoColor = $sync.Form.Resources.LabelboxForegroundColor,
|
||||||
|
[System.Windows.Media.SolidColorBrush]$BorderColor = $sync.Form.Resources.BorderColor,
|
||||||
|
[System.Windows.Media.SolidColorBrush]$ForegroundColor = $sync.Form.Resources.MainForegroundColor,
|
||||||
|
[System.Windows.Media.SolidColorBrush]$BackgroundColor = $sync.Form.Resources.MainBackgroundColor,
|
||||||
|
[System.Windows.Media.SolidColorBrush]$ButtonForegroundColor = $sync.Form.Resources.ButtonInstallForegroundColor,
|
||||||
|
[System.Windows.Media.SolidColorBrush]$ButtonBackgroundColor = $sync.Form.Resources.ButtonInstallBackgroundColor,
|
||||||
|
[System.Windows.Media.SolidColorBrush]$LinkForegroundColor = $sync.Form.Resources.LinkForegroundColor,
|
||||||
|
[System.Windows.Media.SolidColorBrush]$LinkHoverForegroundColor = $sync.Form.Resources.LinkHoverForegroundColor,
|
||||||
|
|
||||||
[bool]$EnableScroll = $false
|
[bool]$EnableScroll = $false
|
||||||
)
|
)
|
||||||
|
|
||||||
Add-Type -AssemblyName PresentationFramework
|
|
||||||
|
|
||||||
# Define theme colors
|
|
||||||
$foregroundColor = $sync.configs.themes.$ctttheme.MainForegroundColor
|
|
||||||
$backgroundColor = $sync.configs.themes.$ctttheme.MainBackgroundColor
|
|
||||||
$font = New-Object Windows.Media.FontFamily("Consolas")
|
|
||||||
$borderColor = $sync.configs.themes.$ctttheme.BorderColor # ButtonInstallBackgroundColor
|
|
||||||
$buttonBackgroundColor = $sync.configs.themes.$ctttheme.ButtonInstallBackgroundColor
|
|
||||||
$buttonForegroundColor = $sync.configs.themes.$ctttheme.ButtonInstallForegroundColor
|
|
||||||
$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
|
||||||
$dialog.Title = "About"
|
$dialog.Title = $Title
|
||||||
$dialog.Height = $Height
|
$dialog.Height = $Height
|
||||||
$dialog.Width = $Width
|
$dialog.Width = $Width
|
||||||
$dialog.Margin = New-Object Windows.Thickness(10) # Add margin to the entire dialog box
|
$dialog.Margin = New-Object Windows.Thickness(10) # Add margin to the entire dialog box
|
||||||
$dialog.WindowStyle = [Windows.WindowStyle]::None # Remove title bar and window controls
|
$dialog.WindowStyle = [Windows.WindowStyle]::None # Remove title bar and window controls
|
||||||
$dialog.ResizeMode = [Windows.ResizeMode]::NoResize # Disable resizing
|
$dialog.ResizeMode = [Windows.ResizeMode]::NoResize # Disable resizing
|
||||||
$dialog.WindowStartupLocation = [Windows.WindowStartupLocation]::CenterScreen # Center the window
|
$dialog.WindowStartupLocation = [Windows.WindowStartupLocation]::CenterScreen # Center the window
|
||||||
$dialog.Foreground = $foregroundColor
|
$dialog.Foreground = $ForegroundColor
|
||||||
$dialog.Background = $backgroundColor
|
$dialog.Background = $BackgroundColor
|
||||||
$dialog.FontFamily = $font
|
$dialog.FontFamily = $FontFamily
|
||||||
$dialog.FontSize = $FontSize
|
$dialog.FontSize = $FontSize
|
||||||
|
|
||||||
# Create a Border for the green edge with rounded corners
|
# Create a Border for the green edge with rounded corners
|
||||||
$border = New-Object Windows.Controls.Border
|
$border = New-Object Windows.Controls.Border
|
||||||
$border.BorderBrush = $borderColor
|
$border.BorderBrush = $BorderColor
|
||||||
$border.BorderThickness = New-Object Windows.Thickness(1) # Adjust border thickness as needed
|
$border.BorderThickness = New-Object Windows.Thickness(1) # Adjust border thickness as needed
|
||||||
$border.CornerRadius = New-Object Windows.CornerRadius(10) # Adjust the radius for rounded corners
|
$border.CornerRadius = New-Object Windows.CornerRadius(10) # Adjust the radius for rounded corners
|
||||||
|
|
||||||
@ -89,7 +134,7 @@ function Show-CustomDialog {
|
|||||||
$grid = New-Object Windows.Controls.Grid
|
$grid = New-Object Windows.Controls.Grid
|
||||||
$border.Child = $grid
|
$border.Child = $grid
|
||||||
|
|
||||||
# Add the following line to show gridlines
|
# Uncomment the following line to show gridlines
|
||||||
#$grid.ShowGridLines = $true
|
#$grid.ShowGridLines = $true
|
||||||
|
|
||||||
# Add the following line to set the background color of the grid
|
# Add the following line to set the background color of the grid
|
||||||
@ -102,7 +147,6 @@ function Show-CustomDialog {
|
|||||||
$border.HorizontalAlignment = [Windows.HorizontalAlignment]::Stretch
|
$border.HorizontalAlignment = [Windows.HorizontalAlignment]::Stretch
|
||||||
$border.VerticalAlignment = [Windows.VerticalAlignment]::Stretch
|
$border.VerticalAlignment = [Windows.VerticalAlignment]::Stretch
|
||||||
|
|
||||||
|
|
||||||
# Set up Row Definitions
|
# Set up Row Definitions
|
||||||
$row0 = New-Object Windows.Controls.RowDefinition
|
$row0 = New-Object Windows.Controls.RowDefinition
|
||||||
$row0.Height = [Windows.GridLength]::Auto
|
$row0.Height = [Windows.GridLength]::Auto
|
||||||
@ -128,76 +172,19 @@ function Show-CustomDialog {
|
|||||||
$grid.Children.Add($stackPanel)
|
$grid.Children.Add($stackPanel)
|
||||||
[Windows.Controls.Grid]::SetRow($stackPanel, 0) # Set the row to the second row (0-based index)
|
[Windows.Controls.Grid]::SetRow($stackPanel, 0) # Set the row to the second row (0-based index)
|
||||||
|
|
||||||
$viewbox = New-Object Windows.Controls.Viewbox
|
|
||||||
$viewbox.Width = $IconSize
|
|
||||||
$viewbox.Height = $IconSize
|
|
||||||
|
|
||||||
# Combine the paths into a single string
|
|
||||||
# $cttLogoPath = @"
|
|
||||||
# M174 1094 c-4 -14 -4 -55 -2 -92 3 -57 9 -75 41 -122 41 -60 45 -75 22 -84 -25 -9 -17 -21 30 -44 l45 -22 0 -103 c0 -91 3 -109 26 -155 30 -60 65 -87 204 -157 l95 -48 110 58 c184 96 205 127 205 293 l0 108 45 22 c47 23 55 36 30 46 -22 8 -18 30 9 63 13 16 34 48 46 71 20 37 21 52 15 116 l-6 73 -69 -23 c-38 -12 -137 -59 -220 -103 -82 -45 -160 -81 -171 -81 -12 0 -47 15 -78 34 -85 51 -239 127 -309 151 l-62 22 -6 -23z m500 -689 c20 -8 36 -19 36 -24 0 -18 -53 -51 -80 -51 -28 0 -80 33 -80 51 0 10 55 38 76 39 6 0 28 -7 48 -15z
|
|
||||||
# M177 711 c-19 -88 4 -242 49 -318 43 -74 107 -127 232 -191 176 -90 199 -84 28 7 -169 91 -214 129 -258 220 -29 58 -32 74 -37 190 -4 90 -8 116 -14 92z
|
|
||||||
# M1069 610 c-4 -131 -5 -137 -38 -198 -43 -79 -89 -119 -210 -181 -53 -27 -116 -61 -141 -76 -74 -43 -6 -20 115 40 221 109 296 217 294 425 -1 144 -16 137 -20 -10z
|
|
||||||
# "@
|
|
||||||
$cttLogoPath = @"
|
|
||||||
M 18.00,14.00
|
|
||||||
C 18.00,14.00 45.00,27.74 45.00,27.74
|
|
||||||
45.00,27.74 57.40,34.63 57.40,34.63
|
|
||||||
57.40,34.63 59.00,43.00 59.00,43.00
|
|
||||||
59.00,43.00 59.00,83.00 59.00,83.00
|
|
||||||
55.35,81.66 46.99,77.79 44.72,74.79
|
|
||||||
41.17,70.10 42.01,59.80 42.00,54.00
|
|
||||||
42.00,51.62 42.20,48.29 40.98,46.21
|
|
||||||
38.34,41.74 25.78,38.60 21.28,33.79
|
|
||||||
16.81,29.02 18.00,20.20 18.00,14.00 Z
|
|
||||||
M 107.00,14.00
|
|
||||||
C 109.01,19.06 108.93,30.37 104.66,34.21
|
|
||||||
100.47,37.98 86.38,43.10 84.60,47.21
|
|
||||||
83.94,48.74 84.01,51.32 84.00,53.00
|
|
||||||
83.97,57.04 84.46,68.90 83.26,72.00
|
|
||||||
81.06,77.70 72.54,81.42 67.00,83.00
|
|
||||||
67.00,83.00 67.00,43.00 67.00,43.00
|
|
||||||
67.00,43.00 67.99,35.63 67.99,35.63
|
|
||||||
67.99,35.63 80.00,28.26 80.00,28.26
|
|
||||||
80.00,28.26 107.00,14.00 107.00,14.00 Z
|
|
||||||
M 19.00,46.00
|
|
||||||
C 21.36,47.14 28.67,50.71 30.01,52.63
|
|
||||||
31.17,54.30 30.99,57.04 31.00,59.00
|
|
||||||
31.04,65.41 30.35,72.16 33.56,78.00
|
|
||||||
38.19,86.45 46.10,89.04 54.00,93.31
|
|
||||||
56.55,94.69 60.10,97.20 63.00,97.22
|
|
||||||
65.50,97.24 68.77,95.36 71.00,94.25
|
|
||||||
76.42,91.55 84.51,87.78 88.82,83.68
|
|
||||||
94.56,78.20 95.96,70.59 96.00,63.00
|
|
||||||
96.01,60.24 95.59,54.63 97.02,52.39
|
|
||||||
98.80,49.60 103.95,47.87 107.00,47.00
|
|
||||||
107.00,47.00 107.00,67.00 107.00,67.00
|
|
||||||
106.90,87.69 96.10,93.85 80.00,103.00
|
|
||||||
76.51,104.98 66.66,110.67 63.00,110.52
|
|
||||||
60.33,110.41 55.55,107.53 53.00,106.25
|
|
||||||
46.21,102.83 36.63,98.57 31.04,93.68
|
|
||||||
16.88,81.28 19.00,62.88 19.00,46.00 Z
|
|
||||||
"@
|
|
||||||
|
|
||||||
# Add SVG path
|
|
||||||
$svgPath = New-Object Windows.Shapes.Path
|
|
||||||
$svgPath.Data = [Windows.Media.Geometry]::Parse($cttLogoPath)
|
|
||||||
$svgPath.Fill = $logocolor # Set fill color to white
|
|
||||||
|
|
||||||
# Add SVG path to Viewbox
|
|
||||||
$viewbox.Child = $svgPath
|
|
||||||
|
|
||||||
# Add SVG path to the stack panel
|
# Add SVG path to the stack panel
|
||||||
$stackPanel.Children.Add($viewbox)
|
$stackPanel.Children.Add((Invoke-WinUtilAssets -Type "logo" -Size $LogoSize))
|
||||||
|
|
||||||
# Add "Winutil" text
|
# Add "Winutil" text
|
||||||
$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 = $logocolor
|
$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, 10, 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
|
||||||
$messageTextBlock = New-Object Windows.Controls.TextBlock
|
$messageTextBlock = New-Object Windows.Controls.TextBlock
|
||||||
|
$messageTextBlock.FontSize = $FontSize
|
||||||
$messageTextBlock.TextWrapping = [Windows.TextWrapping]::Wrap # Enable text wrapping
|
$messageTextBlock.TextWrapping = [Windows.TextWrapping]::Wrap # Enable text wrapping
|
||||||
$messageTextBlock.HorizontalAlignment = [Windows.HorizontalAlignment]::Left
|
$messageTextBlock.HorizontalAlignment = [Windows.HorizontalAlignment]::Left
|
||||||
$messageTextBlock.VerticalAlignment = [Windows.VerticalAlignment]::Top
|
$messageTextBlock.VerticalAlignment = [Windows.VerticalAlignment]::Top
|
||||||
@ -220,7 +207,7 @@ $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 = $sync.configs.themes.$ctttheme.LinkForegroundColor
|
$hyperlink.Foreground = $LinkForegroundColor
|
||||||
|
|
||||||
$hyperlink.Add_Click({
|
$hyperlink.Add_Click({
|
||||||
param($sender, $args)
|
param($sender, $args)
|
||||||
@ -228,11 +215,15 @@ $cttLogoPath = @"
|
|||||||
})
|
})
|
||||||
$hyperlink.Add_MouseEnter({
|
$hyperlink.Add_MouseEnter({
|
||||||
param($sender, $args)
|
param($sender, $args)
|
||||||
$sender.Foreground = $sync.configs.themes.$ctttheme.LinkHoverForegroundColor
|
$sender.Foreground = $LinkHoverForegroundColor
|
||||||
|
$sender.FontSize = ($FontSize + ($FontSize / 4))
|
||||||
|
$sender.FontWeight = "SemiBold"
|
||||||
})
|
})
|
||||||
$hyperlink.Add_MouseLeave({
|
$hyperlink.Add_MouseLeave({
|
||||||
param($sender, $args)
|
param($sender, $args)
|
||||||
$sender.Foreground = $sync.configs.themes.$ctttheme.LinkForegroundColor
|
$sender.Foreground = $LinkForegroundColor
|
||||||
|
$sender.FontSize = $FontSize
|
||||||
|
$sender.FontWeight = "Normal"
|
||||||
})
|
})
|
||||||
|
|
||||||
$messageTextBlock.Inlines.Add($hyperlink)
|
$messageTextBlock.Inlines.Add($hyperlink)
|
||||||
@ -276,7 +267,7 @@ $cttLogoPath = @"
|
|||||||
$okButton.Margin = New-Object Windows.Thickness(0, 0, 0, 10)
|
$okButton.Margin = New-Object Windows.Thickness(0, 0, 0, 10)
|
||||||
$okButton.Background = $buttonBackgroundColor
|
$okButton.Background = $buttonBackgroundColor
|
||||||
$okButton.Foreground = $buttonForegroundColor
|
$okButton.Foreground = $buttonForegroundColor
|
||||||
$okButton.BorderBrush = $borderColor
|
$okButton.BorderBrush = $BorderColor
|
||||||
$okButton.Add_Click({
|
$okButton.Add_Click({
|
||||||
$dialog.Close()
|
$dialog.Close()
|
||||||
})
|
})
|
||||||
|
@ -11,7 +11,7 @@ Function Update-WinUtilProgramWinget {
|
|||||||
|
|
||||||
$host.ui.RawUI.WindowTitle = """Winget Install"""
|
$host.ui.RawUI.WindowTitle = """Winget Install"""
|
||||||
|
|
||||||
Start-Transcript $ENV:TEMP\winget-update.log -Append
|
Start-Transcript "$logdir\winget-update_$dateTime.log" -Append
|
||||||
winget upgrade --all --accept-source-agreements --accept-package-agreements --scope=machine --silent
|
winget upgrade --all --accept-source-agreements --accept-package-agreements --scope=machine --silent
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,15 +19,14 @@ function Invoke-WPFButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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}
|
||||||
"WPFInstallUpgrade" {Invoke-WPFInstallUpgrade}
|
"WPFInstallUpgrade" {Invoke-WPFInstallUpgrade}
|
||||||
"WPFstandard" {Invoke-WPFPresets "Standard"}
|
"WPFStandard" {Invoke-WPFPresets "Standard" -checkboxfilterpattern "WPFTweak*"}
|
||||||
"WPFminimal" {Invoke-WPFPresets "Minimal"}
|
"WPFMinimal" {Invoke-WPFPresets "Minimal" -checkboxfilterpattern "WPFTweak*"}
|
||||||
"WPFclear" {Invoke-WPFPresets -preset $null -imported $true}
|
"WPFClearTweaksSelection" {Invoke-WPFPresets -imported $true -checkboxfilterpattern "WPFTweak*"}
|
||||||
"WPFclearWinget" {Invoke-WPFPresets -preset $null -imported $true -CheckBox "WPFInstall"}
|
"WPFClearInstallSelection" {Invoke-WPFPresets -imported $true -checkboxfilterpattern "WPFInstall*"}
|
||||||
"WPFtweaksbutton" {Invoke-WPFtweaksbutton}
|
"WPFtweaksbutton" {Invoke-WPFtweaksbutton}
|
||||||
"WPFOOSUbutton" {Invoke-WPFOOSU}
|
"WPFOOSUbutton" {Invoke-WPFOOSU}
|
||||||
"WPFAddUltPerf" {Invoke-WPFUltimatePerformance -State "Enable"}
|
"WPFAddUltPerf" {Invoke-WPFUltimatePerformance -State "Enable"}
|
||||||
@ -41,9 +40,10 @@ function Invoke-WPFButton {
|
|||||||
"WPFPanelpower" {Invoke-WPFControlPanel -Panel $button}
|
"WPFPanelpower" {Invoke-WPFControlPanel -Panel $button}
|
||||||
"WPFPanelregion" {Invoke-WPFControlPanel -Panel $button}
|
"WPFPanelregion" {Invoke-WPFControlPanel -Panel $button}
|
||||||
"WPFPanelsound" {Invoke-WPFControlPanel -Panel $button}
|
"WPFPanelsound" {Invoke-WPFControlPanel -Panel $button}
|
||||||
|
"WPFPanelprinter" {Invoke-WPFControlPanel -Panel $button}
|
||||||
"WPFPanelsystem" {Invoke-WPFControlPanel -Panel $button}
|
"WPFPanelsystem" {Invoke-WPFControlPanel -Panel $button}
|
||||||
"WPFPaneluser" {Invoke-WPFControlPanel -Panel $button}
|
"WPFPaneluser" {Invoke-WPFControlPanel -Panel $button}
|
||||||
"WPFUpdatesdefault" {Invoke-WPFUpdatesdefault}
|
"WPFUpdatesdefault" {Invoke-WPFFixesUpdate}
|
||||||
"WPFFixesUpdate" {Invoke-WPFFixesUpdate}
|
"WPFFixesUpdate" {Invoke-WPFFixesUpdate}
|
||||||
"WPFFixesWinget" {Invoke-WPFFixesWinget}
|
"WPFFixesWinget" {Invoke-WPFFixesWinget}
|
||||||
"WPFRunAdobeCCCleanerTool" {Invoke-WPFRunAdobeCCCleanerTool}
|
"WPFRunAdobeCCCleanerTool" {Invoke-WPFRunAdobeCCCleanerTool}
|
||||||
@ -53,9 +53,12 @@ function Invoke-WPFButton {
|
|||||||
"WPFWinUtilShortcut" {Invoke-WPFShortcut -ShortcutToAdd "WinUtil" -RunAsAdmin $true}
|
"WPFWinUtilShortcut" {Invoke-WPFShortcut -ShortcutToAdd "WinUtil" -RunAsAdmin $true}
|
||||||
"WPFGetInstalled" {Invoke-WPFGetInstalled -CheckBox "winget"}
|
"WPFGetInstalled" {Invoke-WPFGetInstalled -CheckBox "winget"}
|
||||||
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
|
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
|
||||||
"WPFGetIso" {Invoke-WPFGetIso}
|
"WPFGetIso" {Invoke-MicrowinGetIso}
|
||||||
"WPFMicrowin" {Invoke-WPFMicrowin}
|
"WPFMicrowin" {Invoke-Microwin}
|
||||||
"WPFCloseButton" {Invoke-WPFCloseButton}
|
"WPFCloseButton" {Invoke-WPFCloseButton}
|
||||||
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
|
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
|
||||||
|
"WPFWinUtilInstallPSProfile" {Invoke-WinUtilInstallPSProfile}
|
||||||
|
"WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile}
|
||||||
|
"WPFWinUtilSSHServer" {Invoke-WinUtilSSHServer}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ function Invoke-WPFControlPanel {
|
|||||||
"WPFPanelpower" {cmd /c powercfg.cpl}
|
"WPFPanelpower" {cmd /c powercfg.cpl}
|
||||||
"WPFPanelregion" {cmd /c intl.cpl}
|
"WPFPanelregion" {cmd /c intl.cpl}
|
||||||
"WPFPanelsound" {cmd /c mmsys.cpl}
|
"WPFPanelsound" {cmd /c mmsys.cpl}
|
||||||
|
"WPFPanelprinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
||||||
"WPFPanelsystem" {cmd /c sysdm.cpl}
|
"WPFPanelsystem" {cmd /c sysdm.cpl}
|
||||||
"WPFPaneluser" {cmd /c "control userpasswords2"}
|
"WPFPaneluser" {cmd /c "control userpasswords2"}
|
||||||
}
|
}
|
||||||
|
@ -187,9 +187,9 @@ function Invoke-WPFFixesUpdate {
|
|||||||
# Reset the Security Descriptors on the Windows Update Services
|
# Reset the Security Descriptors on the Windows Update Services
|
||||||
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Resetting the WU Service Security Descriptors..." -PercentComplete 25
|
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Resetting the WU Service Security Descriptors..." -PercentComplete 25
|
||||||
Write-Progress -Id 4 -ParentId 0 -Activity "Resetting the WU Service Security Descriptors" -Status "Resetting the BITS Security Descriptor..." -PercentComplete 0
|
Write-Progress -Id 4 -ParentId 0 -Activity "Resetting the WU Service Security Descriptors" -Status "Resetting the BITS Security Descriptor..." -PercentComplete 0
|
||||||
Start-Process -NoNewWindow -FilePath "sc.exe" -ArgumentList "sdset", "bits", "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
|
Start-Process -NoNewWindow -FilePath "sc.exe" -ArgumentList "sdset", "bits", "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)" -Wait
|
||||||
Write-Progress -Id 4 -ParentId 0 -Activity "Resetting the WU Service Security Descriptors" -Status "Resetting the wuauserv Security Descriptor..." -PercentComplete 50
|
Write-Progress -Id 4 -ParentId 0 -Activity "Resetting the WU Service Security Descriptors" -Status "Resetting the wuauserv Security Descriptor..." -PercentComplete 50
|
||||||
Start-Process -NoNewWindow -FilePath "sc.exe" -ArgumentList "sdset", "wuauserv", "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
|
Start-Process -NoNewWindow -FilePath "sc.exe" -ArgumentList "sdset", "wuauserv", "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)" -Wait
|
||||||
Write-Progress -Id 4 -ParentId 0 -Activity "Resetting the WU Service Security Descriptors" -Status "Completed" -PercentComplete 100
|
Write-Progress -Id 4 -ParentId 0 -Activity "Resetting the WU Service Security Descriptors" -Status "Completed" -PercentComplete 100
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,19 +221,53 @@ function Invoke-WPFFixesUpdate {
|
|||||||
if (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate") {
|
if (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate") {
|
||||||
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Removing WSUS client settings..." -PercentComplete 60
|
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Removing WSUS client settings..." -PercentComplete 60
|
||||||
Write-Progress -Id 6 -ParentId 0 -Activity "Removing WSUS client settings" -PercentComplete 0
|
Write-Progress -Id 6 -ParentId 0 -Activity "Removing WSUS client settings" -PercentComplete 0
|
||||||
Start-Process -NoNewWindow -FilePath "REG" -ArgumentList "DELETE", "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate", "/v", "AccountDomainSid", "/f" -RedirectStandardError $true
|
Start-Process -NoNewWindow -FilePath "REG" -ArgumentList "DELETE", "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate", "/v", "AccountDomainSid", "/f" -RedirectStandardError "NUL"
|
||||||
Start-Process -NoNewWindow -FilePath "REG" -ArgumentList "DELETE", "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate", "/v", "PingID", "/f" -RedirectStandardError $true
|
Start-Process -NoNewWindow -FilePath "REG" -ArgumentList "DELETE", "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate", "/v", "PingID", "/f" -RedirectStandardError "NUL"
|
||||||
Start-Process -NoNewWindow -FilePath "REG" -ArgumentList "DELETE", "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate", "/v", "SusClientId", "/f" -RedirectStandardError $true
|
Start-Process -NoNewWindow -FilePath "REG" -ArgumentList "DELETE", "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate", "/v", "SusClientId", "/f" -RedirectStandardError "NUL"
|
||||||
Write-Progress -Id 6 -ParentId 0 -Activity "Removing WSUS client settings" -Status "Completed" -PercentComplete 100
|
Write-Progress -Id 6 -ParentId 0 -Activity "Removing WSUS client settings" -Status "Completed" -PercentComplete 100
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Remove Group Policy Windows Update settings
|
||||||
|
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Removing Group Policy Windows Update settings..." -PercentComplete 60
|
||||||
|
Write-Progress -Id 7 -ParentId 0 -Activity "Removing Group Policy Windows Update settings" -PercentComplete 0
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -ErrorAction SilentlyContinue
|
||||||
|
Write-Host "Defaulting driver offering through Windows Update..."
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -ErrorAction SilentlyContinue
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -ErrorAction SilentlyContinue
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -ErrorAction SilentlyContinue
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -ErrorAction SilentlyContinue
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -ErrorAction SilentlyContinue
|
||||||
|
Write-Host "Defaulting Windows Update automatic restart..."
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -ErrorAction SilentlyContinue
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -ErrorAction SilentlyContinue
|
||||||
|
Write-Host "Clearing ANY Windows Update Policy settings..."
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "BranchReadinessLevel" -ErrorAction SilentlyContinue
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferFeatureUpdatesPeriodInDays" -ErrorAction SilentlyContinue
|
||||||
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferQualityUpdatesPeriodInDays" -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKCU:\Software\Microsoft\WindowsSelfHost" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKCU:\Software\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\Microsoft\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\Microsoft\WindowsSelfHost" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Start-Process -NoNewWindow -FilePath "secedit" -ArgumentList "/configure", "/cfg", "$env:windir\inf\defltbase.inf", "/db", "defltbase.sdb", "/verbose" -Wait
|
||||||
|
Start-Process -NoNewWindow -FilePath "cmd.exe" -ArgumentList "/c RD /S /Q $env:WinDir\System32\GroupPolicyUsers" -Wait
|
||||||
|
Start-Process -NoNewWindow -FilePath "cmd.exe" -ArgumentList "/c RD /S /Q $env:WinDir\System32\GroupPolicy" -Wait
|
||||||
|
Start-Process -NoNewWindow -FilePath "gpupdate" -ArgumentList "/force" -Wait
|
||||||
|
Write-Progress -Id 7 -ParentId 0 -Activity "Removing Group Policy Windows Update settings" -Status "Completed" -PercentComplete 100
|
||||||
|
|
||||||
|
|
||||||
# Reset WinSock
|
# Reset WinSock
|
||||||
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Resetting WinSock..." -PercentComplete 65
|
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Resetting WinSock..." -PercentComplete 65
|
||||||
Write-Progress -Id 7 -ParentId 0 -Activity "Resetting WinSock" -Status "Resetting WinSock..." -PercentComplete 0
|
Write-Progress -Id 7 -ParentId 0 -Activity "Resetting WinSock" -Status "Resetting WinSock..." -PercentComplete 0
|
||||||
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winsock", "reset" -RedirectStandardOutput $true
|
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winsock", "reset"
|
||||||
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winhttp", "reset", "proxy" -RedirectStandardOutput $true
|
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winhttp", "reset", "proxy"
|
||||||
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "int", "ip", "reset" -RedirectStandardOutput $true
|
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "int", "ip", "reset"
|
||||||
Write-Progress -Id 7 -ParentId 0 -Activity "Resetting WinSock" -Status "Completed" -PercentComplete 100
|
Write-Progress -Id 7 -ParentId 0 -Activity "Resetting WinSock" -Status "Completed" -PercentComplete 100
|
||||||
|
|
||||||
|
|
||||||
@ -262,7 +296,11 @@ function Invoke-WPFFixesUpdate {
|
|||||||
# Force Windows Update to check for updates
|
# Force Windows Update to check for updates
|
||||||
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Forcing discovery..." -PercentComplete 95
|
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Forcing discovery..." -PercentComplete 95
|
||||||
Write-Progress -Id 10 -ParentId 0 -Activity "Forcing discovery" -Status "Forcing discovery..." -PercentComplete 0
|
Write-Progress -Id 10 -ParentId 0 -Activity "Forcing discovery" -Status "Forcing discovery..." -PercentComplete 0
|
||||||
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
|
try {
|
||||||
|
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
|
||||||
|
} catch {
|
||||||
|
Write-Warning "Failed to create Windows Update COM object: $_"
|
||||||
|
}
|
||||||
Start-Process -NoNewWindow -FilePath "wuauclt" -ArgumentList "/resetauthorization", "/detectnow"
|
Start-Process -NoNewWindow -FilePath "wuauclt" -ArgumentList "/resetauthorization", "/detectnow"
|
||||||
Write-Progress -Id 10 -ParentId 0 -Activity "Forcing discovery" -Status "Completed" -PercentComplete 100
|
Write-Progress -Id 10 -ParentId 0 -Activity "Forcing discovery" -Status "Completed" -PercentComplete 100
|
||||||
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Completed" -PercentComplete 100
|
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Completed" -PercentComplete 100
|
||||||
@ -284,7 +322,7 @@ function Invoke-WPFFixesUpdate {
|
|||||||
Write-Progress -Id 3 -Activity "Renaming/Removing Files" -Completed
|
Write-Progress -Id 3 -Activity "Renaming/Removing Files" -Completed
|
||||||
Write-Progress -Id 4 -Activity "Resetting the WU Service Security Descriptors" -Completed
|
Write-Progress -Id 4 -Activity "Resetting the WU Service Security Descriptors" -Completed
|
||||||
Write-Progress -Id 5 -Activity "Reregistering DLLs" -Completed
|
Write-Progress -Id 5 -Activity "Reregistering DLLs" -Completed
|
||||||
Write-Progress -Id 6 -Activity "Removing WSUS client settings" -Completed
|
Write-Progress -Id 6 -Activity "Removing Group Policy Windows Update settings" -Completed
|
||||||
Write-Progress -Id 7 -Activity "Resetting WinSock" -Completed
|
Write-Progress -Id 7 -Activity "Resetting WinSock" -Completed
|
||||||
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
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
function Invoke-WPFGetInstalled {
|
function Invoke-WPFGetInstalled {
|
||||||
<#
|
<#
|
||||||
|
TODO: Add the Option to use Chocolatey as Engine
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Invokes the function that gets the checkboxes to check in a new runspace
|
Invokes the function that gets the checkboxes to check in a new runspace
|
||||||
|
|
||||||
@ -16,12 +16,12 @@ function Invoke-WPFGetInstalled {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if(((Test-WinUtilPackageManager -winget) -eq "not-installed") -and $checkbox -eq "winget") {
|
if(($sync.WPFpreferChocolatey.IsChecked -eq $false) -and ((Test-WinUtilPackageManager -winget) -eq "not-installed") -and $checkbox -eq "winget") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
$preferChoco = $sync.WPFpreferChocolatey.IsChecked
|
||||||
Invoke-WPFRunspace -ArgumentList $checkbox -DebugPreference $DebugPreference -ScriptBlock {
|
Invoke-WPFRunspace -ArgumentList $checkbox, $preferChoco -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
param($checkbox, $DebugPreference)
|
param($checkbox, $preferChoco, $DebugPreference)
|
||||||
|
|
||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" })
|
||||||
@ -32,8 +32,12 @@ function Invoke-WPFGetInstalled {
|
|||||||
if($checkbox -eq "tweaks") {
|
if($checkbox -eq "tweaks") {
|
||||||
Write-Host "Getting Installed Tweaks..."
|
Write-Host "Getting Installed Tweaks..."
|
||||||
}
|
}
|
||||||
|
if ($preferChoco -and $checkbox -eq "winget") {
|
||||||
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox
|
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox "choco"
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox
|
||||||
|
}
|
||||||
|
|
||||||
$sync.form.Dispatcher.invoke({
|
$sync.form.Dispatcher.invoke({
|
||||||
foreach($checkbox in $Checkboxes) {
|
foreach($checkbox in $Checkboxes) {
|
||||||
|
@ -19,42 +19,59 @@ function Invoke-WPFImpex {
|
|||||||
$Config = $null
|
$Config = $null
|
||||||
)
|
)
|
||||||
|
|
||||||
if ($type -eq "export") {
|
function ConfigDialog {
|
||||||
$FileBrowser = New-Object System.Windows.Forms.SaveFileDialog
|
if (!$Config) {
|
||||||
}
|
switch ($type) {
|
||||||
if ($type -eq "import") {
|
"export" { $FileBrowser = New-Object System.Windows.Forms.SaveFileDialog }
|
||||||
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog
|
"import" { $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog }
|
||||||
}
|
}
|
||||||
|
$FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop')
|
||||||
|
$FileBrowser.Filter = "JSON Files (*.json)|*.json"
|
||||||
|
$FileBrowser.ShowDialog() | Out-Null
|
||||||
|
|
||||||
if (-not $Config) {
|
if ($FileBrowser.FileName -eq "") {
|
||||||
$FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop')
|
return $null
|
||||||
$FileBrowser.Filter = "JSON Files (*.json)|*.json"
|
} else {
|
||||||
$FileBrowser.ShowDialog() | Out-Null
|
return $FileBrowser.FileName
|
||||||
|
}
|
||||||
if($FileBrowser.FileName -eq "") {
|
|
||||||
return
|
|
||||||
} else {
|
} else {
|
||||||
$Config = $FileBrowser.FileName
|
return $Config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($type -eq "export") {
|
switch ($type) {
|
||||||
$jsonFile = Get-WinUtilCheckBoxes -unCheck $false
|
"export" {
|
||||||
$jsonFile | ConvertTo-Json | Out-File $FileBrowser.FileName -Force
|
try {
|
||||||
}
|
$Config = ConfigDialog
|
||||||
if ($type -eq "import") {
|
if ($Config) {
|
||||||
$jsonFile = Get-Content $Config | ConvertFrom-Json
|
$jsonFile = Get-WinUtilCheckBoxes -unCheck $false | ConvertTo-Json
|
||||||
|
$jsonFile | Out-File $Config -Force
|
||||||
$flattenedJson = @()
|
"iex ""& { `$(irm christitus.com/win) } -Config '$Config'""" | Set-Clipboard
|
||||||
$jsonFile.PSObject.Properties | ForEach-Object {
|
|
||||||
$category = $_.Name
|
|
||||||
foreach ($checkboxName in $_.Value) {
|
|
||||||
if ($category -ne "Install") {
|
|
||||||
$flattenedJson += $checkboxName
|
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Error "An error occurred while exporting: $_"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"import" {
|
||||||
|
try {
|
||||||
|
$Config = ConfigDialog
|
||||||
|
if ($Config) {
|
||||||
|
try {
|
||||||
|
if ($Config -match '^https?://') {
|
||||||
|
$jsonFile = (Invoke-WebRequest "$Config").Content | ConvertFrom-Json
|
||||||
|
} else {
|
||||||
|
$jsonFile = Get-Content $Config | ConvertFrom-Json
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Error "Failed to load the JSON file from the specified path or URL: $_"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
$flattenedJson = $jsonFile.PSObject.Properties.Where({ $_.Name -ne "Install" }).ForEach({ $_.Value })
|
||||||
|
Invoke-WPFPresets -preset $flattenedJson -imported $true
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Error "An error occurred while importing: $_"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Invoke-WPFPresets -preset $flattenedJson -imported $true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,10 +19,9 @@ function Invoke-WPFInstall {
|
|||||||
[System.Windows.MessageBox]::Show($WarningMsg, $AppTitle, [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($WarningMsg, $AppTitle, [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
$ChocoPreference = $($sync.WPFpreferChocolatey.IsChecked)
|
||||||
|
$installHandle = Invoke-WPFRunspace -ParameterList @(("PackagesToInstall", $PackagesToInstall),("ChocoPreference", $ChocoPreference)) -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
|
param($PackagesToInstall, $ChocoPreference, $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 {
|
||||||
@ -30,17 +29,29 @@ function Invoke-WPFInstall {
|
|||||||
}
|
}
|
||||||
$packagesWinget, $packagesChoco = {
|
$packagesWinget, $packagesChoco = {
|
||||||
$packagesWinget = [System.Collections.ArrayList]::new()
|
$packagesWinget = [System.Collections.ArrayList]::new()
|
||||||
$packagesChoco = [System.Collections.Generic.List`1[System.Object]]::new()
|
$packagesChoco = [System.Collections.ArrayList]::new()
|
||||||
foreach ($package in $PackagesToInstall) {
|
|
||||||
|
foreach ($package in $PackagesToInstall) {
|
||||||
|
if ($ChocoPreference) {
|
||||||
|
if ($package.choco -eq "na") {
|
||||||
|
$packagesWinget.add($package.winget)
|
||||||
|
Write-Host "Queueing $($package.winget) for Winget install"
|
||||||
|
} else {
|
||||||
|
$null = $packagesChoco.add($package.choco)
|
||||||
|
Write-Host "Queueing $($package.choco) for Chocolatey install"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
if ($package.winget -eq "na") {
|
if ($package.winget -eq "na") {
|
||||||
$packagesChoco.add($package)
|
$packagesChoco.add($package.choco)
|
||||||
Write-Host "Queueing $($package.choco) for Chocolatey install"
|
Write-Host "Queueing $($package.choco) for Chocolatey install"
|
||||||
} else {
|
} else {
|
||||||
$null = $packagesWinget.add($($package.winget))
|
$null = $packagesWinget.add($($package.winget))
|
||||||
Write-Host "Queueing $($package.winget) for Winget install"
|
Write-Host "Queueing $($package.winget) for Winget install"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $packagesWinget, $packagesChoco
|
}
|
||||||
|
return $packagesWinget, $packagesChoco
|
||||||
}.Invoke($PackagesToInstall)
|
}.Invoke($PackagesToInstall)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -48,12 +59,12 @@ function Invoke-WPFInstall {
|
|||||||
$errorPackages = @()
|
$errorPackages = @()
|
||||||
if($packagesWinget.Count -gt 0) {
|
if($packagesWinget.Count -gt 0) {
|
||||||
Install-WinUtilWinget
|
Install-WinUtilWinget
|
||||||
$errorPackages += Invoke-WinUtilWingetProgram -Action Install -Programs $packagesWinget
|
Install-WinUtilProgramWinget -Action Install -Programs $packagesWinget
|
||||||
$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 -Action Install -Programs $packagesChoco
|
||||||
}
|
}
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
Write-Host "-- Installs have finished ---"
|
Write-Host "-- Installs have finished ---"
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user