PowerShell_Scripts/docker/dcreup.ps1

42 lines
1.3 KiB
PowerShell
Raw Normal View History

[CmdletBinding(SupportsShouldProcess)]param(
[ArgumentCompleter({ param (
$commandName,
$parameterName,
$wordToComplete,
$commandAst,
$fakeBoundParameters
)
[DockerComposeDirs]::_GetValidValues($wordToComplete,$true)
})]
[string[]]$ProjectPath,
[switch]$Recurse,
[int]$Depth=1,
[switch]$NoLogs,
[switch]$NoPull,
[array]$PullParams,
[array]$LogsParams,
[array]$UpParams=@('-d','--remove-orphans'),
[Parameter(Position = 0, ValueFromRemainingArguments = $true)]
[array]$Containers
)
if( -not $Containers -or ($Containers[0] -is [string]) ) { $Containers = @($Containers,@($null)) }
if( -not $UpParams -or ($UpParams[0] -is [string]) ) { $UpParams = @($UpParams,@($null)) }
if( -not $PullParams -or ($PullParams[0] -is [string]) ) { $PullParams = @($PullParams,@($null)) }
if( -not $LogsParams -or ($LogsParams[0] -is [string]) ) { $LogsParams = @($LogsParams,@($null)) }
$UpParams[0] = @('--force-recreate') + $UpParams[0]
$local:passParams = [ordered]@{
ProjectPath=$ProjectPath
Recurse=$Recurse
Depth=$Depth
NoLogs=$NoLogs
NoPull=$NoPull
PullParams=$PullParams
LogsParams=$LogsParams
UpParams=$UpParams
Containers=$Containers
}
dcup @passParams