Allow skipping the Action argument

This commit is contained in:
Manuel Thalmann 2024-08-08 02:56:28 +02:00
parent 69925fac74
commit 76ba329ad2

View file

@ -149,10 +149,18 @@ $null = New-Module {
[scriptblock] $Installer = { },
[scriptblock] $Configurator = { },
[scriptblock] $UserConfigurator = { },
[InstallerAction] $Action = [InstallerAction]::Install,
[Nullable[InstallerAction]] $Action,
[hashtable] $Arguments
)
[InstallerAction] $Action = & {
if ($Action.HasValue) {
$Action;
} else {
[InstallerAction]::Install;
}
};
if (-not $Name) {
$Name = Split-Path -Leaf (Split-Path -Parent ((Get-PSCallStack)[1].ScriptName));
}