Files
winutil/config/helperscript.ps1
T

399 lines
11 KiB
PowerShell
Raw Normal View History

2023-10-19 17:12:55 -05:00
# This file is meant to assist in building out the json files inside this folder.
2022-10-18 08:08:23 -05:00
+3
2023-03-07 12:28:00 -08:00
#===========================================================================
# applications.json
#===========================================================================
2022-10-18 08:08:23 -05:00
<#
Applications.json
-----------------
2022-11-29 17:54:18 -06:00
This file holds all the install commands to install the applications.
This file has the ability to expect multiple frameworks per checkbox.
2023-08-02 19:43:52 -05:00
You can also add multiple install commands by separating them with ;
2022-10-18 08:08:23 -05:00
The structure of the json is as follows
{
+3
2023-03-07 12:28:00 -08:00
"Name of Button": {
"winget": "Winget command"
"choco": "Chocolatey command"
2022-10-18 08:08:23 -05:00
},
}
Example:
{
+3
2023-03-07 12:28:00 -08:00
"WPFInstalladobe": {
"winget": "Adobe.Acrobat.Reader.64-bit"
"choco": "adobereader"
},
"WPFInstalladvancedip": {
"winget": "Famatech.AdvancedIPScanner"
"choco": "advanced-ip-scanner"
2022-10-18 08:08:23 -05:00
}
}
#>
2023-10-19 17:12:55 -05:00
# Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request.
2022-11-14 15:48:10 -06:00
#------Do not delete WPF------
2022-10-18 08:08:23 -05:00
2022-11-14 15:48:10 -06:00
$NameofButton = "WPF" + ""
2022-10-18 08:08:23 -05:00
$WingetCommand = ""
2022-11-29 17:54:18 -06:00
$ChocoCommand = ""
2022-10-18 08:08:23 -05:00
$ButtonToAdd = New-Object psobject
$jsonfile = Get-Content ./config/applications.json | ConvertFrom-Json
2023-10-19 17:12:55 -05:00
# Remove if already exists
+3
2023-03-07 12:28:00 -08:00
if($jsonfile.$NameofButton){
$jsonfile.psobject.Properties.remove($NameofButton)
2022-10-18 08:08:23 -05:00
}
Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "Winget" -Value $WingetCommand
2022-11-29 17:54:18 -06:00
Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "choco" -Value $ChocoCommand
2022-10-18 08:08:23 -05:00
Add-Member -InputObject $jsonfile.install -MemberType NoteProperty -Name $NameofButton -Value $ButtonToAdd
$jsonfile | ConvertTo-Json | Out-File ./config/applications.json
+3
2023-03-07 12:28:00 -08:00
#===========================================================================
# feature.json
#===========================================================================
2022-10-18 08:08:23 -05:00
<#
feature.json
-----------------
2023-08-02 19:43:52 -05:00
This file holds all the windows commands to install specific features (IE Hyper-v)
2022-10-18 08:08:23 -05:00
The structure of the json is as follows
{
"Name of Button": [
"Array of",
"commands"
]
}
Example:
{
"Featurewsl": [
"VirtualMachinePlatform",
"Microsoft-Windows-Subsystem-Linux"
],
"Featurenfs": [
"ServicesForNFS-ClientOnly",
"ClientForNFS-Infrastructure",
"NFS-Administration"
]
2023-10-19 17:12:55 -05:00
}
2022-10-18 08:08:23 -05:00
#>
2023-10-19 17:12:55 -05:00
# Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request.
2022-10-18 08:08:23 -05:00
$NameofButton = ""
$commands = @(
)
$jsonfile = Get-Content ./config/feature.json | ConvertFrom-Json
2023-10-19 17:12:55 -05:00
# Remove if already exists
2022-10-18 08:08:23 -05:00
if($jsonfile.$NameofButton){
$jsonfile.psobject.Properties.remove($NameofButton)
}
Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofButton -Value $commands
$jsonfile | ConvertTo-Json | Out-File ./config/feature.json
+3
2023-03-07 12:28:00 -08:00
#===========================================================================
# preset.json
#===========================================================================
2022-10-18 08:08:23 -05:00
<#
preset.json
-----------------
This file holds all check boxes you wish to check when clicking a preset button in the tweaks section.
The structure of the json is as follows
{
"Name of Button": [
"Array of",
"checkboxes to check"
]
}
Example:
{
"laptop": [
"EssTweaksAH",
"EssTweaksDVR",
"EssTweaksHome",
"EssTweaksLoc",
"EssTweaksOO",
"EssTweaksRP",
"EssTweaksServices",
"EssTweaksStorage",
"EssTweaksTele",
"EssTweaksWifi",
"MiscTweaksLapPower",
"MiscTweaksLapNum"
],
"minimal": [
"EssTweaksHome",
"EssTweaksOO",
"EssTweaksRP",
"EssTweaksServices",
"EssTweaksTele"
]
2023-10-19 17:12:55 -05:00
}
2022-10-18 08:08:23 -05:00
#>
2023-10-19 17:12:55 -05:00
# Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request.
2022-10-18 08:08:23 -05:00
2022-11-29 17:54:18 -06:00
$NameofButton = "WPF" + ""
2022-10-18 08:08:23 -05:00
$commands = @(
2023-10-19 17:12:55 -05:00
2022-10-18 08:08:23 -05:00
)
$jsonfile = Get-Content ./config/preset.json | ConvertFrom-Json
2023-10-19 17:12:55 -05:00
# Remove if already exists
2022-10-18 08:08:23 -05:00
if($jsonfile.$NameofButton){
$jsonfile.psobject.Properties.remove($NameofButton)
}
Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofButton -Value $commands
$jsonfile | ConvertTo-Json | Out-File ./config/preset.json
+3
2023-03-07 12:28:00 -08:00
#===========================================================================
# tweaks.json
#===========================================================================
2022-10-18 08:08:23 -05:00
<#
tweaks.json
-----------------
This file holds all the tweaks needed to make modifications to windows. This file is the most complicated so modify with care.
The structure of the json is as follows
{
"Name of button": {
"registry" : [
{
"Path": "Path in registry",
"Name": "Name of Registry key",
"Type": "Item type",
2023-10-19 17:12:55 -05:00
"Value": "Value to modify",
2022-10-18 08:08:23 -05:00
"OriginalValue": "value to reset"
}
],
"service" : [
{
"Name": "Name of service",
2023-10-19 17:12:55 -05:00
"StartupType": "Startup type to set",
2022-10-18 08:08:23 -05:00
"OriginalType": "Startup type to reset"
}
],
"ScheduledTask" : [
{
"Name": "Path to scheduled task",
2023-10-19 17:12:55 -05:00
"State": "State to set",
2022-10-18 08:08:23 -05:00
"OriginalState": "State to reset"
}
],
"appx": [
List of appx,
files to uninstall
],
"InvokeScript": [
"Script to make modifications not possible with the above types
Special care needs to be taken here as converting from json to a scriptblock
2023-10-19 17:12:55 -05:00
can cause weird issues. Please look at the example below to get an idea of how things should work"
2022-10-18 08:08:23 -05:00
],
"UndoScript": [
2023-10-19 17:12:55 -05:00
"Same as above however is meant to undo what you did above"
2022-10-18 08:08:23 -05:00
]
}
}
Example:
{
EssTweaksAH": {
"registry" : [
{
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System",
"Name": "EnableActivityFeed",
"Type": "DWord",
2023-10-19 17:12:55 -05:00
"Value": "0",
2022-10-18 08:08:23 -05:00
"OriginalValue": "1"
},
{
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System",
"Name": "PublishUserActivities",
"Type": "DWord",
2023-10-19 17:12:55 -05:00
"Value": "0",
2022-10-18 08:08:23 -05:00
"OriginalValue": "1"
}
]
},
"EssTweaksHome": {
"service" : [
{
"Name": "HomeGroupListener",
2023-10-19 17:12:55 -05:00
"StartupType": "Manual",
2022-10-18 08:08:23 -05:00
"OriginalType": "Automatic"
},
{
"Name": "HomeGroupProvider",
2023-10-19 17:12:55 -05:00
"StartupType": "Manual",
2022-10-18 08:08:23 -05:00
"OriginalType": "Automatic"
}
]
},
"EssTweaksTele": {
"ScheduledTask" : [
{
"Name": "Microsoft\\Windows\\Application Experience\\Microsoft Compatibility Appraiser",
2023-10-19 17:12:55 -05:00
"State": "Disabled",
2022-10-18 08:08:23 -05:00
"OriginalState": "Enabled"
2023-10-19 17:12:55 -05:00
},
2022-10-18 08:08:23 -05:00
{
"Name": "Microsoft\\Windows\\Application Experience\\ProgramDataUpdater",
2023-10-19 17:12:55 -05:00
"State": "Disabled",
2022-10-18 08:08:23 -05:00
"OriginalState": "Enabled"
}
]
},
"EssTweaksDeBloat": {
"appx": [
"Microsoft.Microsoft3DViewer",
"Microsoft.AppConnector"
]
},
"EssTweaksOO": {
"InvokeScript": [
"Import-Module BitsTransfer
Start-BitsTransfer -Source \"https://raw.githubusercontent.com/ChrisTitusTech/win10script/master/ooshutup10.cfg\" -Destination C:\\Windows\\Temp\\ooshutup10.cfg
Start-BitsTransfer -Source \"https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe\" -Destination C:\\Windows\\Temp\\OOSU10.exe
2023-10-19 17:12:55 -05:00
C:\\Windows\\Temp\\OOSU10.exe C:\\Windows\\Temp\\ooshutup10.cfg /quiet"
2022-10-18 08:08:23 -05:00
]
}
}
#>
2023-10-19 17:12:55 -05:00
# Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request.
# Make sure to uncomment the sections you which to add.
2022-10-18 08:08:23 -05:00
#$Registry = @(
2023-10-19 17:12:55 -05:00
# # To add more repeat this separated by a comma
2022-10-18 08:08:23 -05:00
# @{
# Path = ""
# Name = ""
# Type = ""
# Value = ""
# OriginalValue = ""
# }
#)
#$Service = @(
2023-10-19 17:12:55 -05:00
# # To add more repeat this separated by a comma
2022-10-18 08:08:23 -05:00
# @{
# Name = ""
# StartupType = ""
# OriginalType = ""
# }
#)
#$ScheduledTask = @(
2023-10-19 17:12:55 -05:00
# # To add more repeat this separated by a comma
2022-10-18 08:08:23 -05:00
# @{
# Name = ""
# State = ""
# OriginalState = ""
# }
#)
#$Appx = @(
# ""
#)
#$InvokeScript = @(
2023-10-19 17:12:55 -05:00
# ""
2022-10-18 08:08:23 -05:00
#)
#$UndoScript = @(
2023-10-19 17:12:55 -05:00
# ""
2022-10-18 08:08:23 -05:00
#)
+3
2023-03-07 12:28:00 -08:00
$NameofButton = "WPF" + ""
2022-10-18 08:08:23 -05:00
$ButtonToAdd = New-Object psobject
$jsonfile = Get-Content ./config/tweaks.json | ConvertFrom-Json
2023-10-19 17:12:55 -05:00
# Remove if already exists
2022-10-18 08:08:23 -05:00
if($jsonfile.$NameofButton){
$jsonfile.psobject.Properties.remove($NameofButton)
}
if($Registry){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "registry" -Value $Registry}
if($Service){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "service" -Value $Service}
if($ScheduledTask){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "ScheduledTask" -Value $ScheduledTask}
if($Appx){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "Appx" -Value $Appx}
if($InvokeScript){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "InvokeScript" -Value $InvokeScript}
if($UndoScript){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "UndoScript" -Value $UndoScript}
Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofButton -Value $ButtonToAdd
($jsonfile | ConvertTo-Json -Depth 5).replace('\r\n',"`r`n") | Out-File ./config/tweaks.json
+3
2023-03-07 12:28:00 -08:00
#===========================================================================
# dns.json
#===========================================================================
<#
dns.json
-----------------
2023-08-02 19:43:52 -05:00
This file holds all the DNS entries.
+3
2023-03-07 12:28:00 -08:00
The structure of the json is as follows
{
"DNS Provider": [
"Primary": "IP address",
"Secondary": "IP address"
]
}
Example:
{
"Cloudflare":{
"Primary": "1.1.1.1",
"Secondary": "1.0.0.1"
}
2023-10-19 17:12:55 -05:00
}
+3
2023-03-07 12:28:00 -08:00
#>
2023-10-19 17:12:55 -05:00
# Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request.
+3
2023-03-07 12:28:00 -08:00
$NameofProvider = "" -replace " ","_"
$IPAddress = @{
"Primary" = "0.0.0.0"
"Secondary" = "0.0.0.0"
}
$ButtonToAdd = New-Object psobject
$jsonfile = Get-Content ./config/dns.json | ConvertFrom-Json
2023-10-19 17:12:55 -05:00
# Remove if already exists
+3
2023-03-07 12:28:00 -08:00
if($jsonfile.$NameofProvider){
$jsonfile.psobject.Properties.remove($NameofProvider)
}
Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofProvider -Value $IPAddress
($jsonfile | ConvertTo-Json -Depth 5).replace('\r\n',"`r`n") | Out-File ./config/dns.json