Invoke PowerShell circularly taking up too much memory with Windows framework

I find that to invoke PowerShell every time will produce a session which will take up memory. Therefor, it would run out of memory if invoking PowerShell circularly. Windows system will not release resources.

In contrast with Windows framework, Windows-legacy framework works perfectly.

In all, is there a way to invoke PowerShell well with Windows framework as Windows-legacy framework?
Thanks!

@donfeng91

looks like session is not getting closed

you can try killing the session by getting the process using get processes as an interim solution

cheers

Thanks.

I change UiPath.System.Activity version to 23.10.4 in Windows framework. And to invoke Powershell with command line “Get-process”, the session is closed in time. However, this environment cannot run this command line “(Get-ScheduledTask -TaskPath “”\custom*”" | Get-ScheduledTaskInfo).TaskName" which runing successfully in my previous description.

So, I think the error is due to UiPath.System.Activity package.

@donfeng91

23.10 has a reported bug either go to 22.10 or 24.x

Cheers