How to fix error "Cannot load PowerShell snap-in Microsoft.PowerShell.Diagnostics because of the following error: Could not load file or assembly"
I had a similar issue and accompanying error message. Installing the NuGet package for Microsoft.PowerShell.SDK
into my project did the trick.