The logic was expecting major version in Windows 11 to be 11. However,
in Windows 11, major version is not changed and it is till 10. This
commit corrects logic to check build number that's guaranteed to be
higher in Windows 11.
Remove using Webpack import syntax such as: `js-yaml-loader!@/..`. It's
a non-standard syntax that couples the code to Webpack.
Configure instead by specifying Webpack loader in Vue configuration
file.
Enable related ESLint rules.
Remove unused dependency `raw-loader` and refactor
`NoUnintendedInlining` test to load files using file system (dropping
webpack dependency).
Refactor to use `import type` for type imports to show the indent
clearly and satisfy failing ESLint rules.
- Fix revert logic deleting the service instead of enabling it.
- Use unified "DisableService" function to improve enable/disable logic.
- Separate disabling of service from opting out.
- Add documentation reference.
Rename service to its newer name. Mention breaking behavior in its name
and add more documentation.
Unrecommended from "Standard" pool because it breaks a lot of
functionality, but still recomended in "Stricts" because it's used to
identify personal information that leads to less privacy.
Major refactoring using ESLint with rules from AirBnb and Vue.
Enable most of the ESLint rules and do necessary linting in the code.
Also add more information for rules that are disabled to describe what
they are and why they are disabled.
Allow logging (`console.log`) in test files, and in development mode
(e.g. when working with `npm run serve`), but disable it when
environment is production (as pre-configured by Vue). Also add flag
(`--mode production`) in `lint:eslint` command so production linting is
executed earlier in lifecycle.
Disable rules that requires a separate work. Such as ESLint rules that
are broken in TypeScript: no-useless-constructor (eslint/eslint#14118)
and no-shadow (eslint/eslint#13014).
Removing Cloud Experience Host has caused many unexpected issues
for users (see #99, #64, #67). It's now excluded from "Strict"
recommendation pool until a better warning mechanism is implemented.
- Add more script documentation in code and reference URLs.
- Unrecommend as "Standard" recommend as "Strict" due to lack of
documentation for its privacy intrusive behavior.
- Add mising WpnUserService for disabling it completely.
- Improve error messages with cause of the problem and suggested solution.
- Document:
* Disabling `WinDefend` breaks `Set-MpPreference` and Microsoft Store
(as reported in #104).
* Document services that `netsh advfirewall` depends on.
- Fix some bad whitespace character in documentation.
Refactor, unify and improve the logic to to start/stop and
enable/disable services, and also add more documentation.
Rework functions:
- Unify way of disabling Windows services using templating.
- Capitalize as `startupMode` (where startup is single word) everywhere.
- Use also text parameters (automatic, manual..) instead of numeric
values (2,3...) when providing parameters to any service disable
function.
Improve documentation:
- Add reference URLs about disabled services.
- Add more code documentation for querying status and allowed values.
Logic improvements include:
- Check if service is running before stopping/starting the service.
- Do not start the service it's not an Automatic service.
- Check whether service is already disabled.
- When reverting, start the service if it has Automatic startup. But
do not start the service it has different startup (e.g. manual).
Also starts the service even though start up is configured as
desired (before it quit before doing service start).
Improve outputs (logs):
- Remove false-positive error messages.
- When a service cannot be stopped/start; mention in output that the
service will be started/stopped after reboot.
- Show success message once service is enabled/disabled.
- Fix reboot messages when enabling/disabling services,
- Do not write stderr if service cannot be stopped/started as it's not
not the main goal of the function.
Add missing revert code for the ones missing them:
- Disable diagnostics telemetry
- Disable Windows Media Player Network Sharing Service
> Function: DisableServiceInRegistry
- Fix not exitting if service does not exist when reverting
- Show success message once service is enabled/disabled
- Fix double "Enabled.." messages
- Fix unintended registry addition
> Function: DisablePerUserService
- Change implementation to call DisableServiceInRegistry.
- Fix both services are skipped if one of them fails.
- Fix reverting a service sets wrong startup mode.
German edition of Windows returns German output for `schtasks.exe`
commands. So checking for "Running" fails immediately as reported #104.
Revert recent change from using `Get-ScheduledTask` and
`Unregister-ScheduledTask` to `schtasks.exe`. Also remove unused
`$powershellFile` variable.
- Fix reverting "Disable SQM OS key".
- Fix applying "Disable Visual Studio Code data collection" scripts.
- Fix reverting "Do not show recently used files in Quick Access".
- Add unit tests for automatically checking similar issues in future.
- Refactor to use `Set-MpPreference` in a function instead.
- Better support for both Windows and Windows 11 with platform-specific
logic, due to poor `Remove-MpPreference` used in Windows 10:
* Use `Remove-MpPreference` on Windows 11, but switch to
`Set-MpPreference` for some edge cases using a flag.
* Use `Set-MpPreference` on Windows 10 by default, and use
`Remove-MpPreference` for only small amount of cases where it is
supported.
- Set default value instead of `Remove-MpPreference` on Windows 10 when
it does not work as expected.
- Improve error messages when:
* Command name (cmdlet) is not supported
* Command parameter is not support
* Failing due to Defender service not working
* Argument is not supported (e.g. for 'Broad')
- Skip if a parameter or argument is not supported instead of failing.
- Set OS defaults when using `Set-MpPreference` when `Remove-MpPreference`
does not set the OS defaults.
- Skip setting the setting if it already is as desired.
- Remove redundant scripts in "Disable remediation actions" setting
`LowThreatDefaultAction`, `ModerateThreatDefaultAction`,
`HighThreatDefaultAction` and `SevereThreatDefaultAction`. As they are
all controlled by and limited to value of `UnknownThreatDefaultAction`.
- Fix registry policies not matching cmdlet behavior:
> CheckForSignaturesBeforeRunningScan
> SignatureUpdateCatchupInterval
- Fix reverting registry policies (`reg delete` command and error
output):
> Disable Malicious Software Reporting tool diagnostic data
> Turn off block at first sight
- Fix DisableCatchupQuickScan MpPreference command being in wrong
category by moving it to its right category and adding its correct
equivalent.
Change behavior of registry reverting from adding default value to
removing value that overrides. It then leaves the system in cleaner
state, removes "managed by your organization" warning, and makes the
scripts more future-proof providing compatibility with Microsoft patches
updating the defaults. This is implemented by using `reg delete` over
`reg add` and `Remove-MpPreference` over `Set-MpPreference`.
> Disable Windows Defender Scheduled Scan task
Surpress the error when reverting the script as the task may not exist
in some Windows versions.
> Limit catch-up security intelligence (signature) updates
Change to "Disable" instead of "Limit", and bring back its revert code.
Fix reverting of following scripts setting non-default values:
> Turn off Windows Defender SpyNet reporting
> Disable checking for signatures before scan
> Limit CPU usage during idle scans to minumum
> Disable scanning when not idle
> Disable scanning on mapped network drives on full-scan
Fix following scripts setting unexpected behavior:
> Disable running scheduled auto-remediation
> Limit CPU usage during idle scans to minumum
> Disable randomizing scheduled task times
> Disable creating system restore point on a daily basis
Add more documentation for MpPreference module:
- Add more reference URLs
- Add status query as documentation
- Add information regarding default values
- Describe meaning of enumeration values
- Document commands not doing expected in Windows 11
- Fix errors (stderr stream) not being logged.
- Use `schtasks /delete` instead of `Unregister-ScheduledTask` as
PowerShell command sometimes fail for existing tasks.
- Refactor to use `-TaskName` to explicit describe parameter, and use
linebreaks for `Register-ScheduledTask` call with many parameters.
Change all GitHub URLs with forks so they survive if their maintainer
decides to remove them.
Fix dead URLs in:
- "Windows Push Notification Service" (#101)
- "Limit CPU usage during scans to minimum"
- "Disable NVIDIA telemetry"
The main goal is to highlight and exclude scripts that clears user data
(such as Chrome bookmarks) from standard recommendation, thus allowing
more granular and intentional user selection. Because scripts that are
recommended as "standard" should be non-breaking.
Standard: Recommend only clearing data that would not be noticable by
user. E.g. caches and logs.
Strict : Recommend clearing data that may be noticable by user, but
does not affect stored consciously data by user. E.g. cookies.
Do not recommend if data is stored consciously by user. E.g. favorites
/ bookmarks.
[General]
- Change wording from "Clear xx traces" to "Clean xx history" to make
it more clear and unify the naming with macOS scripts.
- More documentation both in code and both as more references.
[Chrome]
- Unrecommend deleting Chrome user profile.
- Document what each chrome clean-up script is doing in more detail.
[Internet Explorer]
- Document IE scripts better.
- For Cookie cleanup, add solutions for later Windows version.
- Unrecommend some from standard.
- Remove undocumented `Local Settings\Traces` folder.
- Take ownership before deleting Temporary Internet Files. Fixes
permission error.
- Remove `INetCookies\PrivacIE` script because it's undocumented and
we already have cleanup for its parent folder (`INetCookies`).
- Remove "%USERPROFILE%\Local Settings\Traces" due to lack of
documentation.
[Safari]
- Remove cleanup for undocumented traces folders `Safari\Traces`.
- Document with subcategories and references.
- Fix clearing all data not pointing to `localappdata`.
- Unrecomend clearing all data.
[Opera]
- Rename to "Clear all.." to show intent.
- Unrecommend as it removes everything.
Suppress errors:
- when deleting registry keys because the condition where key does
not exist is not really an error,
- when disabling a task that does not exist because absence of a task
when trying to disable it is still a positive condition for goal to
get rid of it,
- when stopping or starting a service because goal is to
disable/enable the service.
> Turn off SmartScreen App Install Control feature
- Add missing `/f` flag
> Remove "Scan with Windows Defender" option from context menu
- Add missing `/f` flag
- Remove redundant delete line in revert code
- Add missing whitespace before `/v` flag
- Instead of deleting with `/v ""`, use `/va` for explicit indent
> Disable Malicious Software Reporting tool diagnostic data
- Fix typo in revert scripts
> Turn off tamper protection
> Restrict threat history to administrators
Fix permission errors using TrustedInstaller session
> `Set-MpPreference` scripts
- Show warning when Set-MpPreference parameter is missing instead of an
error The reasons include:
- If the parameter is missing, functionality may be missing i.e.
there's nothing to disable
- In most cases different way of disabling registry is provided
- Error is not clear and too verbose and should be implemented in a
better way
- Add back "Limiting Defender definition updates" script due to being
able to handle if aparameter is missing
- Add documentation for command in its script
> Disable the Potentially Unwanted Application (PUA) feature
- Fix revert code disabling another functionality
> Disable bidirectional scanning of incoming
- Fix typo
> Disable Microsoft Defender Antivirus
- Correct wrong comment regarding deprecation
> Disable Windows Defender Security Center Service
- Fix disabling not working on Windows 11
Add new ways to disable Defender on Windows:
1. Disable through renaming required files
2. Disable using registry changes
3. Disable using TrustedInstaller user
Add support for running code as TrustedInstaller 🥳. It allows running
commands in OS-protected areas. It is written in PowerShell and it uses
PowerShell syntax like backticks that are inlined in special way. So the
commit extends inlining support and allows writing PowerShell using:
- Comments
- Here-strings
- Backticks
Add disabling of more Defender service
Improve documentation and categorization of services.
- Moves security improvements to its own action.
- Add more scripts and documentation for security improvements
- Move "Disable Spotlight indexing" out of wrong firewall category
- Add more documentation
Adds more scripts to:
- disable Windows Defender functions,
- remove it from the user interface,
- clean its scan history.
Improves the documentation:
- Adds more documentation reference URLs.
- Restructures scripts in a way to better document their behavior. All
Defender scripts are now under "Disable Windows Defender" and
"Privacy over security".
Changes recommendations, and simply recommends less:
- Defender cloud configurations are now only documented on "Strict"
mode.
- Watson event sending with "DisableGenericReports" is disabled due to
lack of documentation and depreciation.
This commit renames "smart screen" to "SmartScreen" which is the
official name from Microsoft.
It categorizes scripts to document the behavior in a more clear way. It
adds structured depth. It moves all SmartScreen scripts under Defender,
as it's now part of Defender offering since latest branding.
In addition, the commit adds more documentation and more scripts such as
disabling SmartScreen for Edge.
It allow pipes to be used in nested functions. Before, pipes were added
to a variable before variable content was evaluated/compiled by
another function. This commit ensures that the commits are evaluted in
expected order.
The issue is solved by stopping precompiling functions. It makes code
less complex. It adds to compile time of the script file but nothing
noticable and something optimizable.
The problem was that the call trees we're not executed in expected
order. E.g. let's say we have functionA that outputs something like
"Hello {{ $name| pipe }}", and we have function B calling with "name:
dear {{ $firstName}}", and at last we have a script that's calling
function B with "firstName: undergroundwires". Before, expressions were
evaluated directly, meaning that function A would become:
"Hello Dear {{ $firstName}}", as you see the pipe in function A
is lost here after being applied to function B and not reaching
$firstTime input value. Parsing expressions in the end allows for pipes
etc. to not get lost.
The commit also does necessary name refactorings and folder refactorings
to reflect logical changes. `FunctionCompiler` is renamed to
`SharedFunctionsParser` as precompiling is removed and it just simply
parses now. `/FunctionCall/` is moved to `/Function/Call`.
Finally, it improves documentation and adds more tests.
Some services in Windows have random characters appended to them. This
commit fixes the scripts that has been trying to disable them but
failing in newer Windows versions where they become per-user.
This commit introduces two pipes: `inlinePowerShell`,
`escapeDoubleQuotes`. The types when used together allows writing adding
clean and real PowerShell scripts as they are (without inlinining or
escaping them), removing the need to have hard-coded inlining/escaping.
It enables writing better PowerShell, makes it easier to maintain and
extend PowerShell scripts. Also allows writing more stable code with
less "unseen" bugs due to manual escaping/inlining. This commit
naturally reveals and fixes double quotes not being escaped in "Empty
trash bin" script.
This is solved by unifying the use of RunPowerShell function by all
scripts using PowerShell. The function inlines and escapes the scripts
as compile time to be send them to PowerShell.exe as an argument and
then invokes PowerShell.exe with generated ugly code.
Allows optionally rendering content if an argument is given. The
expression is designed to be used with `optional` parameters.
Goal is to allow using `RunPowerShell` function on every function that
consists of PowerShell code. Before this commit, they were all required
to provide revertCode, or none of them could be able to have it. It
would not work because some scripts can be reverted, meanwhile some are
one-way scripts that cannot be reverted (such as cleaning scripts). In
this case a way to optionally render revertCode was required. `with`
expression give each callee script ability to turn off `revertCode` if
not needed, therefore enables using `RunPowerShell` everywhere.
This commit also improves error message for script code for better
debugging and refactors parser tests for more code reuse. It also adds
more tests to parameter substitution, and renames some tests of both
expressions for consistency.
This commit allows for parameters that does not require any arguments to
be provided in function calls. It changes collection syntax where
parameters are list of objects instead of primitive strings. A
parameter has now 'name' and 'optional' properties. 'name' is required
and used in same way as older strings as parameter definitions.
'Optional' property is optional, 'false' is the default behavior if
undefined. It also adds additional validation to restrict parameter
names to alphanumeric strings to have a clear syntax in expressions.
It fixes x64 / x86 conditions in "Do not show recently used files in Quick Access" script. Wow6432Node only exists in x64 systems for x86 application data which is also consumed by explorer.exe. So it should only be edited in x64 systems. The rest of the registry settings ("ShowRecent" and default "DelegateFolders") applies to both x64 and x86 systems.
This commit:
- Fixes broken URLs using archive.org or other references.
- Replaces tenforums.com URLs with better documentation as they tend to return HTTP status code 403 to tests and also are low quality source.
- Changes all insecure http sources to https alternatives
- Adds integration tests to check for broken URLs
- There's logic implemented for having a delay inbetween when sending requests to same domains, however it's not used as the sources can respond to totally parallelized requests.
- Run test pipeline weekly to get notified about broken URls without commits
Alias would remove unnecessary repetitions and less relative paths make changes easier when moving around files. This commit cleans also up some relative paths ('../../../') by using the alias and orders imports. It updates both path alias in tsconfig and module alias in Vue CLI's bundler (vuejs/vue-cli#2398).