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
dotnet new classlib --name psmodule
cd psmodule
dotnet add package PowerShellStandard.Library --version 3.0.0-preview-01Remove-Item .\Class1.cs
@'using System.Management.Automation;namespace PSCmdlet3{ [Cmdlet("Get", "Foo")] public class GetFooCommand : PSCmdlet { [Parameter] public string Name { get; set; } = string.Empty; protected override void EndProcessing() { this.WriteObject("Foo is " + this.Name); base.EndProcessing(); } }}'@|Out-File GetFooCommand.cs -Encoding UTF8
dotnet build
cd .\bin\Debug\netstandard2.0\
ipmo .\psmodule.dll
get-foo
Expected behavior
This should work in PowerShell Core and in Windows PowerShell 5.1.
Actual behavior
The binary module loads into Windows PowerShell but fails when executed with this error:
get-foo : Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
At line:1 char:1
+ get-foo
+ ~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException
I guess I missing a shim assembly. Could this be packaged with PSStandard.Lib? If not, we need to make sure we document any other required pkgs.
Steps to reproduce
Download and install the .NET Core 2.0 SDK.
Expected behavior
This should work in PowerShell Core and in Windows PowerShell 5.1.
Actual behavior
The binary module loads into Windows PowerShell but fails when executed with this error:
I guess I missing a shim assembly. Could this be packaged with PSStandard.Lib? If not, we need to make sure we document any other required pkgs.
Environment data