When blocking PowerShell for Everyone this can also cause Applications that depend on PowerShell to have issues running properly.
For example, when using the UiPath Assistant application with PowerShell blocked, the two UiPath Assistant commands in the below screenshots will also be blocked.
To work around this issue you need to create two LPM Path and Commandline Executable Policies using the settings below.
For Policy # 1 use these settings:
PATH: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
ARGUMENTS: *"$assemblies=(\"System\");$source=\"*
For Policy #2 use these settings:
PATH: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
ARGUMENTS: "$FileContent = Get-Content -Encoding unicode
%Temp%\shortcuts-params.txt; Invoke-Expression $FileContent"
Note: For both policies above be sure to set Ignore arguments case to “True”, and Comparison mode to “Strict equality”.
LPM - UiPath.Assistant PowerShell command Allowed with PATH rule 1.xml
LPM - UiPath.Assistant PowerShell command Allowed with PATH rule 2.xml