Scripts/New-UDSpinner.ps1

<#
.SYNOPSIS
    Sample control for UniversalDashboard.
.DESCRIPTION
    Sample control function for UniversalDashboard. This function must have an ID and return a hash table.
.PARAMETER Id
    An id for the component default value will be generated by new-guid.
.EXAMPLE
    PS C:\> New-UDSpinner -tagName CombSpinner -color "#1e555c" -size 200
    This would create a CombSpinner with the color and size stated in the parameters
.INPUTS
    Inputs (if any)
.OUTPUTS
    Output (if any)
.NOTES
    Adds a collection of awesome looking react spinners to your powershell universaldashboard
#>

function New-UDSpinner {
    param(
        [Parameter()]
        [string]$Id = (New-Guid).ToString(),
        [Parameter()]
        [ValidateSet("BallSpinner",
            "BarsSpinner",
            "CircleSpinner",
            "CubeSpinner",
            "DominoSpinner",
            "FillSpinner",
            "FireworkSpinner",
            "FlagSpinner",
            "GridSpinner",
            "GuardSpinner",
            "HeartSpinner",
            "ImpulseSpinner",
            "PulseSpinner",
            "PushSpinner",
            "SequenceSpinner",
            "SphereSpinner",
            "SpiralSpinner",
            "StageSpinner",
            "SwapSpinner",
            "WaveSpinner",
            "ClapSpinner",
            "RotateSpinner",
            "SwishSpinner",
            "GooSpinner",
            "CombSpinner",
            "PongSpinner",
            "RainbowSpinner",
            "RingSpinner",
            "HoopSpinner",
            "FlapperSpinner",
            "MagicSpinner",
            "JellyfishSpinner",
            "TraceSpinner",
            "ClassicSpinner",
            "MetroSpinner",
            "WhisperSpinner")]
        [string]$tagName = "GridSpinner",
        [Parameter()]
        [int]$size = 100,
        [Parameter()]
        [string]$color = "#aec5eb",
        [Parameter()]
        [string]$frontColor = "#aec5eb",
        [Parameter()]
        [string]$backColor = "#fff"
    )

    End {

        @{
            # The AssetID of the main JS File
            assetId    = $AssetId
            # Tell UD this is a plugin
            isPlugin   = $true
            # This ID must be the same as the one used in the JavaScript to register the control with UD
            type       = "UD-Spinner"
            # An ID is mandatory
            id         = $Id

            # This is where you can put any other properties. They are passed to the React control's props
            # The keys are case-sensitive in JS.
            tagName    = $tagName
            size       = $size
            color      = $color
            frontColor = $frontColor
            backColor  = $backColor
        }

    }
}