Fix installer script structure
This commit is contained in:
parent
94c7df6913
commit
d079f853bc
|
@ -1,10 +1,6 @@
|
||||||
. "$PSScriptRoot/Config.ps1";
|
. "$PSScriptRoot/Config.ps1";
|
||||||
. "$PSScriptRoot/../Types/InstallerAction.ps1";
|
. "$PSScriptRoot/../Types/InstallerAction.ps1";
|
||||||
|
|
||||||
$null = New-Module {
|
|
||||||
. "$PSScriptRoot/../Types/InstallerAction.ps1";
|
|
||||||
$userArgument = "name";
|
|
||||||
|
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Gets the name of the software.
|
Gets the name of the software.
|
||||||
|
@ -45,6 +41,10 @@ $null = New-Module {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
|
. "$PSScriptRoot/../Types/InstallerAction.ps1";
|
||||||
|
$userArgument = "name";
|
||||||
|
|
||||||
function Start-SoftwareInstaller {
|
function Start-SoftwareInstaller {
|
||||||
param(
|
param(
|
||||||
[InstallerAction] $Action,
|
[InstallerAction] $Action,
|
||||||
|
@ -68,7 +68,6 @@ $null = New-Module {
|
||||||
|
|
||||||
foreach ($user in Get-Users) {
|
foreach ($user in Get-Users) {
|
||||||
$Arguments.Add($userArgument, $user);
|
$Arguments.Add($userArgument, $user);
|
||||||
|
|
||||||
Start-SoftwareInstaller -Action ([InstallerAction]::ConfigureUser) @Arguments;
|
Start-SoftwareInstaller -Action ([InstallerAction]::ConfigureUser) @Arguments;
|
||||||
}
|
}
|
||||||
} elseif ($action -eq ([InstallerAction]::ConfigureUser)) {
|
} elseif ($action -eq ([InstallerAction]::ConfigureUser)) {
|
||||||
|
|
|
@ -1,9 +1,19 @@
|
||||||
param(
|
param(
|
||||||
[string] $Action = ([InstallerAction]::Install),
|
$Action,
|
||||||
[hashtable] $Arguments
|
[hashtable] $Arguments
|
||||||
)
|
)
|
||||||
|
|
||||||
. "$PSScriptRoot/../../Scripts/Software.ps1";
|
. "$PSScriptRoot/../../Scripts/Software.ps1";
|
||||||
|
. "$PSScriptRoot/../../Types/InstallerAction.ps1";
|
||||||
|
|
||||||
|
function Install-Winget {
|
||||||
|
param(
|
||||||
|
[InstallerAction] $Action = [InstallerAction]::Install,
|
||||||
|
[hashtable] $Arguments
|
||||||
|
)
|
||||||
|
|
||||||
|
Start-SoftwareInstaller -Action $Action -Arguments $Arguments;
|
||||||
|
}
|
||||||
|
|
||||||
function Install-Software {
|
function Install-Software {
|
||||||
$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";
|
||||||
|
@ -17,4 +27,4 @@ function Install-Software {
|
||||||
Remove-Item $file;
|
Remove-Item $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
Start-SoftwareInstaller -Action $Action -Arguments $Arguments;
|
Install-Winget @PSBoundParameters;
|
||||||
|
|
Loading…
Reference in a new issue