2021-01-13 06:02:37 +00:00
|
|
|
[CmdletBinding(SupportsShouldProcess)]param(
|
2021-03-23 05:06:49 +00:00
|
|
|
[ArgumentCompleter({Invoke-Command -ScriptBlock $_DockerComposeDirsCompleter -ArgumentList $args})]
|
2021-01-15 06:15:54 +00:00
|
|
|
[string[]]$ProjectPath,
|
|
|
|
[switch]$Recurse,
|
|
|
|
[int]$Depth=1,
|
|
|
|
[switch]$NoLogs,
|
|
|
|
[switch]$NoPull,
|
2021-03-23 05:06:49 +00:00
|
|
|
[ArgumentCompleter({Invoke-Command -ScriptBlock $_DockerComposeCompleter -ArgumentList ($args+@('pull'))})]
|
2021-01-15 06:15:54 +00:00
|
|
|
[array]$PullParams,
|
2021-03-23 05:06:49 +00:00
|
|
|
[ArgumentCompleter({Invoke-Command -ScriptBlock $_DockerComposeCompleter -ArgumentList ($args+@('logs'))})]
|
2021-01-15 06:15:54 +00:00
|
|
|
[array]$LogsParams,
|
2021-03-23 05:06:49 +00:00
|
|
|
[ArgumentCompleter({Invoke-Command -ScriptBlock $_DockerComposeCompleter -ArgumentList ($args+@('up'))})]
|
2021-02-04 00:43:12 +00:00
|
|
|
[array]$UpParams=@('-d','--remove-orphans'),
|
2021-01-13 06:02:37 +00:00
|
|
|
[Parameter(Position = 0, ValueFromRemainingArguments = $true)]
|
2021-03-23 05:06:49 +00:00
|
|
|
[ArgumentCompleter({Invoke-Command -ScriptBlock $_DockerComposeCompleter -ArgumentList ($args+@('up'))})]
|
2021-01-15 06:15:54 +00:00
|
|
|
[array]$Containers
|
2021-01-13 06:02:37 +00:00
|
|
|
)
|
2020-10-31 21:10:32 +00:00
|
|
|
|
2021-01-15 06:15:54 +00:00
|
|
|
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]
|
|
|
|
|
2021-01-13 06:02:37 +00:00
|
|
|
$local:passParams = [ordered]@{
|
|
|
|
ProjectPath=$ProjectPath
|
2021-01-15 06:15:54 +00:00
|
|
|
Recurse=$Recurse
|
|
|
|
Depth=$Depth
|
|
|
|
NoLogs=$NoLogs
|
|
|
|
NoPull=$NoPull
|
|
|
|
PullParams=$PullParams
|
|
|
|
LogsParams=$LogsParams
|
|
|
|
UpParams=$UpParams
|
|
|
|
Containers=$Containers
|
2020-10-31 21:10:32 +00:00
|
|
|
}
|
2021-01-13 06:02:37 +00:00
|
|
|
dcup @passParams
|