mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-24 11:55:31 +00:00
Fix Unit Tests and Official Releases (#1854)
* Update Unit Tests * Update pester from 4 to 5 * Update compile and releases * Working on making release tags * Update release.yaml * Compile Winutil --------- Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
This commit is contained in:
parent
88a622c368
commit
9eceae6751
36
.github/workflows/release.yaml
vendored
36
.github/workflows/release.yaml
vendored
@ -10,12 +10,42 @@ jobs:
|
||||
build-runspace:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Create local changes
|
||||
shell: pwsh
|
||||
run: |
|
||||
powershell.exe -f Compile.ps1
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4.16.0
|
||||
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
|
||||
./Compile.ps1
|
||||
continue-on-error: true
|
||||
- name: Check for failure in the previous step
|
||||
if: failure()
|
||||
run: |
|
||||
echo "Compile.ps1 failed to execute properly."
|
||||
exit 1
|
||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: Compile Winutil
|
||||
if: success()
|
||||
|
||||
create-release:
|
||||
needs: build-runspace
|
||||
runs-on: windows-latest
|
||||
if: github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Get current date (PowerShell)
|
||||
id: date
|
||||
run: echo "CURRENT_DATE=$(powershell (Get-Date -Format 'yyyy-MM-dd').ToString())" >> $GITHUB_ENV
|
||||
- name: Create Release and Upload Asset
|
||||
id: create_release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ env.CURRENT_DATE }}
|
||||
name: Release ${{ env.CURRENT_DATE }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: ./winutil.ps1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2
.github/workflows/unittests.yaml
vendored
2
.github/workflows/unittests.yaml
vendored
@ -33,7 +33,7 @@ jobs:
|
||||
- name: Run Pester tests
|
||||
run: |
|
||||
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
|
||||
Invoke-Pester -Path 'pester/*.Tests.ps1' -EnableExit
|
||||
Invoke-Pester -Path 'pester/*.Tests.ps1' -Output Detailed
|
||||
|
||||
shell: pwsh
|
||||
env:
|
||||
|
@ -1,43 +1,54 @@
|
||||
#===========================================================================
|
||||
# Tests - Functions
|
||||
#===========================================================================
|
||||
Describe "Comprehensive Checks for PS1 Files in Functions Folder" {
|
||||
BeforeAll {
|
||||
# Get all .ps1 files in the functions folder
|
||||
$ps1Files = Get-ChildItem -Path ./functions -Filter *.ps1 -Recurse
|
||||
}
|
||||
|
||||
# Get all .ps1 files in the functions folder
|
||||
$ps1Files = Get-ChildItem -Path ./functions -Filter *.ps1
|
||||
foreach ($file in $ps1Files) {
|
||||
Context "Checking $($file.Name)" {
|
||||
It "Should import without errors" {
|
||||
{ . $file.FullName } | Should -Not -Throw
|
||||
}
|
||||
|
||||
# Loop through each file
|
||||
foreach ($file in $ps1Files) {
|
||||
# Define the test name
|
||||
$testName = "Syntax check for $($file.Name)"
|
||||
It "Should have no syntax errors" {
|
||||
$syntaxErrors = $null
|
||||
$null = [System.Management.Automation.PSParser]::Tokenize((Get-Content -Path $file.FullName -Raw), [ref]$syntaxErrors)
|
||||
$syntaxErrors.Count | Should -Be 0
|
||||
}
|
||||
|
||||
# Define the test script
|
||||
$testScript = {
|
||||
# Import the script
|
||||
It "Should not use deprecated cmdlets or aliases" {
|
||||
$content = Get-Content -Path $file.FullName -Raw
|
||||
# Example check for a known deprecated cmdlet or alias
|
||||
$content | Should -Not -Match 'DeprecatedCmdlet'
|
||||
# Add more checks as needed
|
||||
}
|
||||
|
||||
It "Should follow naming conventions for functions" {
|
||||
$functions = (Get-Command -Path $file.FullName).Name
|
||||
foreach ($function in $functions) {
|
||||
$function | Should -Match '^[a-z]+(-[a-z]+)*$' # Enforce lower-kebab-case
|
||||
}
|
||||
}
|
||||
|
||||
It "Should define mandatory parameters for all functions" {
|
||||
. $file.FullName
|
||||
|
||||
# Check if any errors occurred
|
||||
$scriptError = $error[0]
|
||||
$scriptError | Should -Be $null
|
||||
$functions = (Get-Command -Path $file.FullName).Name
|
||||
foreach ($function in $functions) {
|
||||
$parameters = (Get-Command -Name $function).Parameters.Values
|
||||
$mandatoryParams = $parameters | Where-Object { $_.Attributes.Mandatory -eq $true }
|
||||
$mandatoryParams.Count | Should -BeGreaterThan 0
|
||||
}
|
||||
}
|
||||
|
||||
# Add the test to the Pester test suite
|
||||
Describe $testName $testScript
|
||||
}
|
||||
|
||||
Describe "Functions"{
|
||||
|
||||
Get-ChildItem .\functions -Recurse -File | ForEach-Object {
|
||||
|
||||
context "$($psitem.BaseName)" {
|
||||
BeforeEach -Scriptblock {
|
||||
. $psitem.FullName
|
||||
It "Should have all functions available after import" {
|
||||
. $file.FullName
|
||||
$functions = (Get-Command -Path $file.FullName).Name
|
||||
foreach ($function in $functions) {
|
||||
{ Get-Command -Name $function -CommandType Function } | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
|
||||
It "Imports with no errors" -TestCases @{
|
||||
basename = $($psitem.BaseName)
|
||||
fullname = $psitem.FullName
|
||||
} {
|
||||
Get-ChildItem function:\$basename | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
}
|
||||
}
|
||||
|
118
winutil.ps1
118
winutil.ps1
@ -5255,7 +5255,7 @@ $sync.configs.applications = '{
|
||||
"category": "Utilities",
|
||||
"choco": "cpu-z",
|
||||
"content": "CPU-Z",
|
||||
"description": "CPU-Z is a system monitoring and diagnostic tool for Windows. It provides detailed information about the computer\u0026#39;s hardware components, including the CPU, memory, and motherboard.",
|
||||
"description": "CPU-Z is a system monitoring and diagnostic tool for Windows. It provides detailed information about the computer's hardware components, including the CPU, memory, and motherboard.",
|
||||
"link": "https://www.cpuid.com/softwares/cpu-z.html",
|
||||
"winget": "CPUID.CPU-Z"
|
||||
},
|
||||
@ -5271,7 +5271,7 @@ $sync.configs.applications = '{
|
||||
"category": "Utilities",
|
||||
"choco": "na",
|
||||
"content": "CapFrameX",
|
||||
"description": "Frametimes capture and analysis tool based on Intel\u0026#39;s PresentMon. Overlay provided by Rivatuner Statistics Server.",
|
||||
"description": "Frametimes capture and analysis tool based on Intel's PresentMon. Overlay provided by Rivatuner Statistics Server.",
|
||||
"link": "https://www.capframex.com/",
|
||||
"winget": "CXWorld.CapFrameX"
|
||||
},
|
||||
@ -6263,7 +6263,7 @@ $sync.configs.applications = '{
|
||||
"category": "Development",
|
||||
"choco": "nodejs",
|
||||
"content": "NodeJS",
|
||||
"description": "NodeJS is a JavaScript runtime built on Chrome\u0026#39;s V8 JavaScript engine for building server-side and networking applications.",
|
||||
"description": "NodeJS is a JavaScript runtime built on Chrome's V8 JavaScript engine for building server-side and networking applications.",
|
||||
"link": "https://nodejs.org/",
|
||||
"winget": "OpenJS.NodeJS"
|
||||
},
|
||||
@ -6639,7 +6639,7 @@ $sync.configs.applications = '{
|
||||
"category": "Utilities",
|
||||
"choco": "quicklook",
|
||||
"content": "Quicklook",
|
||||
"description": "Bring macOS \u0026#8220;Quick Look\u0026#8221; feature to Windows",
|
||||
"description": "Bring macOS “Quick Look” feature to Windows",
|
||||
"link": "https://github.com/QL-Win/QuickLook",
|
||||
"winget": "QL-Win.QuickLook"
|
||||
},
|
||||
@ -6887,7 +6887,7 @@ $sync.configs.applications = '{
|
||||
"category": "Document",
|
||||
"choco": "na",
|
||||
"content": "PDFgear",
|
||||
"description": "PDFgear is a piece of full-featured PDF management software for Windows, Mac, and mobile, and it\u0026#39;s completely free to use.",
|
||||
"description": "PDFgear is a piece of full-featured PDF management software for Windows, Mac, and mobile, and it's completely free to use.",
|
||||
"link": "https://www.pdfgear.com/",
|
||||
"winget": "PDFgear.PDFgear"
|
||||
},
|
||||
@ -6911,7 +6911,7 @@ $sync.configs.applications = '{
|
||||
"category": "Development",
|
||||
"choco": "na",
|
||||
"content": "Swift toolchain",
|
||||
"description": "Swift is a general-purpose programming language that\u0026#39;s approachable for newcomers and powerful for experts.",
|
||||
"description": "Swift is a general-purpose programming language that's approachable for newcomers and powerful for experts.",
|
||||
"link": "https://www.swift.org/",
|
||||
"winget": "Swift.Toolchain"
|
||||
},
|
||||
@ -7079,7 +7079,7 @@ $sync.configs.applications = '{
|
||||
"category": "Games",
|
||||
"choco": "ubisoft-connect",
|
||||
"content": "Ubisoft Connect",
|
||||
"description": "Ubisoft Connect is Ubisoft\u0026#39;s digital distribution and online gaming service, providing access to Ubisoft\u0026#39;s games and services.",
|
||||
"description": "Ubisoft Connect is Ubisoft's digital distribution and online gaming service, providing access to Ubisoft's games and services.",
|
||||
"link": "https://ubisoftconnect.com/",
|
||||
"winget": "Ubisoft.Connect"
|
||||
},
|
||||
@ -7087,7 +7087,7 @@ $sync.configs.applications = '{
|
||||
"category": "Browsers",
|
||||
"choco": "ungoogled-chromium",
|
||||
"content": "Ungoogled",
|
||||
"description": "Ungoogled Chromium is a version of Chromium without Google\u0026#39;s integration for enhanced privacy and control.",
|
||||
"description": "Ungoogled Chromium is a version of Chromium without Google's integration for enhanced privacy and control.",
|
||||
"link": "https://github.com/Eloston/ungoogled-chromium",
|
||||
"winget": "eloston.ungoogled-chromium"
|
||||
},
|
||||
@ -7215,7 +7215,7 @@ $sync.configs.applications = '{
|
||||
"category": "Development",
|
||||
"choco": "vscodium",
|
||||
"content": "VS Codium",
|
||||
"description": "VSCodium is a community-driven, freely-licensed binary distribution of Microsoft\u0026#39;s VS Code.",
|
||||
"description": "VSCodium is a community-driven, freely-licensed binary distribution of Microsoft's VS Code.",
|
||||
"link": "https://vscodium.com/",
|
||||
"winget": "Git.Git;VSCodium.VSCodium"
|
||||
},
|
||||
@ -7263,7 +7263,7 @@ $sync.configs.applications = '{
|
||||
"category": "Utilities",
|
||||
"choco": "wingetui",
|
||||
"content": "WingetUI",
|
||||
"description": "WingetUI is a graphical user interface for Microsoft\u0026#39;s Windows Package Manager (winget).",
|
||||
"description": "WingetUI is a graphical user interface for Microsoft's Windows Package Manager (winget).",
|
||||
"link": "https://www.marticliment.com/wingetui/",
|
||||
"winget": "SomePythonThings.WingetUIStore"
|
||||
},
|
||||
@ -7589,9 +7589,7 @@ $sync.configs.feature = '{
|
||||
"NetFx4-AdvSrvs",
|
||||
"NetFx3"
|
||||
],
|
||||
"InvokeScript": [
|
||||
|
||||
]
|
||||
"InvokeScript": []
|
||||
},
|
||||
"WPFFeatureshyperv": {
|
||||
"Content": "HyperV Virtualization",
|
||||
@ -7610,7 +7608,7 @@ $sync.configs.feature = '{
|
||||
"Microsoft-Hyper-V-Management-Clients"
|
||||
],
|
||||
"InvokeScript": [
|
||||
"Start-Process -FilePath cmd.exe -ArgumentList \u0027\u0027/c bcdedit /set hypervisorschedulertype classic\u0027\u0027 -Wait"
|
||||
"Start-Process -FilePath cmd.exe -ArgumentList ''/c bcdedit /set hypervisorschedulertype classic'' -Wait"
|
||||
]
|
||||
},
|
||||
"WPFFeatureslegacymedia": {
|
||||
@ -7625,9 +7623,7 @@ $sync.configs.feature = '{
|
||||
"DirectPlay",
|
||||
"LegacyComponents"
|
||||
],
|
||||
"InvokeScript": [
|
||||
|
||||
]
|
||||
"InvokeScript": []
|
||||
},
|
||||
"WPFFeaturewsl": {
|
||||
"Content": "Windows Subsystem for Linux",
|
||||
@ -7639,9 +7635,7 @@ $sync.configs.feature = '{
|
||||
"VirtualMachinePlatform",
|
||||
"Microsoft-Windows-Subsystem-Linux"
|
||||
],
|
||||
"InvokeScript": [
|
||||
|
||||
]
|
||||
"InvokeScript": []
|
||||
},
|
||||
"WPFFeaturenfs": {
|
||||
"Content": "NFS - Network File System",
|
||||
@ -7656,8 +7650,8 @@ $sync.configs.feature = '{
|
||||
],
|
||||
"InvokeScript": [
|
||||
"nfsadmin client stop",
|
||||
"Set-ItemProperty -Path \u0027\u0027HKLM:\\SOFTWARE\\Microsoft\\ClientForNFS\\CurrentVersion\\Default\u0027\u0027 -Name \u0027\u0027AnonymousUID\u0027\u0027 -Type DWord -Value 0",
|
||||
"Set-ItemProperty -Path \u0027\u0027HKLM:\\SOFTWARE\\Microsoft\\ClientForNFS\\CurrentVersion\\Default\u0027\u0027 -Name \u0027\u0027AnonymousGID\u0027\u0027 -Type DWord -Value 0",
|
||||
"Set-ItemProperty -Path ''HKLM:\\SOFTWARE\\Microsoft\\ClientForNFS\\CurrentVersion\\Default'' -Name ''AnonymousUID'' -Type DWord -Value 0",
|
||||
"Set-ItemProperty -Path ''HKLM:\\SOFTWARE\\Microsoft\\ClientForNFS\\CurrentVersion\\Default'' -Name ''AnonymousGID'' -Type DWord -Value 0",
|
||||
"nfsadmin client start",
|
||||
"nfsadmin client localhost config fileaccess=755 SecFlavors=+sys -krb5 -krb5i"
|
||||
]
|
||||
@ -7668,15 +7662,13 @@ $sync.configs.feature = '{
|
||||
"category": "Features",
|
||||
"panel": "1",
|
||||
"Order": "a015_",
|
||||
"feature": [
|
||||
|
||||
],
|
||||
"feature": [],
|
||||
"InvokeScript": [
|
||||
"
|
||||
If (!(Test-Path \u0027\u0027HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\u0027\u0027)) {
|
||||
New-Item -Path \u0027\u0027HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\u0027\u0027 -Force | Out-Null
|
||||
If (!(Test-Path ''HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer'')) {
|
||||
New-Item -Path ''HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer'' -Force | Out-Null
|
||||
}
|
||||
New-ItemProperty -Path \u0027\u0027HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\u0027\u0027 -Name \u0027\u0027DisableSearchBoxSuggestions\u0027\u0027 -Type DWord -Value 0 -Force
|
||||
New-ItemProperty -Path ''HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer'' -Name ''DisableSearchBoxSuggestions'' -Type DWord -Value 0 -Force
|
||||
Stop-Process -name explorer -force
|
||||
"
|
||||
]
|
||||
@ -7687,15 +7679,13 @@ $sync.configs.feature = '{
|
||||
"category": "Features",
|
||||
"panel": "1",
|
||||
"Order": "a016_",
|
||||
"feature": [
|
||||
|
||||
],
|
||||
"feature": [],
|
||||
"InvokeScript": [
|
||||
"
|
||||
If (!(Test-Path \u0027\u0027HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\u0027\u0027)) {
|
||||
New-Item -Path \u0027\u0027HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\u0027\u0027 -Force | Out-Null
|
||||
If (!(Test-Path ''HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer'')) {
|
||||
New-Item -Path ''HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer'' -Force | Out-Null
|
||||
}
|
||||
New-ItemProperty -Path \u0027\u0027HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\u0027\u0027 -Name \u0027\u0027DisableSearchBoxSuggestions\u0027\u0027 -Type DWord -Value 1 -Force
|
||||
New-ItemProperty -Path ''HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer'' -Name ''DisableSearchBoxSuggestions'' -Type DWord -Value 1 -Force
|
||||
Stop-Process -name explorer -force
|
||||
"
|
||||
]
|
||||
@ -7706,16 +7696,14 @@ $sync.configs.feature = '{
|
||||
"category": "Features",
|
||||
"panel": "1",
|
||||
"Order": "a017_",
|
||||
"feature": [
|
||||
|
||||
],
|
||||
"feature": [],
|
||||
"InvokeScript": [
|
||||
"
|
||||
New-ItemProperty -Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\u0027\u0027 -Name \u0027\u0027EnablePeriodicBackup\u0027\u0027 -Type DWord -Value 1 -Force
|
||||
New-ItemProperty -Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\u0027\u0027 -Name \u0027\u0027BackupCount\u0027\u0027 -Type DWord -Value 2 -Force
|
||||
$action = New-ScheduledTaskAction -Execute \u0027\u0027schtasks\u0027\u0027 -Argument \u0027\u0027/run /i /tn \"\\Microsoft\\Windows\\Registry\\RegIdleBackup\"\u0027\u0027
|
||||
New-ItemProperty -Path ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager'' -Name ''EnablePeriodicBackup'' -Type DWord -Value 1 -Force
|
||||
New-ItemProperty -Path ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager'' -Name ''BackupCount'' -Type DWord -Value 2 -Force
|
||||
$action = New-ScheduledTaskAction -Execute ''schtasks'' -Argument ''/run /i /tn \"\\Microsoft\\Windows\\Registry\\RegIdleBackup\"''
|
||||
$trigger = New-ScheduledTaskTrigger -Daily -At 00:30
|
||||
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName \u0027\u0027AutoRegBackup\u0027\u0027 -Description \u0027\u0027Create System Registry Backups\u0027\u0027 -User \u0027\u0027System\u0027\u0027
|
||||
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName ''AutoRegBackup'' -Description ''Create System Registry Backups'' -User ''System''
|
||||
"
|
||||
]
|
||||
},
|
||||
@ -7725,16 +7713,14 @@ $sync.configs.feature = '{
|
||||
"category": "Features",
|
||||
"panel": "1",
|
||||
"Order": "a018_",
|
||||
"feature": [
|
||||
|
||||
],
|
||||
"feature": [],
|
||||
"InvokeScript": [
|
||||
"
|
||||
If (!(Test-Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood\u0027\u0027)) {
|
||||
New-Item -Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood\u0027\u0027 -Force | Out-Null
|
||||
If (!(Test-Path ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood'')) {
|
||||
New-Item -Path ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood'' -Force | Out-Null
|
||||
}
|
||||
New-ItemProperty -Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood\u0027\u0027 -Name \u0027\u0027Enabled\u0027\u0027 -Type DWord -Value 1 -Force
|
||||
Start-Process -FilePath cmd.exe -ArgumentList \u0027\u0027/c bcdedit /Set {Current} BootMenuPolicy Legacy\u0027\u0027 -Wait
|
||||
New-ItemProperty -Path ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood'' -Name ''Enabled'' -Type DWord -Value 1 -Force
|
||||
Start-Process -FilePath cmd.exe -ArgumentList ''/c bcdedit /Set {Current} BootMenuPolicy Legacy'' -Wait
|
||||
"
|
||||
]
|
||||
},
|
||||
@ -7744,16 +7730,14 @@ $sync.configs.feature = '{
|
||||
"category": "Features",
|
||||
"panel": "1",
|
||||
"Order": "a019_",
|
||||
"feature": [
|
||||
|
||||
],
|
||||
"feature": [],
|
||||
"InvokeScript": [
|
||||
"
|
||||
If (!(Test-Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood\u0027\u0027)) {
|
||||
New-Item -Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood\u0027\u0027 -Force | Out-Null
|
||||
If (!(Test-Path ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood'')) {
|
||||
New-Item -Path ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood'' -Force | Out-Null
|
||||
}
|
||||
New-ItemProperty -Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood\u0027\u0027 -Name \u0027\u0027Enabled\u0027\u0027 -Type DWord -Value 0 -Force
|
||||
Start-Process -FilePath cmd.exe -ArgumentList \u0027\u0027/c bcdedit /Set {Current} BootMenuPolicy Standard\u0027\u0027 -Wait
|
||||
New-ItemProperty -Path ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood'' -Name ''Enabled'' -Type DWord -Value 0 -Force
|
||||
Start-Process -FilePath cmd.exe -ArgumentList ''/c bcdedit /Set {Current} BootMenuPolicy Standard'' -Wait
|
||||
"
|
||||
]
|
||||
},
|
||||
@ -8015,7 +7999,7 @@ $sync.configs.tweaks = '{
|
||||
},
|
||||
"WPFTweaksHiber": {
|
||||
"Content": "Disable Hibernation",
|
||||
"Description": "Hibernation is really meant for laptops as it saves what\u0026#39;s in memory before turning the pc off. It really should never be used, but some people are lazy and rely on it. Don\u0026#39;t be like Bob. Bob likes hibernation.",
|
||||
"Description": "Hibernation is really meant for laptops as it saves what's in memory before turning the pc off. It really should never be used, but some people are lazy and rely on it. Don't be like Bob. Bob likes hibernation.",
|
||||
"category": "Essential Tweaks",
|
||||
"panel": "1",
|
||||
"Order": "a011_",
|
||||
@ -8100,7 +8084,7 @@ $sync.configs.tweaks = '{
|
||||
},
|
||||
"WPFTweaksServices": {
|
||||
"Content": "Set Services to Manual",
|
||||
"Description": "Turns a bunch of system services to manual that don\u0026#39;t need to be running all the time. This is pretty harmless as if the service is needed, it will simply start on demand.",
|
||||
"Description": "Turns a bunch of system services to manual that don't need to be running all the time. This is pretty harmless as if the service is needed, it will simply start on demand.",
|
||||
"category": "Essential Tweaks",
|
||||
"panel": "1",
|
||||
"Order": "a014_",
|
||||
@ -10150,8 +10134,8 @@ $sync.configs.tweaks = '{
|
||||
],
|
||||
"InvokeScript": [
|
||||
"
|
||||
$TeamsPath = [System.IO.Path]::Combine($env:LOCALAPPDATA, \u0027\u0027Microsoft\u0027\u0027, \u0027\u0027Teams\u0027\u0027)
|
||||
$TeamsUpdateExePath = [System.IO.Path]::Combine($TeamsPath, \u0027\u0027Update.exe\u0027\u0027)
|
||||
$TeamsPath = [System.IO.Path]::Combine($env:LOCALAPPDATA, ''Microsoft'', ''Teams'')
|
||||
$TeamsUpdateExePath = [System.IO.Path]::Combine($TeamsPath, ''Update.exe'')
|
||||
|
||||
Write-Host \"Stopping Teams process...\"
|
||||
Stop-Process -Name \"*teams*\" -Force -ErrorAction SilentlyContinue
|
||||
@ -10174,11 +10158,11 @@ $sync.configs.tweaks = '{
|
||||
|
||||
Write-Host \"Deleting Teams uninstall registry key\"
|
||||
# Uninstall from Uninstall registry key UninstallString
|
||||
$us = (Get-ChildItem -Path HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall, HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -like \u0027\u0027*Teams*\u0027\u0027}).UninstallString
|
||||
$us = (Get-ChildItem -Path HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall, HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -like ''*Teams*''}).UninstallString
|
||||
if ($us.Length -gt 0) {
|
||||
$us = ($us.Replace(\u0027\u0027/I\u0027\u0027, \u0027\u0027/uninstall \u0027\u0027) + \u0027\u0027 /quiet\u0027\u0027).Replace(\u0027\u0027 \u0027\u0027, \u0027\u0027 \u0027\u0027)
|
||||
$FilePath = ($us.Substring(0, $us.IndexOf(\u0027\u0027.exe\u0027\u0027) + 4).Trim())
|
||||
$ProcessArgs = ($us.Substring($us.IndexOf(\u0027\u0027.exe\u0027\u0027) + 5).Trim().replace(\u0027\u0027 \u0027\u0027, \u0027\u0027 \u0027\u0027))
|
||||
$us = ($us.Replace(''/I'', ''/uninstall '') + '' /quiet'').Replace('' '', '' '')
|
||||
$FilePath = ($us.Substring(0, $us.IndexOf(''.exe'') + 4).Trim())
|
||||
$ProcessArgs = ($us.Substring($us.IndexOf(''.exe'') + 5).Trim().replace('' '', '' ''))
|
||||
$proc = Start-Process -FilePath $FilePath -Args $ProcessArgs -PassThru
|
||||
$proc.WaitForExit()
|
||||
}
|
||||
@ -10211,7 +10195,7 @@ $sync.configs.tweaks = '{
|
||||
# Check if the SystemRestorePointCreationFrequency value exists
|
||||
$exists = Get-ItemProperty -path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\" -Name \"SystemRestorePointCreationFrequency\" -ErrorAction SilentlyContinue
|
||||
if($null -eq $exists){
|
||||
write-host \u0027\u0027Changing system to allow multiple restore points per day\u0027\u0027
|
||||
write-host ''Changing system to allow multiple restore points per day''
|
||||
Set-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\" -Name \"SystemRestorePointCreationFrequency\" -Value \"0\" -Type DWord -Force -ErrorAction Stop | Out-Null
|
||||
}
|
||||
|
||||
@ -10321,7 +10305,7 @@ $sync.configs.tweaks = '{
|
||||
taskkill.exe /F /IM \"explorer.exe\"
|
||||
|
||||
Write-Host \"Copy all OneDrive to Root UserProfile\"
|
||||
Start-Process -FilePath powershell -ArgumentList \"robocopy \u0027\u0027$($env:USERPROFILE.TrimEnd())\\OneDrive\u0027\u0027 \u0027\u0027$($env:USERPROFILE.TrimEnd())\\\u0027\u0027 /e /xj\" -NoNewWindow -Wait
|
||||
Start-Process -FilePath powershell -ArgumentList \"robocopy ''$($env:USERPROFILE.TrimEnd())\\OneDrive'' ''$($env:USERPROFILE.TrimEnd())\\'' /e /xj\" -NoNewWindow -Wait
|
||||
|
||||
Write-Host \"Remove OneDrive\"
|
||||
Start-Process -FilePath winget -ArgumentList \"uninstall -e --purge --force --silent Microsoft.OneDrive \" -NoNewWindow -Wait
|
||||
@ -10349,7 +10333,7 @@ $sync.configs.tweaks = '{
|
||||
Remove-Item -Force -ErrorAction SilentlyContinue \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\OneDrive.lnk\"
|
||||
|
||||
Write-Host \"Removing scheduled task\"
|
||||
Get-ScheduledTask -TaskPath \u0027\u0027\\\u0027\u0027 -TaskName \u0027\u0027OneDrive*\u0027\u0027 -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false
|
||||
Get-ScheduledTask -TaskPath ''\\'' -TaskName ''OneDrive*'' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false
|
||||
|
||||
# Add Shell folders restoring default locations
|
||||
Write-Host \"Shell Fixing\"
|
||||
@ -10463,7 +10447,7 @@ $sync.configs.tweaks = '{
|
||||
},
|
||||
"WPFTweaksDVR": {
|
||||
"Content": "Disable GameDVR",
|
||||
"Description": "GameDVR is a Windows App that is a dependency for some Store Games. I\u0026#39;ve never met someone that likes it, but it\u0026#39;s there for the XBOX crowd.",
|
||||
"Description": "GameDVR is a Windows App that is a dependency for some Store Games. I've never met someone that likes it, but it's there for the XBOX crowd.",
|
||||
"category": "Essential Tweaks",
|
||||
"panel": "1",
|
||||
"Order": "a012_",
|
||||
|
Loading…
Reference in New Issue
Block a user