Allow skipping the Action
argument
This commit is contained in:
parent
d91beaae7b
commit
16f3c72eb3
1 changed files with 9 additions and 1 deletions
|
@ -149,10 +149,18 @@ $null = New-Module {
|
||||||
[scriptblock] $Installer = { },
|
[scriptblock] $Installer = { },
|
||||||
[scriptblock] $Configurator = { },
|
[scriptblock] $Configurator = { },
|
||||||
[scriptblock] $UserConfigurator = { },
|
[scriptblock] $UserConfigurator = { },
|
||||||
[InstallerAction] $Action = [InstallerAction]::Install,
|
[Nullable[InstallerAction]] $Action,
|
||||||
[hashtable] $Arguments
|
[hashtable] $Arguments
|
||||||
)
|
)
|
||||||
|
|
||||||
|
[InstallerAction] $Action = & {
|
||||||
|
if ($Action.HasValue) {
|
||||||
|
$Action;
|
||||||
|
} else {
|
||||||
|
[InstallerAction]::Install;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (-not $Name) {
|
if (-not $Name) {
|
||||||
$Name = Split-Path -Leaf (Split-Path -Parent ((Get-PSCallStack)[1].ScriptName));
|
$Name = Split-Path -Leaf (Split-Path -Parent ((Get-PSCallStack)[1].ScriptName));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue