“Object reference not set to an instance of an object” when calling method on NoteProperty added in parallel processing
I’m trying to add an object of a class as a NoteProperty to another class inside a ForEach-Object -Parallel block in PowerShell 7. However, when I try to call a method on that added NoteProperty, I get an "Object reference not set to an instance of an object"
error. Here’s a simplified version of my code: