@LonLee, Thanks for the reply. Based on my researching, I find we can set environment variable "__PSLockdownPolicy" to 4 to set the PowerShell language mode to Constrained Language mode
https://devblogs.microsoft.com/powershell/powershell-constrained-language-mode/
Note: Non-Microsoft link, just for the reference.
To do this in bulk, we can save the following command in PowerShell script. And run it on the device to see if it works.
reg add "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" /v "__PSLockDownPolicy" /t reg_SZ /d "4" /f
After the above PowerShell Script test successfully, then we can deploy it via Intune:
https://learn.microsoft.com/en-us/mem/intune/apps/intune-management-extension
Hope the above information can help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.