Product: PowerShell Universal
Version: 2.8.2 and 2.8.3
I’ve upgraded our Powershell Universal version to 2.8.2 and started experiencing high CPU and memory usage. I upgraded to the latest nightly for 2.8.3 and am still experiencing this issue. I saw another topic in the forums where someone else was experiencing this on 2.7.x and the 2.8 update resolved it for them. Any advice on a direction to start troubleshooting this?
I’m also having an issue where all of the scripts aren’t being displayed at startup. If I make a change to scripts.ps1 and save the file, it tries again and will successfully load the rest of the scripts. Looking for some advice on this issue too. Here’s the error in the logs for this issue:
2022-02-18 12:02:08.780 -05:00 [ERR] Failed to read configuration file. scripts.ps1
System.InvalidCastException: Unable to cast object of type ‘System.Management.Automation.Language.TypeConstraintAst’ to type ‘System.Management.Automation.Language.AttributeAst’.
at System.Linq.Enumerable.CastIterator[TResult](IEnumerable source)+MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable1 source) at UniversalAutomation.ScriptParameterParser.GetParameters(ScriptBlock scriptBlock)+MoveNext() in D:\a\universal\universal\src\Universal.Server\Utilities\ScriptParameterParser.cs:line 107 at System.Collections.Generic.List
1…ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 source)
at UniversalAutomation.Services.ScriptsConfigurationScript.UpdateScript(Script script) in D:\a\universal\universal\src\Universal.Server\Services\Configuration\Scripts.cs:line 171
at UniversalAutomation.Services.ScriptsConfigurationScript.OnReadAfterUpdateAsync(Script script) in D:\a\universal\universal\src\Universal.Server\Services\Configuration\Scripts.cs:line 239
at UniversalAutomation.Services.ConfigurationScript`1.ReadAsync(Boolean initialSync) in D:\a\universal\universal\src\Universal.Server\Services\Configuration\ConfigurationScript.cs:line 236