Steps to reproduce
Download and install the .NET Core 2.0 SDK.
dotnet new classlib --name psmodule
cd psmodule
dotnet add package PowerShellStandard.Library --version 3.0.0-preview-01
Remove-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.
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.15063.608
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.608
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.3
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