Redirect parameters using args

This commit is contained in:
Manuel Thalmann 2024-09-30 05:00:20 +02:00
parent 68e679224f
commit 14b0ffe24b
47 changed files with 75 additions and 366 deletions

View file

@ -14,8 +14,11 @@ $null = New-Module {
[scriptblock] $Configurator = $null, [scriptblock] $Configurator = $null,
[scriptblock] $UserBackup = $null, [scriptblock] $UserBackup = $null,
[scriptblock] $UserConfigurator = $null, [scriptblock] $UserConfigurator = $null,
[Parameter(Position = 0)]
[Nullable[InstallerAction]] $Action, [Nullable[InstallerAction]] $Action,
[Parameter(Position = 1)]
[hashtable] $Arguments, [hashtable] $Arguments,
[Parameter()]
[hashtable] $Context [hashtable] $Context
) )

View file

@ -1,14 +1,9 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../aliae/Manage.ps1"; . "$PSScriptRoot/../aliae/Manage.ps1";
. "$PSScriptRoot/../PowerShell/Profile.ps1"; . "$PSScriptRoot/../PowerShell/Profile.ps1";
. "$PSScriptRoot/../../Scripts/Software.ps1"; . "$PSScriptRoot/../../Scripts/Software.ps1";
. "$PSScriptRoot/../../Types/InstallerAction.ps1"; . "$PSScriptRoot/../../Types/InstallerAction.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Configurator { -Configurator {
param([string] $Name) param([string] $Name)

View file

@ -1,13 +1,8 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/Software.ps1"; . "$PSScriptRoot/../../Scripts/Software.ps1";
. "$PSScriptRoot/../../Software/PowerShell/Profile.ps1"; . "$PSScriptRoot/../../Software/PowerShell/Profile.ps1";
. "$PSScriptRoot/../../Types/InstallerAction.ps1"; . "$PSScriptRoot/../../Types/InstallerAction.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Configurator { -Configurator {
[string] $globalDir = $null; [string] $globalDir = $null;
$indicator = "# Profile Files"; $indicator = "# Profile Files";

View file

@ -1,15 +1,5 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../PowerShell/Module.ps1"; . "$PSScriptRoot/../PowerShell/Module.ps1";
. "$PSScriptRoot/../../Scripts/Software.ps1"; . "$PSScriptRoot/../../Scripts/Software.ps1";
$parameters = Get-ModuleInstallerComponents "Terminal-Icons"; $parameters = Get-ModuleInstallerComponents "Terminal-Icons";
Start-SoftwareInstaller @args @parameters;
foreach ($key in $PSBoundParameters.Keys) {
$parameters.Add($key, $PSBoundParameters[$key]);
}
Start-SoftwareInstaller @parameters;

View file

@ -1,13 +1,8 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/Constants.ps1"; . "$PSScriptRoot/Constants.ps1";
. "$PSScriptRoot/../PowerShell/Profile.ps1"; . "$PSScriptRoot/../PowerShell/Profile.ps1";
. "$PSScriptRoot/../../Scripts/Software.ps1"; . "$PSScriptRoot/../../Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Configurator { -Configurator {
param([string] $Name) param([string] $Name)
. "$PSScriptRoot/Constants.ps1"; . "$PSScriptRoot/Constants.ps1";

View file

@ -1,17 +1,8 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/Software.ps1"; . "$PSScriptRoot/../../Scripts/Software.ps1";
. "$PSScriptRoot/../../Scripts/System.ps1"; . "$PSScriptRoot/../../Scripts/System.ps1";
. "$PSScriptRoot/../../Types/InstallerAction.ps1"; . "$PSScriptRoot/../../Types/InstallerAction.ps1";
& { & {
param(
[hashtable] $Parameters
)
$configure = { $configure = {
param( param(
[string] $User [string] $User
@ -100,9 +91,9 @@ param (
} }
}; };
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Configurator { -Configurator {
& $configure; & $configure @args;
} ` } `
-UserConfigurator { -UserConfigurator {
param( param(
@ -111,4 +102,4 @@ param (
& $configure -User $Arguments.Name; & $configure -User $Arguments.Name;
}; };
} $PSBoundParameters; } @args;

View file

@ -1,15 +1,5 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../PowerShell/Module.ps1"; . "$PSScriptRoot/../PowerShell/Module.ps1";
. "$PSScriptRoot/../../Scripts/Software.ps1"; . "$PSScriptRoot/../../Scripts/Software.ps1";
$parameters = Get-ModuleInstallerComponents "posh-git"; $parameters = Get-ModuleInstallerComponents "posh-git";
Start-SoftwareInstaller @args @parameters;
foreach ($key in $PSBoundParameters.Keys) {
$parameters.Add($key, $PSBoundParameters[$key]);
}
Start-SoftwareInstaller @parameters;

View file

@ -1,12 +1,7 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../../Common/Scripts/SoftwareManagement.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-UserConfigurator { -UserConfigurator {
param( param(
$Arguments $Arguments

View file

@ -1,12 +1,7 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../PowerShell/Profile.ps1"; . "$PSScriptRoot/../PowerShell/Profile.ps1";
. "$PSScriptRoot/../../Scripts/Software.ps1"; . "$PSScriptRoot/../../Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Configurator { -Configurator {
param([string] $Name) param([string] $Name)

View file

@ -1,11 +1,6 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-AmdPackage "https://www.amd.com/en/support/downloads/drivers.html/chipsets/tr4/x399.html"; Install-AmdPackage "https://www.amd.com/en/support/downloads/drivers.html/chipsets/tr4/x399.html";
}; };

View file

@ -1,12 +1,7 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1"; . "$PSScriptRoot/../../../Common/Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
$dir = New-TemporaryDirectory; $dir = New-TemporaryDirectory;
$file = "driver.zip"; $file = "driver.zip";

View file

@ -1,11 +1,6 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-AsusPackage "https://dlcdnets.asus.com/pub/ASUS/mb/03CHIPSET/DRV_Chipset_AMD_TRX40_TP_TSD_W10_64_V30901140_20211006R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA"; Install-AsusPackage "https://dlcdnets.asus.com/pub/ASUS/mb/03CHIPSET/DRV_Chipset_AMD_TRX40_TP_TSD_W10_64_V30901140_20211006R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA";
}; };

View file

@ -1,11 +1,6 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-AsusPackage "https://dlcdnets.asus.com/pub/ASUS/mb/02BT/DRV_Bluetooth_Intel_9260_TP_W11_64_V2210002_20211222R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA"; Install-AsusPackage "https://dlcdnets.asus.com/pub/ASUS/mb/02BT/DRV_Bluetooth_Intel_9260_TP_W11_64_V2210002_20211222R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA";
}; };

View file

@ -1,11 +1,6 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-AsusPackage "https://dlcdnets.asus.com/pub/ASUS/mb/08WIRELESS/DRV_WiFi_Intel_TP_W11_64_V2219004_20230130R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA"; Install-AsusPackage "https://dlcdnets.asus.com/pub/ASUS/mb/08WIRELESS/DRV_WiFi_Intel_TP_W11_64_V2219004_20230130R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA";
}; };

View file

@ -1,11 +1,6 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-AsusPackage "https://dlcdnets.asus.com/pub/ASUS/mb/04LAN/DRV_LAN_Marvell_TP_TSD_W11_64_V3130_20211118R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA"; Install-AsusPackage "https://dlcdnets.asus.com/pub/ASUS/mb/04LAN/DRV_LAN_Marvell_TP_TSD_W11_64_V3130_20211118R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA";
}; };

View file

@ -1,11 +1,4 @@
param(
$Action,
[hashtable] $Arguments
)
& { & {
param($parameters);
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
$softwarePath = "$PSScriptRoot/../../Software"; $softwarePath = "$PSScriptRoot/../../Software";
@ -15,7 +8,7 @@ param(
"$softwarePath/TobiiGameHub/Manage.ps1" "$softwarePath/TobiiGameHub/Manage.ps1"
); );
Start-SoftwareInstaller @parameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-SetupPackage -Source "https://files.update.tech.tobii.com/Tobii_Eye_Tracking_Core_v2.16.8.214_x86.exe"; Install-SetupPackage -Source "https://files.update.tech.tobii.com/Tobii_Eye_Tracking_Core_v2.16.8.214_x86.exe";
@ -28,4 +21,4 @@ param(
. $script -Action ([InstallerAction]::ConfigureUser) @parameters; . $script -Action ([InstallerAction]::ConfigureUser) @parameters;
} }
}; };
} $PSBoundParameters; } @args;

View file

@ -1,13 +1,8 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1"; . "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage vcredist140; Install-ChocoPackage vcredist140;
Install-SetupPackage "https://github.com/bobranten/Ext4Fsd/releases/download/v0.71/Ext2Fsd-0.71-setup.exe"; Install-SetupPackage "https://github.com/bobranten/Ext4Fsd/releases/download/v0.71/Ext2Fsd-0.71-setup.exe";

View file

@ -1,13 +1,8 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/AppAssociations.ps1"; . "$PSScriptRoot/../../Scripts/AppAssociations.ps1";
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage firefox; Install-ChocoPackage firefox;
} ` } `

View file

@ -1,10 +1,4 @@
param(
$Action,
[hashtable] $Arguments
)
& { & {
param ($Parameters)
. "$PSScriptRoot/../../Scripts/Restoration.ps1"; . "$PSScriptRoot/../../Scripts/Restoration.ps1";
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
@ -57,7 +51,7 @@ param(
} }
} }
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage lghub; Install-ChocoPackage lghub;
Remove-DesktopIcon "*G HUB*"; Remove-DesktopIcon "*G HUB*";
@ -83,4 +77,4 @@ param(
Expand-BackupArtifacts -User $Arguments.Name -Path "$Name" -Target $configPath; Expand-BackupArtifacts -User $Arguments.Name -Path "$Name" -Target $configPath;
}; };
}; };
} $PSBoundParameters; } @args;

View file

@ -1,12 +1,7 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage MSEdgeRedirect; Install-ChocoPackage MSEdgeRedirect;
} ` } `

View file

@ -1,17 +1,11 @@
param(
$Action,
[hashtable] $Arguments
)
& { & {
param($Parameters)
. "$PSScriptRoot/../../Scripts/Restoration.ps1"; . "$PSScriptRoot/../../Scripts/Restoration.ps1";
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1"; . "$PSScriptRoot/../../../Common/Scripts/System.ps1";
$path = "$HOME/Documents/ManiaPlanet"; $path = "$HOME/Documents/ManiaPlanet";
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-WingetPackage Nadeo.ManiaPlanet; Install-WingetPackage Nadeo.ManiaPlanet;
Remove-DesktopIcon "ManiaPlanet*"; Remove-DesktopIcon "ManiaPlanet*";
@ -44,4 +38,4 @@ param(
Expand-BackupArtifacts -User $Arguments.Name -Path "$Name" -Target $path; Expand-BackupArtifacts -User $Arguments.Name -Path "$Name" -Target $path;
}; };
} $PSBoundParameters; } @args;

View file

@ -1,16 +1,11 @@
using namespace System.Security.AccessControl; using namespace System.Security.AccessControl;
using namespace System.Security.Principal; using namespace System.Security.Principal;
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/Security.ps1"; . "$PSScriptRoot/../../Scripts/Security.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1"; . "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
$env:NVS_HOME = "$env:ProgramData\nvs"; $env:NVS_HOME = "$env:ProgramData\nvs";
git clone "https://github.com/jasongin/nvs.git" $env:NVS_HOME; git clone "https://github.com/jasongin/nvs.git" $env:NVS_HOME;

View file

@ -1,14 +1,7 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/PowerManagement.ps1"; . "$PSScriptRoot/../../Scripts/PowerManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
& { & {
param($Parameters)
<# <#
.SYNOPSIS .SYNOPSIS
Gets the path to the Nextcloud configuration file. Gets the path to the Nextcloud configuration file.
@ -85,7 +78,7 @@ param(
} }
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage nextcloud-client -ArgumentList "-y","--params='/KeepUpdateCheck'"; Install-ChocoPackage nextcloud-client -ArgumentList "-y","--params='/KeepUpdateCheck'";
} ` } `
@ -122,4 +115,4 @@ param(
} }
}; };
}; };
} $PSBoundParameters; } @args;

View file

@ -1,24 +1,18 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1"; . "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
& { & {
param($Parameters)
$base = "$PSScriptRoot/../../../Common/Software/Oh My Posh/Manage.ps1"; $base = "$PSScriptRoot/../../../Common/Software/Oh My Posh/Manage.ps1";
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-WingetPackage JanDeDobbeleer.OhMyPosh -ArgumentList "--scope","machine"; Install-WingetPackage JanDeDobbeleer.OhMyPosh -ArgumentList "--scope","machine";
} ` } `
-Configurator { -Configurator {
. $base -Action ([InstallerAction]::Configure); . $base -Action ([InstallerAction]::Configure) @args;
} ` } `
-UserConfigurator { -UserConfigurator {
. $base -Action ([InstallerAction]::ConfigureUser); . $base -Action ([InstallerAction]::ConfigureUser) @args;
}; };
} $PSBoundParameters; } @args;

View file

@ -1,13 +1,8 @@
using namespace Microsoft.Win32; using namespace Microsoft.Win32;
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Configurator { -Configurator {
Set-Service ssh-agent -StartupType AutomaticDelayedStart; Set-Service ssh-agent -StartupType AutomaticDelayedStart;
}; };

View file

@ -1,8 +1,3 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Software/PowerShell/Module.ps1"; . "$PSScriptRoot/../../../Common/Software/PowerShell/Module.ps1";
@ -15,7 +10,7 @@ foreach ($key in $PSBoundParameters.Keys) {
$context = $parameters.context; $context = $parameters.context;
$context.Add("Installer", $parameters.installer); $context.Add("Installer", $parameters.installer);
Start-SoftwareInstaller @parameters -Installer { Start-SoftwareInstaller @args @parameters -Installer {
param( param(
[hashtable] $Context [hashtable] $Context
) )

View file

@ -1,12 +1,7 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1"; . "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Configurator { -Configurator {
. "$PSScriptRoot/../../../Common/Software/PowerShell/Manage.ps1" ` . "$PSScriptRoot/../../../Common/Software/PowerShell/Manage.ps1" `
-Action ([InstallerAction]::Configure); -Action ([InstallerAction]::Configure);

View file

@ -1,16 +1,11 @@
using namespace Microsoft.Win32; using namespace Microsoft.Win32;
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/Restoration.ps1"; . "$PSScriptRoot/../../Scripts/Restoration.ps1";
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1"; . "$PSScriptRoot/../../../Common/Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage putty; Install-ChocoPackage putty;
} ` } `

View file

@ -1,17 +1,11 @@
param(
$Action,
[hashtable] $Arguments
)
& { & {
param($Parameters)
. "$PSScriptRoot/../../Scripts/Restoration.ps1"; . "$PSScriptRoot/../../Scripts/Restoration.ps1";
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1"; . "$PSScriptRoot/../../../Common/Scripts/System.ps1";
$path = "C:/tools/RetroArch-Win64"; $path = "C:/tools/RetroArch-Win64";
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Backup { -Backup {
param([string] $Name) param([string] $Name)
@ -36,4 +30,4 @@ param(
Add-StartMenuIcon "RetroArch" "C:\tools\RetroArch-Win64\retroarch.exe"; Add-StartMenuIcon "RetroArch" "C:\tools\RetroArch-Win64\retroarch.exe";
Expand-BackupArtifacts -Path "$Name" -Target $path; Expand-BackupArtifacts -Path "$Name" -Target $path;
}; };
} $PSBoundParameters; } @args;

View file

@ -1,15 +1,10 @@
using namespace Microsoft.Win32; using namespace Microsoft.Win32;
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/AppAssociations.ps1"; . "$PSScriptRoot/../../Scripts/AppAssociations.ps1";
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage thunderbird -ArgumentList "--params",'"/NoTaskbarShortcut /NoDesktopShortcut"' Install-ChocoPackage thunderbird -ArgumentList "--params",'"/NoTaskbarShortcut /NoDesktopShortcut"'
} ` } `

View file

@ -1,15 +1,10 @@
using namespace Microsoft.Win32; using namespace Microsoft.Win32;
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1"; . "$PSScriptRoot/../../../Common/Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage "vcredist2013"; Install-ChocoPackage "vcredist2013";
} ` } `

View file

@ -1,13 +1,8 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1"; . "$PSScriptRoot/../../../Common/Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage "dotnet-6.0-desktopruntime"; Install-ChocoPackage "dotnet-6.0-desktopruntime";
} ` } `

View file

@ -1,8 +1,3 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../TrackMania United Forever/Manage.ps1"; . "$PSScriptRoot/../TrackMania United Forever/Manage.ps1";
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
@ -14,8 +9,4 @@ $parameters = Get-TMForeverInstallerComponents `
Install-WingetPackage Nadeo.TrackManiaNationsForever; Install-WingetPackage Nadeo.TrackManiaNationsForever;
}; };
foreach ($key in $PSBoundParameters.Keys) { Start-SoftwareInstaller @args @parameters;
$parameters.Add($key, $PSBoundParameters[$key]);
}
Start-SoftwareInstaller @parameters;

View file

@ -1,8 +1,3 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/Manage.ps1"; . "$PSScriptRoot/Manage.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
@ -23,8 +18,4 @@ $parameters = Get-TMForeverInstallerComponents `
Remove-Item -Recurse $dir; Remove-Item -Recurse $dir;
}; };
foreach ($key in $PSBoundParameters.Keys) { Start-SoftwareInstaller @args @parameters;
$parameters.Add($key, $PSBoundParameters[$key]);
}
Start-SoftwareInstaller @parameters;

View file

@ -1,13 +1,8 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1"; . "$PSScriptRoot/../../../Common/Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Write-Information "Downgrading AutoHotkey…"; Write-Information "Downgrading AutoHotkey…";
$id = "AutoHotkey.AutoHotkey"; $id = "AutoHotkey.AutoHotkey";

View file

@ -1,11 +1,4 @@
param(
$Action,
[hashtable] $Arguments
)
& { & {
param($parameters)
. "$PSScriptRoot/../../Scripts/Restoration.ps1"; . "$PSScriptRoot/../../Scripts/Restoration.ps1";
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/BrowserAutomation.ps1"; . "$PSScriptRoot/../../../Common/Scripts/BrowserAutomation.ps1";
@ -47,7 +40,7 @@ param(
return Join-Path "$Name" "$PackageName.vsconfig"; return Join-Path "$Name" "$PackageName.vsconfig";
} }
Start-SoftwareInstaller @parameters ` Start-SoftwareInstaller @args `
-Backup { -Backup {
param([string] $Name) param([string] $Name)
@ -88,4 +81,4 @@ param(
Remove-DesktopIcon "CocosCreator*"; Remove-DesktopIcon "CocosCreator*";
Remove-DesktopIcon "Unity Hub*"; Remove-DesktopIcon "Unity Hub*";
}; };
} $PSBoundParameters; } @args;

View file

@ -1,16 +1,11 @@
using namespace Microsoft.Win32; using namespace Microsoft.Win32;
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/AppAssociations.ps1"; . "$PSScriptRoot/../../Scripts/AppAssociations.ps1";
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1"; . "$PSScriptRoot/../../../Common/Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage winscp; Install-ChocoPackage winscp;
} ` } `

View file

@ -1,16 +1,9 @@
using namespace Microsoft.Win32; using namespace Microsoft.Win32;
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1"; . "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
& { & {
param($Parameters)
. "$PSScriptRoot/../../Scripts/Registry.ps1"; . "$PSScriptRoot/../../Scripts/Registry.ps1";
. "$PSScriptRoot/../../Scripts/Restoration.ps1"; . "$PSScriptRoot/../../Scripts/Restoration.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Config.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Config.ps1";
@ -34,7 +27,7 @@ param(
[string[]] $homeExclusions = Get-Content "$PSScriptRoot/Home.exclude.txt"; [string[]] $homeExclusions = Get-Content "$PSScriptRoot/Home.exclude.txt";
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Backup { -Backup {
Add-BackupArtifacts -Source "$env:PUBLIC" -Path "Public" ` Add-BackupArtifacts -Source "$env:PUBLIC" -Path "Public" `
-Include ($userFolders) ` -Include ($userFolders) `
@ -171,4 +164,4 @@ param(
Expand-BackupArtifacts -User $Arguments.Name -Path "Home" -Target $HOME; Expand-BackupArtifacts -User $Arguments.Name -Path "Home" -Target $HOME;
}; };
} $PSBoundParameters; } @args;

View file

@ -1,24 +1,18 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1"; . "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
& { & {
param($Parameters)
$base = "$PSScriptRoot/../../../Common/Software/aliae/Main.ps1"; $base = "$PSScriptRoot/../../../Common/Software/aliae/Main.ps1";
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-WingetPackage JanDeDobbeleer.Aliae; Install-WingetPackage JanDeDobbeleer.Aliae;
} ` } `
-Configurator { -Configurator {
. $base -Action ([InstallerAction]::Configure); . $base -Action ([InstallerAction]::Configure) @args;
} ` } `
-UserConfigurator { -UserConfigurator {
. $base -Action ([InstallerAction]::ConfigureUser); . $base -Action ([InstallerAction]::ConfigureUser) @args;
}; };
} $PSBoundParameters; } @args;

View file

@ -1,14 +1,9 @@
using namespace Microsoft.Win32; using namespace Microsoft.Win32;
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Software/PowerShell/Profile.ps1"; . "$PSScriptRoot/../../../Common/Software/PowerShell/Profile.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Configurator { -Configurator {
param([string] $Name) param([string] $Name)
[string] $backup = $null; [string] $backup = $null;

View file

@ -1,22 +1,13 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Config.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Config.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1"; . "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
& { & {
param(
[hashtable] $Parameters
)
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1"; . "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
$base = "$PSScriptRoot/../../../Common/Software/git/Manage.ps1"; $base = "$PSScriptRoot/../../../Common/Software/git/Manage.ps1";
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
$params = "/WindowsTerminalProfile"; $params = "/WindowsTerminalProfile";
$defaultBranch = Get-OSConfig "git.defaultBranch"; $defaultBranch = Get-OSConfig "git.defaultBranch";
@ -28,13 +19,9 @@ param (
Install-ChocoPackage git -ArgumentList "--params",$params; Install-ChocoPackage git -ArgumentList "--params",$params;
} ` } `
-Configurator { -Configurator {
& $base ([InstallerAction]::Configure); & $base ([InstallerAction]::Configure) @args;
} ` } `
-UserConfigurator { -UserConfigurator {
param( & $base ([InstallerAction]::ConfigureUser) @args;
$Arguments
)
& $base ([InstallerAction]::ConfigureUser) @PSBoundParameterrs;
}; };
} $PSBoundParameters; } @args;

View file

@ -1,13 +1,7 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
& { & {
param($Parameters)
. "$PSScriptRoot/../../Scripts/Restoration.ps1"; . "$PSScriptRoot/../../Scripts/Restoration.ps1";
Export-ModuleMember -Function @(); Export-ModuleMember -Function @();
@ -15,7 +9,7 @@ param(
return "$((Get-KnownFolder -SpecialFolder ProgramFilesX86).Path)/osu!"; return "$((Get-KnownFolder -SpecialFolder ProgramFilesX86).Path)/osu!";
} }
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage osu; Install-ChocoPackage osu;
Remove-DesktopIcon "*osu*"; Remove-DesktopIcon "*osu*";
@ -51,4 +45,4 @@ param(
$name = $Arguments.Name; $name = $Arguments.Name;
Expand-BackupArtifacts -User $name -Path "$Name/osu!.cfg" -Target "$(& $getInstallPath)/osu!.$name.cfg"; Expand-BackupArtifacts -User $name -Path "$Name/osu!.cfg" -Target "$(& $getInstallPath)/osu!.$name.cfg";
}; };
} $PSBoundParameters; } @args;

View file

@ -1,17 +1,11 @@
param(
$Action,
[hashtable] $Arguments
)
& { & {
param($Parameters)
. "$PSScriptRoot/../../Scripts/Restoration.ps1"; . "$PSScriptRoot/../../Scripts/Restoration.ps1";
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1"; . "$PSScriptRoot/../../../Common/Scripts/System.ps1";
$path = "$env:AppData/osu"; $path = "$env:AppData/osu";
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-UserBackup { -UserBackup {
param( param(
[string] $Name, [string] $Name,
@ -54,4 +48,4 @@ param(
Remove-DesktopIcon "*osu*"; Remove-DesktopIcon "*osu*";
Expand-BackupArtifacts -User $Arguments.Name -Path "$Name" -Target $path; Expand-BackupArtifacts -User $Arguments.Name -Path "$Name" -Target $path;
}; };
} $PSBoundParameters; } @args;

View file

@ -1,10 +1,4 @@
param(
$Action,
[hashtable] $Arguments
)
& { & {
param($Parameters)
. "$PSScriptRoot/../../Scripts/Restoration.ps1"; . "$PSScriptRoot/../../Scripts/Restoration.ps1";
. "$PSScriptRoot/../../../Common/Scripts/BrowserAutomation.ps1"; . "$PSScriptRoot/../../../Common/Scripts/BrowserAutomation.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
@ -12,7 +6,7 @@ param(
$path = "$env:Public/Documents/reWASD"; $path = "$env:Public/Documents/reWASD";
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Backup { -Backup {
param([string] $Name) param([string] $Name)
@ -51,4 +45,4 @@ param(
param([string] $Name) param([string] $Name)
Expand-BackupArtifacts -Path "$Name" -Target $path; Expand-BackupArtifacts -Path "$Name" -Target $path;
}; };
} $PSBoundParameters; } @args;

View file

@ -1,29 +1,16 @@
param(
$Action,
[hashtable] $Arguments
)
& { & {
param (
[hashtable] $Parameters
)
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1"; . "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
$base = "$PSScriptRoot/../../../Common/Software/vscode/Main.ps1"; $base = "$PSScriptRoot/../../../Common/Software/vscode/Main.ps1";
Start-SoftwareInstaller @Parameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage vscode -ArgumentList "--params","/NoDesktopIcon"; Install-ChocoPackage vscode -ArgumentList "--params","/NoDesktopIcon";
Install-ChocoPackage vscodium -ArgumentList "--params","/NoDesktopIcon /AssociateWithFiles"; Install-ChocoPackage vscodium -ArgumentList "--params","/NoDesktopIcon /AssociateWithFiles";
refreshenv; refreshenv;
} ` } `
-UserConfigurator { -UserConfigurator {
param( & $base ([InstallerAction]::ConfigureUser) @args;
$Arguments
)
& $base ([InstallerAction]::ConfigureUser) @PSBoundParameters;
}; };
} $PSBoundParameters; } @args;

View file

@ -1,14 +1,7 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
& { & {
param($Parameters) Start-SoftwareInstaller @args `
Start-SoftwareInstaller @Parameters `
-Installer { -Installer {
$xamlDownloadLink = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx"; $xamlDownloadLink = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx";
$downloadLink = "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"; $downloadLink = "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle";
@ -20,4 +13,4 @@ param(
Add-AppxPackage "$file"; Add-AppxPackage "$file";
Remove-Item $file; Remove-Item $file;
}; };
} $PSBoundParameters; } @args;

View file

@ -1,29 +1,16 @@
param(
$Action,
[hashtable] $Arguments
)
& { & {
param(
[hashtable] $Parameters
)
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Software/PowerShell/Profile.ps1"; . "$PSScriptRoot/../../../Common/Software/PowerShell/Profile.ps1";
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1"; . "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
$base = "$PSScriptRoot/../../../Common/Software/zoxide/Main.ps1"; $base = "$PSScriptRoot/../../../Common/Software/zoxide/Main.ps1";
Start-SoftwareInstaller @PSBoundParameters ` Start-SoftwareInstaller @args `
-Installer { -Installer {
Install-ChocoPackage zoxide; Install-ChocoPackage zoxide;
Install-WingetPackage junegunn.fzf; Install-WingetPackage junegunn.fzf;
} ` } `
-Configurator { -Configurator {
param( & $base ([InstallerAction]::Configure) @args;
$Arguments
)
& $base ([InstallerAction]::Configure) @PSBoundParameters;
}; };
} $PSBoundParameters; } @args;