You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you know, this project is very old, (last commits for more than 5 years ago) PowerShell 7.6 coming soon, and .NET 10 is released, but we do not know, what is best approach to writing C# based PowerShell module
This library is mostly just for creating a compiled module that works on both .NET Framework and/or PowerShell 7. It is essentially feature complete as 5.1 will not include any new APIs and this ref library needs to expose only the shared APIs between the two.
If you wish to target newer PowerShell features you should add a reference to System.Management.Automation at the base PowerShell version you want. For example this is how I target PowerShell 5.1 with PowerShellStandard and 7.2+ with System.Management.Automation
Activity
soroshsabz commentedon Dec 11, 2025
Steve Lee (@SteveL-MSFT)
soroshsabz commentedon Dec 11, 2025
S.M.A.Job2has a protected methodSetJobState(JobState state, Exception reason), which should be included inPowerShellStandard.Librarybut is not #102SystemPolicy.GetSystemLockdownPolicy()andSystemPolicy.GetLockdownPolicy(string, SafeHandle)in thePowerShellStandard.Library#103soroshsabz commentedon Dec 11, 2025
Stale PRs:
soroshsabz commentedon Dec 11, 2025
related to PowerShell/PowerShell#26605
soroshsabz commentedon Dec 11, 2025
related to PowerShell/PowerShell#26606
jborean93 commentedon Dec 11, 2025
This library is mostly just for creating a compiled module that works on both .NET Framework and/or PowerShell 7. It is essentially feature complete as 5.1 will not include any new APIs and this ref library needs to expose only the shared APIs between the two.
If you wish to target newer PowerShell features you should add a reference to
System.Management.Automationat the base PowerShell version you want. For example this is how I target PowerShell 5.1 withPowerShellStandardand 7.2+ withSystem.Management.Automationhttps://github.com/jborean93/ProcessEx/blob/fe2cdbd55ee0706ffef1abc2d6a8ca10e57369f6/src/ProcessEx/ProcessEx.csproj#L24-L34