Start a new topic
Solved

Receiving error trying to use trying to use a dynamic folder script with powershell

When attempting to do what I mentioned in the subject I receive the following error, this is on Windows 11 24H2 fully patched. I also set the following settings and as of now they both sit at bypass.

An error occurred while executing the dynamic folder's script: "File C:\Users\troyc\AppData\Local\Temp\Royal TS V7\DynF_866d5504-5499-4a32-a01d-12766fe08b8d_1736232706.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. + CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : UnauthorizedAccess"  

image.png
(22.7 KB)

Hi Troy,


you may need to set the execution policy to Unrestricted in order to make it work. Also check the Options -> Dynamic Folder page to see if you are referring to the PowerShell 7 executable:

https://www.royalapps.com/go/help-ts-win-v7-ref-options-scriptinterpreter


The latest version of Royal TS now supports setting environment variables instead of using replacement tokens. Check this thread: https://support.royalapps.com/support/discussions/topics/17000024626


With environment variables you could sign your scripts you place in the dynamic folder/credential scripts.


Let me know if this helps.


Regards,
Stefan

I found out a way, for others sake I'll post it here. This is on Windows 11 Pro 24H2.

In addition to Set-ExecutionPolicy RemoteSigned

I did the following;

Create a GPO and go to Local Computer Policy > Windows Administrative Templates > Windows Components > Windows Powershell > Turn on Script Execution set to Enabled and set execution policy to allow Local and Remote Signed scripts.

Thanks for sharing your solution! Glad you got it working.


cheers,
Stefan

Oh and yes I was using the latest powershell 7.4.6, 

I also realize I should have posted this under problems. I'm not sure but if a moderator can mark this as solved and move to proper forum or have solution posted that would be great.

I moved the topic to the correct forum.

Login or Signup to post a comment