PSU module not working properly for remote invoke script command

Resolved

PSU module not working properly for remote invoke script command

avatar
(anonymous user)
Product: PowerShell Universal
Version: 5.3.3

When trying to invoke a script from a different pc then the PSU server we het the following error involving an assembly that is present but seems to not be working properly.


PS C:\Program Files (x86)\Universal> Get-PSUScript
Get-PSUScript : The type initializer for 'ProtoBuf.Grpc.Configuration.ProtoBufMarshallerFactory' threw an exception.
At line:1 char:1
+ Get-PSUScript
+ ~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-PSUScript], TypeInitializationException
    + FullyQualifiedErrorId : System.TypeInitializationException,UniversalAutomation.GetScriptCommand

PS C:\Program Files (x86)\Universal> $error[0] | select *


PSMessageDetails      :
Exception             : System.TypeInitializationException: The type initializer for 'ProtoBuf.Grpc.Configuration.Proto
                        BufMarshallerFactory' threw an exception. ---> System.IO.FileNotFoundException: Could not load
                        file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2dd
                        d51' or one of its dependencies. The system cannot find the file specified.
                           at ProtoBuf.Grpc.Configuration.ProtoBufMarshallerFactory..ctor(TypeModel model, Options opti
                        ons, Object userState)
                           at ProtoBuf.Grpc.Configuration.ProtoBufMarshallerFactory..cctor()
                           --- End of inner exception stack trace ---
                           at PowerShellUniversal.GrpcCommand.Connect[T](ConnectionType connectionType)
                           at PowerShellUniversal.GrpcCommand.Connect[T](ConnectionType connectionType)
                           at PowerShellUniversal.GrpcCommand.Connect[T](ConnectionType connectionType)
                           at PowerShellUniversal.GrpcCommand.GetService[T]()
                           at UniversalAutomation.GetScriptCommand.EndProcessing()
                           at System.Management.Automation.CommandProcessorBase.Complete()
TargetObject          :
CategoryInfo          : NotSpecified: (:) [Get-PSUScript], TypeInitializationException
FullyQualifiedErrorId : System.TypeInitializationException,UniversalAutomation.GetScriptCommand
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}

avatar
(anonymous user)

Recommended Answer

Hi Adam,

I believe that our whole environment runs in PowerShell 5.1

I tried it using PowerShell 7 and now it works.

thanks!

All Comments (2)

avatar

What version of PowerShell are you loading this in?

Adam Driscoll

PowerShell Expert and Software Architect at Devolutions

avatar
(anonymous user)

Hi Adam,

I believe that our whole environment runs in PowerShell 5.1

I tried it using PowerShell 7 and now it works.

thanks!