© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
2 replies
Tomas

❔ System.Management.Automation error

While I trying run powershell with the Automation Nuget addon it print this error:
System.Management.Automation.Runspaces.PSSnapInException
  HResult=0x80131501
  Message=Cannot load PowerShell snap-in Microsoft.PowerShell.Diagnostics because of the following error: Could not load file or assembly 'C:\Users\tomma\source\repos\tommaTweaker\tommaTweaker\bin\Debug\net6.0-windows\runtimes\win\lib\net6.0\Microsoft.PowerShell.Commands.Diagnostics.dll'. The system cannot find the file specified.
System.Management.Automation.Runspaces.PSSnapInException
  HResult=0x80131501
  Message=Cannot load PowerShell snap-in Microsoft.PowerShell.Diagnostics because of the following error: Could not load file or assembly 'C:\Users\tomma\source\repos\tommaTweaker\tommaTweaker\bin\Debug\net6.0-windows\runtimes\win\lib\net6.0\Microsoft.PowerShell.Commands.Diagnostics.dll'. The system cannot find the file specified.


How to fix it?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

how to load the dll for System.Management.Automation on runtime ?
C#CC# / help
2y ago
How do you get the output type from a powershell script with System.Management.Automation?
C#CC# / help
3y ago
✅ wtf i cant import system management
C#CC# / help
3y ago
error while writing automation test
C#CC# / help
2y ago