Allow inheriting PowerShell installers

This commit is contained in:
Manuel Thalmann 2024-10-12 17:14:53 +02:00
parent 4504ca85d4
commit d9d1575a19
8 changed files with 64 additions and 97 deletions
scripts/Windows/Software/git

View file

@ -3,25 +3,15 @@
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
& {
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
$base = "$PSScriptRoot/../../../Common/Software/git/Manage.ps1";
Start-SoftwareInstaller @args `
-Inherit "$PSScriptRoot/../../../Common/Software/git/Manage.ps1" `
-Installer {
$params = "/WindowsTerminalProfile";
$defaultBranch = Get-OSConfig "git.defaultBranch";
Start-SoftwareInstaller @args `
-Installer {
$params = "/WindowsTerminalProfile";
$defaultBranch = Get-OSConfig "git.defaultBranch";
if ($defaultBranch) {
$params += " /DefaultBranchName:`"$defaultBranch`"";
}
if ($defaultBranch) {
$params += " /DefaultBranchName:`"$defaultBranch`"";
}
Install-ChocoPackage git -ArgumentList "--params", $params;
} `
-Configurator {
& $base ([InstallerAction]::Configure) @args;
} `
-UserConfigurator {
& $base ([InstallerAction]::ConfigureUser) @args;
};
} @args;
Install-ChocoPackage git -ArgumentList "--params", $params;
};