Compare commits

..

5 commits

4 changed files with 40 additions and 10 deletions

View file

@ -89,6 +89,10 @@ $null = New-Module {
fish -c ". $(ConvertTo-LinuxPath $scriptPath); $Script" | ConvertFrom-Json;
}
if (-not $?) {
throw "The configuration could not be retrieved!";
}
}
<#

View file

@ -1,6 +1,7 @@
. "$PSScriptRoot/Config.ps1";
. "$PSScriptRoot/../Types/OneShotTask.ps1";
. "$PSScriptRoot/../../Windows/Scripts/PowerManagement.ps1";
. "$PSScriptRoot/../../Windows/Scripts/Registry.ps1";
$null = New-Module {
. "$PSScriptRoot/../Types/OneShotTask.ps1";
@ -28,6 +29,7 @@ $null = New-Module {
$env:CONFIG_MODULE = Resolve-Path $env:CONFIG_MODULE;
}
Disable-WindowsUpdateAutoRestart;
New-Alias -Force "sudo" gsudo;
& $Action;
}

View file

@ -193,9 +193,19 @@ $null = New-Module {
& {
$driverPath = "$PSScriptRoot/../Drivers";
$mbPath = "$driverPath/ROG Zenith Extreme Alpha";
if ($install) {
if (Get-Config "valhalla.hardware.elgatoWave") {
if (-not (Test-ChocoPackage wavelink)) {
Install-ChocoPackage wavelink -ArgumentList '--install-arguments="/norestart"';
Remove-DesktopIcon "*Wave Link*";
Restart-Intermediate;
exit;
}
}
}
foreach ($component in (Get-Config "valhalla.hardware.components")) {
switch ($component) {
("ROG Zenith Extreme Alpha") {
& "$mbPath/MarvellEthernet/Manage.ps1" @arguments;
@ -224,15 +234,6 @@ $null = New-Module {
if (Get-Config "valhalla.hardware.corsairDevice") {
Install-ChocoPackage icue;
}
if (Get-Config "valhalla.hardware.elgatoWave") {
if (-not (Test-ChocoPackage wavelink)) {
Install-ChocoPackage wavelink -ArgumentList '--install-arguments="/norestart"';
Remove-DesktopIcon "*Wave Link*";
Restart-Intermediate;
exit;
}
}
}
if (Get-Config "valhalla.hardware.eyeX") {

View file

@ -1,6 +1,8 @@
using namespace Microsoft.Win32;
$null = New-Module {
$wuPolicyPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate";
function Edit-DefaultUserKey {
param(
[scriptblock] $Action
@ -53,4 +55,25 @@ $null = New-Module {
function Disable-BootMessage {
Set-BootMessage;
}
<#
.SYNOPSIS
Disables automatic reboots by Windows Update.
#>
function Disable-WindowsUpdateAutoRestart {
$path = "$wuPolicyPath\AU";
New-Item -Force $path -ErrorAction SilentlyContinue;
Set-ItemProperty $path `
-Name NoAutoRebootWithLoggedOnUsers `
-Value $Value;
}
<#
.SYNOPSIS
Resets the automatic reboot state.
#>
function Reset-WindowsUpdateAutoRestart {
Remove-Item -Recurse "$wuPolicyPath";
}
}