Functions/Public/Get-RancherSetting.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function Get-RancherSetting {
    [CmdletBinding()]
    param(
        [Parameter()]
        [switch]
        $Raw
    )

    $Secrets = Invoke-RancherApi -Path '/settings'

    if ($Raw) {
        $Secrets
        return
    }
    
    $Secrets | ForEach-Object {
        [pscustomobject]@{
            Id         = $_.id
            Type       = $_.type
            Name       = $_.name
            Source     = $_.source
            Value      = $_.value
            PSTypeName = 'RancherSetting'
        }
    }
}