PowerShell_Scripts/docker/dcr.ps1

13 lines
582 B
PowerShell

[CmdletBinding(SupportsShouldProcess)]param(
[ArgumentCompleter({Invoke-Command -ScriptBlock $_DockerComposeDirsCompleter -ArgumentList $args})]
[string[]]$ProjectPath=@($PWD),
[Parameter(Position = 0, ValueFromRemainingArguments = $true)]
[ArgumentCompleter({Invoke-Command -ScriptBlock $_DockerComposeCompleter -ArgumentList ($args+@('run'))})]
[array]$CliParams=@('--rm')
)
if( $CliParams[0] -is [string] ) { $CliParams = @($CliParams,@($null)) }
$CliParams[0] = @('run') + $CliParams[0]
Invoke-DockerCompose -ProjectPath $ProjectPath -CliParams $CliParams