Sample_Assign.ps1

Remove-Module -Name IntuneWin32App -Force

# Import module
Import-Module -Name C:\GoogleDrive\Scripts\PowerShell\Intune\Modules\IntuneWin32App\IntuneWin32App.psd1

# Get the Win32 app
$Win32App = Get-IntuneWin32App -TenantName "configmgrse.onmicrosoft.com" -DisplayName "7-zip" -Verbose

# Create available assignment targetted for a specific group for Win32 app using app id
$GroupID = "4d8fc014-8584-42a7-9f98-8a20803f6370"
Add-IntuneWin32AppAssignment -TenantName "configmgrse.onmicrosoft.com" -ID $Win32App.id -Target "Group" -Intent "available" -GroupID $GroupID -Verbose

# Create available assignment targetted for a specific group for Win32 app using app display name
Add-IntuneWin32AppAssignment -TenantName "configmgrse.onmicrosoft.com" -DisplayName $Win32App.displayName -Target "Group" -Intent "available" -GroupID $GroupID -Verbose

# Create available assignment targetted for all users for Win32 app using app display name
Add-IntuneWin32AppAssignment -TenantName "configmgrse.onmicrosoft.com" -DisplayName $Win32App.displayName -Target "AllUsers" -Intent "available" -Verbose