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.
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.