internal/configurations/validation/sizestyle.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
Register-DbatoolsConfigValidation -Name "sizestyle" -ScriptBlock {
    param (
        $Value
    )

    $Result = New-Object PSObject -Property @{
        Success  = $True
        Value    = $null
        Message  = ""
    }

    try { [Sqlcollaborative.Dbatools.Utility.SizeStyle]$style = $Value }
    catch
    {
        $Result.Message = "Not a size style: $Value"
        $Result.Success = $False
        return $Result
    }

    $Result.Value = $style

    return $Result
}