Public/Add-ApplicationAssignment.ps1

<#
 
.COPYRIGHT
Copyright (c) Office Center Hønefoss AS. All rights reserved. Licensed under the MIT license.
See https://github.com/officecenter/OCH-Public/blob/master/LICENSE for license information.
 
#>



Function Add-ApplicationAssignment
{
  [cmdletbinding()]

  param
  (
    [Parameter(Mandatory = $true)]
    [Guid]
    $ApplicationId,

    [Parameter(Mandatory = $true)]
    [PSObject]
    $Assignment
  )
  $Resource = "deviceAppManagement/mobileApps/$ApplicationId/groupAssignments"
  
  $JSON = $Assignment | ConvertTo-Json

  Invoke-GraphAPI -Resource $Resource -Method POST -Body $JSON
}