PowerShell_Scripts/docker/dcdown.ps1

16 lines
723 B
PowerShell
Raw Normal View History

[CmdletBinding(SupportsShouldProcess)]param(
2021-03-23 01:06:49 -04:00
[ArgumentCompleter({Invoke-Command -ScriptBlock $_DockerComposeDirsCompleter -ArgumentList $args})]
[string[]]$ProjectPath,
[switch]$Recurse,
[int]$Depth=1,
[Parameter(Position = 0, ValueFromRemainingArguments = $true)]
2021-03-23 01:06:49 -04:00
[ArgumentCompleter({Invoke-Command -ScriptBlock $_DockerComposeCompleter -ArgumentList ($args+@('down'))})]
[array]$CliParams=@('--timeout=3','--volumes','--remove-orphans')
)
if( -not $CliParams -or $CliParams[0] -is [string] ) { $CliParams = @($CliParams,@($null)) }
2021-03-23 01:06:49 -04:00
$CliParams[0] = @('&') + $CliParams[0]
2021-03-23 01:06:49 -04:00
Invoke-DockerCompose -ProjectPath $ProjectPath -dcCommand 'down' -CliParams $CliParams -Recurse:$Recurse -Depth $Depth