Skip to content

No support of System.Management.Automation for .net framework #12773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kriti218 opened this issue May 24, 2020 · 5 comments
Closed

No support of System.Management.Automation for .net framework #12773

kriti218 opened this issue May 24, 2020 · 5 comments
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Answered The question is answered.

Comments

@kriti218
Copy link

kriti218 commented May 24, 2020

In my project, we are using .net framework 4.6,2 and want to call powershell from our c# code. When i went to nuget to install the required library (System.Management.Automation), i could see that 6.x.x onward versions are available and all support .net core and not .net framework.

my ask is how should i use or call powershell in my application as i cant upgrade it to .net core. It is a legacy application. I could manage to find one "Install-Package System.Management.Automation.dll -Version 10.0.10586" whicb alteast let me use PS but that is a deprecated one.

Please suggest how can i get old versions of above library from nuget for .net framework as that is blocking my work currently as we are short of time now.

@kriti218 kriti218 added the Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a label May 24, 2020
@powercode
Copy link
Collaborator

powercode commented May 25, 2020

You should be able to use https://www.nuget.org/packages/PowerShellStandard.Library

Version 5.1 works with Windows Powershell.

Contains the reference assemblies for PowerShell Standard 5

@vexx32 vexx32 added the Resolution-Answered The question is answered. label May 25, 2020
@alx9r
Copy link

alx9r commented May 25, 2020

@powercode Is PowerShellStandard.Library 5.1.0 meant to supercede Microsoft.PowerShell.5.ReferenceAssemblies? Or do those have different purposes?

@powercode
Copy link
Collaborator

The standard library should work for .net core pwsh also.

@ghost
Copy link

ghost commented May 27, 2020

This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed May 27, 2020
@Nikita-T86
Copy link

As stated in README for PowerShellStandard.Library "NOTE: You should not use PowerShell Standard for standalone applications that leverage PowerShell." and indeed it doesn't work, see for example here.

So it is still not clear what is the correct solution.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Answered The question is answered.
Projects
None yet
Development

No branches or pull requests

5 participants