private/Functions/Axis/Format-AxisSDCard.ps1

#https://$($ip)/stw-cgi/system.cgi?msubmenu=storageinfo&action=control&Storage=1&Mode=Format

Function Format-AxisSDCard {
    [cmdletBinding()]
    Param(
        [Parameter()]
        [hashtable]$Object
    )

    <#
    Object Definition:
    @{
        IP = [String(Mandatory)]
        Credential = [PSCredential(Mandatory)]
        Storage = [int] as [String(Optional)]
    }
    #>


    #Set basic Paramters for Invoke-AxisCommand
    $CamCmd = @{
        Arguments = @{
            IP = $Object.IP
            Menu = 'system'
            SubMenu = 'storageinfo'
            Action = 'control'
            Parameters = @()
        }
        Credential = $Object.Credential
    }

    #Add Action Parameters
    $CamCmd.Arguments.Parameters += "Mode=Format"
    if($Object.ContainsKey('Storage')) {
        $CamCmd.Arguments.Parameters += "Storage=$($Object.Storage)"
    }
    else {
        $CamCmd.Arguments.Parameters += "Storage=1"
    }

    #Command will not return data if successful
    return Invoke-AxisCommand @CamCmd
}