我需要在 C# 中创建一个类库,我想将其包含在我正在编写的 PowerShell 模块中。我想通过调用一个方法来使用 PowerShell 中的 DLL,如下所示:
Add-Type -Path $($variableHash.RootPath + "\Deviceparserstandalone.dll")
[SkypeHelpers.CQTools.DeviceParser+Audio]::IsCertified($_.Caption)
Run Code Online (Sandbox Code Playgroud)
以上是PowerShell导入DLL,然后使用该IsCertified方法的示例(我假设它是一个方法)。
这是我要找的:
目标是编写一个类库,PowerShell 可以使用该类库为 Windows 10 创建 Toast 通知。我意识到 PowerShell Gallery 上有公共模块,但我试图了解它是如何从头开始构建的。