mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-12-21 21:41:29 -06: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:
|
build-runspace:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.head_ref }}
|
ref: ${{ github.head_ref }}
|
||||||
- name: Create local changes
|
- name: Create local changes
|
||||||
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
powershell.exe -f Compile.ps1
|
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v4.16.0
|
./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:
|
with:
|
||||||
commit_message: Compile Winutil
|
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
|
- name: Run Pester tests
|
||||||
run: |
|
run: |
|
||||||
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
|
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
|
||||||
Invoke-Pester -Path 'pester/*.Tests.ps1' -EnableExit
|
Invoke-Pester -Path 'pester/*.Tests.ps1' -Output Detailed
|
||||||
|
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
|
@ -1,43 +1,54 @@
|
|||||||
#===========================================================================
|
#===========================================================================
|
||||||
# Tests - Functions
|
# Tests - Functions
|
||||||
#===========================================================================
|
#===========================================================================
|
||||||
|
Describe "Comprehensive Checks for PS1 Files in Functions Folder" {
|
||||||
|
BeforeAll {
|
||||||
# Get all .ps1 files in the functions folder
|
# Get all .ps1 files in the functions folder
|
||||||
$ps1Files = Get-ChildItem -Path ./functions -Filter *.ps1
|
$ps1Files = Get-ChildItem -Path ./functions -Filter *.ps1 -Recurse
|
||||||
|
}
|
||||||
|
|
||||||
# Loop through each file
|
|
||||||
foreach ($file in $ps1Files) {
|
foreach ($file in $ps1Files) {
|
||||||
# Define the test name
|
Context "Checking $($file.Name)" {
|
||||||
$testName = "Syntax check for $($file.Name)"
|
It "Should import without errors" {
|
||||||
|
{ . $file.FullName } | Should -Not -Throw
|
||||||
|
}
|
||||||
|
|
||||||
# Define the test script
|
It "Should have no syntax errors" {
|
||||||
$testScript = {
|
$syntaxErrors = $null
|
||||||
# Import the script
|
$null = [System.Management.Automation.PSParser]::Tokenize((Get-Content -Path $file.FullName -Raw), [ref]$syntaxErrors)
|
||||||
|
$syntaxErrors.Count | Should -Be 0
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
. $file.FullName
|
||||||
|
$functions = (Get-Command -Path $file.FullName).Name
|
||||||
# Check if any errors occurred
|
foreach ($function in $functions) {
|
||||||
$scriptError = $error[0]
|
$parameters = (Get-Command -Name $function).Parameters.Values
|
||||||
$scriptError | Should -Be $null
|
$mandatoryParams = $parameters | Where-Object { $_.Attributes.Mandatory -eq $true }
|
||||||
|
$mandatoryParams.Count | Should -BeGreaterThan 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add the test to the Pester test suite
|
It "Should have all functions available after import" {
|
||||||
Describe $testName $testScript
|
. $file.FullName
|
||||||
}
|
$functions = (Get-Command -Path $file.FullName).Name
|
||||||
|
foreach ($function in $functions) {
|
||||||
Describe "Functions"{
|
{ Get-Command -Name $function -CommandType Function } | Should -Not -BeNullOrEmpty
|
||||||
|
}
|
||||||
Get-ChildItem .\functions -Recurse -File | ForEach-Object {
|
|
||||||
|
|
||||||
context "$($psitem.BaseName)" {
|
|
||||||
BeforeEach -Scriptblock {
|
|
||||||
. $psitem.FullName
|
|
||||||
}
|
|
||||||
|
|
||||||
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",
|
"category": "Utilities",
|
||||||
"choco": "cpu-z",
|
"choco": "cpu-z",
|
||||||
"content": "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",
|
"link": "https://www.cpuid.com/softwares/cpu-z.html",
|
||||||
"winget": "CPUID.CPU-Z"
|
"winget": "CPUID.CPU-Z"
|
||||||
},
|
},
|
||||||
@ -5271,7 +5271,7 @@ $sync.configs.applications = '{
|
|||||||
"category": "Utilities",
|
"category": "Utilities",
|
||||||
"choco": "na",
|
"choco": "na",
|
||||||
"content": "CapFrameX",
|
"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/",
|
"link": "https://www.capframex.com/",
|
||||||
"winget": "CXWorld.CapFrameX"
|
"winget": "CXWorld.CapFrameX"
|
||||||
},
|
},
|
||||||
@ -6263,7 +6263,7 @@ $sync.configs.applications = '{
|
|||||||
"category": "Development",
|
"category": "Development",
|
||||||
"choco": "nodejs",
|
"choco": "nodejs",
|
||||||
"content": "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/",
|
"link": "https://nodejs.org/",
|
||||||
"winget": "OpenJS.NodeJS"
|
"winget": "OpenJS.NodeJS"
|
||||||
},
|
},
|
||||||
@ -6639,7 +6639,7 @@ $sync.configs.applications = '{
|
|||||||
"category": "Utilities",
|
"category": "Utilities",
|
||||||
"choco": "quicklook",
|
"choco": "quicklook",
|
||||||
"content": "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",
|
"link": "https://github.com/QL-Win/QuickLook",
|
||||||
"winget": "QL-Win.QuickLook"
|
"winget": "QL-Win.QuickLook"
|
||||||
},
|
},
|
||||||
@ -6887,7 +6887,7 @@ $sync.configs.applications = '{
|
|||||||
"category": "Document",
|
"category": "Document",
|
||||||
"choco": "na",
|
"choco": "na",
|
||||||
"content": "PDFgear",
|
"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/",
|
"link": "https://www.pdfgear.com/",
|
||||||
"winget": "PDFgear.PDFgear"
|
"winget": "PDFgear.PDFgear"
|
||||||
},
|
},
|
||||||
@ -6911,7 +6911,7 @@ $sync.configs.applications = '{
|
|||||||
"category": "Development",
|
"category": "Development",
|
||||||
"choco": "na",
|
"choco": "na",
|
||||||
"content": "Swift toolchain",
|
"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/",
|
"link": "https://www.swift.org/",
|
||||||
"winget": "Swift.Toolchain"
|
"winget": "Swift.Toolchain"
|
||||||
},
|
},
|
||||||
@ -7079,7 +7079,7 @@ $sync.configs.applications = '{
|
|||||||
"category": "Games",
|
"category": "Games",
|
||||||
"choco": "ubisoft-connect",
|
"choco": "ubisoft-connect",
|
||||||
"content": "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/",
|
"link": "https://ubisoftconnect.com/",
|
||||||
"winget": "Ubisoft.Connect"
|
"winget": "Ubisoft.Connect"
|
||||||
},
|
},
|
||||||
@ -7087,7 +7087,7 @@ $sync.configs.applications = '{
|
|||||||
"category": "Browsers",
|
"category": "Browsers",
|
||||||
"choco": "ungoogled-chromium",
|
"choco": "ungoogled-chromium",
|
||||||
"content": "Ungoogled",
|
"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",
|
"link": "https://github.com/Eloston/ungoogled-chromium",
|
||||||
"winget": "eloston.ungoogled-chromium"
|
"winget": "eloston.ungoogled-chromium"
|
||||||
},
|
},
|
||||||
@ -7215,7 +7215,7 @@ $sync.configs.applications = '{
|
|||||||
"category": "Development",
|
"category": "Development",
|
||||||
"choco": "vscodium",
|
"choco": "vscodium",
|
||||||
"content": "VS Codium",
|
"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/",
|
"link": "https://vscodium.com/",
|
||||||
"winget": "Git.Git;VSCodium.VSCodium"
|
"winget": "Git.Git;VSCodium.VSCodium"
|
||||||
},
|
},
|
||||||
@ -7263,7 +7263,7 @@ $sync.configs.applications = '{
|
|||||||
"category": "Utilities",
|
"category": "Utilities",
|
||||||
"choco": "wingetui",
|
"choco": "wingetui",
|
||||||
"content": "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/",
|
"link": "https://www.marticliment.com/wingetui/",
|
||||||
"winget": "SomePythonThings.WingetUIStore"
|
"winget": "SomePythonThings.WingetUIStore"
|
||||||
},
|
},
|
||||||
@ -7589,9 +7589,7 @@ $sync.configs.feature = '{
|
|||||||
"NetFx4-AdvSrvs",
|
"NetFx4-AdvSrvs",
|
||||||
"NetFx3"
|
"NetFx3"
|
||||||
],
|
],
|
||||||
"InvokeScript": [
|
"InvokeScript": []
|
||||||
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"WPFFeatureshyperv": {
|
"WPFFeatureshyperv": {
|
||||||
"Content": "HyperV Virtualization",
|
"Content": "HyperV Virtualization",
|
||||||
@ -7610,7 +7608,7 @@ $sync.configs.feature = '{
|
|||||||
"Microsoft-Hyper-V-Management-Clients"
|
"Microsoft-Hyper-V-Management-Clients"
|
||||||
],
|
],
|
||||||
"InvokeScript": [
|
"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": {
|
"WPFFeatureslegacymedia": {
|
||||||
@ -7625,9 +7623,7 @@ $sync.configs.feature = '{
|
|||||||
"DirectPlay",
|
"DirectPlay",
|
||||||
"LegacyComponents"
|
"LegacyComponents"
|
||||||
],
|
],
|
||||||
"InvokeScript": [
|
"InvokeScript": []
|
||||||
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"WPFFeaturewsl": {
|
"WPFFeaturewsl": {
|
||||||
"Content": "Windows Subsystem for Linux",
|
"Content": "Windows Subsystem for Linux",
|
||||||
@ -7639,9 +7635,7 @@ $sync.configs.feature = '{
|
|||||||
"VirtualMachinePlatform",
|
"VirtualMachinePlatform",
|
||||||
"Microsoft-Windows-Subsystem-Linux"
|
"Microsoft-Windows-Subsystem-Linux"
|
||||||
],
|
],
|
||||||
"InvokeScript": [
|
"InvokeScript": []
|
||||||
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"WPFFeaturenfs": {
|
"WPFFeaturenfs": {
|
||||||
"Content": "NFS - Network File System",
|
"Content": "NFS - Network File System",
|
||||||
@ -7656,8 +7650,8 @@ $sync.configs.feature = '{
|
|||||||
],
|
],
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"nfsadmin client stop",
|
"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 ''HKLM:\\SOFTWARE\\Microsoft\\ClientForNFS\\CurrentVersion\\Default'' -Name ''AnonymousUID'' -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 ''AnonymousGID'' -Type DWord -Value 0",
|
||||||
"nfsadmin client start",
|
"nfsadmin client start",
|
||||||
"nfsadmin client localhost config fileaccess=755 SecFlavors=+sys -krb5 -krb5i"
|
"nfsadmin client localhost config fileaccess=755 SecFlavors=+sys -krb5 -krb5i"
|
||||||
]
|
]
|
||||||
@ -7668,15 +7662,13 @@ $sync.configs.feature = '{
|
|||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a015_",
|
"Order": "a015_",
|
||||||
"feature": [
|
"feature": [],
|
||||||
|
|
||||||
],
|
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"
|
"
|
||||||
If (!(Test-Path \u0027\u0027HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\u0027\u0027)) {
|
If (!(Test-Path ''HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer'')) {
|
||||||
New-Item -Path \u0027\u0027HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\u0027\u0027 -Force | Out-Null
|
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
|
Stop-Process -name explorer -force
|
||||||
"
|
"
|
||||||
]
|
]
|
||||||
@ -7687,15 +7679,13 @@ $sync.configs.feature = '{
|
|||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a016_",
|
"Order": "a016_",
|
||||||
"feature": [
|
"feature": [],
|
||||||
|
|
||||||
],
|
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"
|
"
|
||||||
If (!(Test-Path \u0027\u0027HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\u0027\u0027)) {
|
If (!(Test-Path ''HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer'')) {
|
||||||
New-Item -Path \u0027\u0027HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\u0027\u0027 -Force | Out-Null
|
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
|
Stop-Process -name explorer -force
|
||||||
"
|
"
|
||||||
]
|
]
|
||||||
@ -7706,16 +7696,14 @@ $sync.configs.feature = '{
|
|||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a017_",
|
"Order": "a017_",
|
||||||
"feature": [
|
"feature": [],
|
||||||
|
|
||||||
],
|
|
||||||
"InvokeScript": [
|
"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 ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager'' -Name ''EnablePeriodicBackup'' -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
|
New-ItemProperty -Path ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager'' -Name ''BackupCount'' -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
|
$action = New-ScheduledTaskAction -Execute ''schtasks'' -Argument ''/run /i /tn \"\\Microsoft\\Windows\\Registry\\RegIdleBackup\"''
|
||||||
$trigger = New-ScheduledTaskTrigger -Daily -At 00:30
|
$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",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a018_",
|
"Order": "a018_",
|
||||||
"feature": [
|
"feature": [],
|
||||||
|
|
||||||
],
|
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"
|
"
|
||||||
If (!(Test-Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood\u0027\u0027)) {
|
If (!(Test-Path ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood'')) {
|
||||||
New-Item -Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood\u0027\u0027 -Force | Out-Null
|
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
|
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 \u0027\u0027/c bcdedit /Set {Current} BootMenuPolicy Legacy\u0027\u0027 -Wait
|
Start-Process -FilePath cmd.exe -ArgumentList ''/c bcdedit /Set {Current} BootMenuPolicy Legacy'' -Wait
|
||||||
"
|
"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -7744,16 +7730,14 @@ $sync.configs.feature = '{
|
|||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a019_",
|
"Order": "a019_",
|
||||||
"feature": [
|
"feature": [],
|
||||||
|
|
||||||
],
|
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"
|
"
|
||||||
If (!(Test-Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood\u0027\u0027)) {
|
If (!(Test-Path ''HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood'')) {
|
||||||
New-Item -Path \u0027\u0027HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager\\LastKnownGood\u0027\u0027 -Force | Out-Null
|
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
|
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 \u0027\u0027/c bcdedit /Set {Current} BootMenuPolicy Standard\u0027\u0027 -Wait
|
Start-Process -FilePath cmd.exe -ArgumentList ''/c bcdedit /Set {Current} BootMenuPolicy Standard'' -Wait
|
||||||
"
|
"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -8015,7 +7999,7 @@ $sync.configs.tweaks = '{
|
|||||||
},
|
},
|
||||||
"WPFTweaksHiber": {
|
"WPFTweaksHiber": {
|
||||||
"Content": "Disable Hibernation",
|
"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",
|
"category": "Essential Tweaks",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a011_",
|
"Order": "a011_",
|
||||||
@ -8100,7 +8084,7 @@ $sync.configs.tweaks = '{
|
|||||||
},
|
},
|
||||||
"WPFTweaksServices": {
|
"WPFTweaksServices": {
|
||||||
"Content": "Set Services to Manual",
|
"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",
|
"category": "Essential Tweaks",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a014_",
|
"Order": "a014_",
|
||||||
@ -10150,8 +10134,8 @@ $sync.configs.tweaks = '{
|
|||||||
],
|
],
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"
|
"
|
||||||
$TeamsPath = [System.IO.Path]::Combine($env:LOCALAPPDATA, \u0027\u0027Microsoft\u0027\u0027, \u0027\u0027Teams\u0027\u0027)
|
$TeamsPath = [System.IO.Path]::Combine($env:LOCALAPPDATA, ''Microsoft'', ''Teams'')
|
||||||
$TeamsUpdateExePath = [System.IO.Path]::Combine($TeamsPath, \u0027\u0027Update.exe\u0027\u0027)
|
$TeamsUpdateExePath = [System.IO.Path]::Combine($TeamsPath, ''Update.exe'')
|
||||||
|
|
||||||
Write-Host \"Stopping Teams process...\"
|
Write-Host \"Stopping Teams process...\"
|
||||||
Stop-Process -Name \"*teams*\" -Force -ErrorAction SilentlyContinue
|
Stop-Process -Name \"*teams*\" -Force -ErrorAction SilentlyContinue
|
||||||
@ -10174,11 +10158,11 @@ $sync.configs.tweaks = '{
|
|||||||
|
|
||||||
Write-Host \"Deleting Teams uninstall registry key\"
|
Write-Host \"Deleting Teams uninstall registry key\"
|
||||||
# Uninstall from Uninstall registry key UninstallString
|
# 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) {
|
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)
|
$us = ($us.Replace(''/I'', ''/uninstall '') + '' /quiet'').Replace('' '', '' '')
|
||||||
$FilePath = ($us.Substring(0, $us.IndexOf(\u0027\u0027.exe\u0027\u0027) + 4).Trim())
|
$FilePath = ($us.Substring(0, $us.IndexOf(''.exe'') + 4).Trim())
|
||||||
$ProcessArgs = ($us.Substring($us.IndexOf(\u0027\u0027.exe\u0027\u0027) + 5).Trim().replace(\u0027\u0027 \u0027\u0027, \u0027\u0027 \u0027\u0027))
|
$ProcessArgs = ($us.Substring($us.IndexOf(''.exe'') + 5).Trim().replace('' '', '' ''))
|
||||||
$proc = Start-Process -FilePath $FilePath -Args $ProcessArgs -PassThru
|
$proc = Start-Process -FilePath $FilePath -Args $ProcessArgs -PassThru
|
||||||
$proc.WaitForExit()
|
$proc.WaitForExit()
|
||||||
}
|
}
|
||||||
@ -10211,7 +10195,7 @@ $sync.configs.tweaks = '{
|
|||||||
# Check if the SystemRestorePointCreationFrequency value exists
|
# Check if the SystemRestorePointCreationFrequency value exists
|
||||||
$exists = Get-ItemProperty -path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\" -Name \"SystemRestorePointCreationFrequency\" -ErrorAction SilentlyContinue
|
$exists = Get-ItemProperty -path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\" -Name \"SystemRestorePointCreationFrequency\" -ErrorAction SilentlyContinue
|
||||||
if($null -eq $exists){
|
if($null -eq $exists){
|
||||||
write-host \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
|
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\"
|
taskkill.exe /F /IM \"explorer.exe\"
|
||||||
|
|
||||||
Write-Host \"Copy all OneDrive to Root UserProfile\"
|
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\"
|
Write-Host \"Remove OneDrive\"
|
||||||
Start-Process -FilePath winget -ArgumentList \"uninstall -e --purge --force --silent Microsoft.OneDrive \" -NoNewWindow -Wait
|
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\"
|
Remove-Item -Force -ErrorAction SilentlyContinue \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\OneDrive.lnk\"
|
||||||
|
|
||||||
Write-Host \"Removing scheduled task\"
|
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
|
# Add Shell folders restoring default locations
|
||||||
Write-Host \"Shell Fixing\"
|
Write-Host \"Shell Fixing\"
|
||||||
@ -10463,7 +10447,7 @@ $sync.configs.tweaks = '{
|
|||||||
},
|
},
|
||||||
"WPFTweaksDVR": {
|
"WPFTweaksDVR": {
|
||||||
"Content": "Disable GameDVR",
|
"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",
|
"category": "Essential Tweaks",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a012_",
|
"Order": "a012_",
|
||||||
|
Loading…
Reference in New Issue
Block a user