2021-05-23 20:13:28 +00:00
|
|
|
[CmdletBinding(SupportsShouldProcess)]param(
|
2022-02-05 21:20:25 +00:00
|
|
|
[Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName)]
|
|
|
|
[Alias('Slug')]
|
2021-05-23 20:13:28 +00:00
|
|
|
[string[]]$AddOnSlug,
|
|
|
|
[switch]$NoPatternMatch
|
|
|
|
)
|
|
|
|
|
2022-02-05 21:20:25 +00:00
|
|
|
begin{}
|
|
|
|
process{
|
|
|
|
foreach( $slug in $AddOnSlug ) {
|
|
|
|
Get-HA_Addon 'Running' -AddOnSlug:$slug -NoPatternMatch:$NoPatternMatch | ForEach-Object {
|
|
|
|
$local:a = $_
|
|
|
|
$local:invocation = Invoke-HomeAssistantCli addons stop $a.slug
|
|
|
|
Get-HA_Addon -InspectContainer -NoPatternMatch -AddOnSlug $a.slug |
|
|
|
|
Select-Object @{
|
|
|
|
L='result';E={$invocation.result}
|
|
|
|
},@{
|
|
|
|
L='data';E={$invocation.data}
|
|
|
|
},*
|
|
|
|
}
|
|
|
|
}
|
2021-05-23 20:13:28 +00:00
|
|
|
}
|
2022-02-05 21:20:25 +00:00
|
|
|
end{}
|