Jobs fail with "CmdletInvocationException" in powerJobs 26.0.9 for Vault 2026
Description
When Add-Type is used to compile c# code during runtime, then the job fails with
System.Management.Automation.CmdletInvocationException: Method 'GetHashCode' in type 'Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions' from assembly 'Microsoft.CodeAnalysis.CSharp, Version=4.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation. at <ScriptBlock>, C:\ProgramData\coolOrange\powerJobs\Jobs\TestJob.ps1: line 1
Cause
Currently under investigation
Solution
As a quick fix you can downgrade powerJobs Processor to v26.0.8
* powerJobs Processor v26.0.8 for Vault 2026
For a more permanent solution you either have to wait for an update or compile your custom code via Visual Studio and use Add-Type to load the DLL into the job. Add-Type will only fail when it needs to compile code during runtime.