Use custom class in runspace

I have a custom class for asynchronous logging that I want to use in runspaces, either via a runspacepool or Powershell 7’s “Foreach-Object -Parallel”. I am currently loading the custom class via a psm1 file using “using module ‘modulepath’”. The custom class is not available to runspaces.

Is there a way to pass the class to a runspace so a new instance of the class can be instantiated in the runspace?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.