@scottlink there's a #PowerShell #SDK #NuGet https://www.nuget.org/packages/Microsoft.PowerShell.SDK/
You can create an instance of "PowerShell" and invoke code, or even host PowerShell for automating your app...
Not sure any of their examples still work though 😜 https://github.com/MicrosoftDocs/powershell-sdk-samples