Public/Set-MerakiNetworkWirelessSSIDFirewallL7FirewallRules.ps1

function Set-MerakiNetworkWirelessSSIDFirewallL7FirewallRules {
    <#
    .SYNOPSIS
    Updates a network wireless SSID Firewall L7 Firewall Rules.
     
    .DESCRIPTION
    The Set-MerakiNetworkWirelessSSIDFirewallL7FirewallRules function allows you to update a network wireless SSID Firewall L7 Firewall Rules by providing the authentication token, network ID, SSID number, and a JSON formatted string of the L7 Firewall Rules.
     
    .PARAMETER AuthToken
    The authentication token (API key) required to access the Meraki Dashboard API.
     
    .PARAMETER NetworkId
    The ID of the network.
     
    .PARAMETER Number
    The number of the SSID.
     
    .PARAMETER L7FirewallRules
    A JSON formatted string of the L7 Firewall Rules.
     
    .EXAMPLE
    $L7FirewallRules = '{
        "rules": [
            {
                "policy": "deny",
                "type": "host",
                "value": "google.com"
            },
            {
                "policy": "deny",
                "type": "port",
                "value": "23"
            },
            {
                "policy": "deny",
                "type": "ipRange",
                "value": "10.11.12.00/24"
            },
            {
                "policy": "deny",
                "type": "ipRange",
                "value": "10.11.12.00/24:5555"
            }
        ]
    }'
    $L7FirewallRules = $L7FirewallRules | ConvertTo-Json -Compress
    Set-MerakiNetworkWirelessSSIDFirewallL7FirewallRules -AuthToken "your-api-token" -NetworkId "1234" -Number 0 -L7FirewallRules $L7FirewallRules
     
    This example updates a network wireless SSID Firewall L7 Firewall Rules with the specified configuration.
     
    .NOTES
    The function requires the "Invoke-RestMethod" cmdlet to be available.
     
    The function returns the response from the API if the update is successful, otherwise, it displays an error message.
    #>

    
        [CmdletBinding()]
        param (
            [parameter(Mandatory=$true)]
            [string]$AuthToken,
            [parameter(Mandatory=$true)]
            [string]$NetworkId,
            [parameter(Mandatory=$true)]
            [int]$Number,
            [parameter(Mandatory=$true)]
            [string]$L7FirewallRules
        )
    
        try {
            $header = @{
                "X-Cisco-Meraki-API-Key" = $AuthToken
                "content-type" = "application/json; charset=utf-8"
            }
    
            $url = "https://api.meraki.com/api/v1/networks/$NetworkId/wireless/ssids/$Number/firewall/l7FirewallRules"
    
            $body = $L7FirewallRules
    
            $response = Invoke-RestMethod -Method Put -Uri $url -Header $header -UserAgent "MerakiPowerShellModule/1.0.2 DocNougat" -Body $body
            return $response
        }
        catch {
            Write-Host $_
        }
    }