function Put_Tag{ param( [parameter(mandatory)][string]$serial, [parameter(mandatory)][string]$tag, [parameter(mandatory)][string]$value_net ) $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $headers.Add("Accept", "*/*") $headers.Add("Content-Type", "application/json") $headers.Add("X-Cisco-Meraki-API-Key", $global:API_Key) $body = "{ `n `"serials`":`"${serial}`", `n `"updateAction`": `"add`", `n `"tags`": `"${tag}`" `n}" $url="https://api.meraki.com/api/v0/networks/$(value_net)/sm/devices/tags" $response = Invoke-RestMethod $url -Method 'PUT' -Headers $headers -Body $body | ConvertTo-Json return $response }
... View more