Please understand that the Intune management extension agent checks with Intune once every hour and after every reboot for any new scripts or changes. After you assign the policy to the Azure AD groups, the PowerShell script runs, and the run results are reported. Once the script executes, it doesn't execute again unless there's a change in the script or policy. If the script fails, the Intune management extension agent retries the script three times for the next three consecutive Intune management extension agent check-ins.
If you want to force run the script, you can restart the IntuneManagementExtension service in task manager and and the script will rerun again on this device. Also, a restart on the device or restart service triggers the script. Here is a good sample:
https://oliverkieselbach.com/2018/02/12/part-2-deep-dive-microsoft-intune-management-extension-powershell-scripts/
If you want scripts to run multiple times for a user, you'll need to deploy a method of removing the key, reassigning the script or scheduling it as a task.
Reference: https://learn.microsoft.com/en-us/mem/intune/apps/intune-management-extension
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.