1

我有一个Import-Module -Name "./MyAssembly.dll"偶尔停止工作的问题。如果我重新启动计算机,一段时间内一切似乎都正常工作,但它变得非常令人沮丧。

导入相同模块(在不同的 Powershell 会话中)的原因是因为我目前正在使用 C# 编写一个 cmdlet,并且我启动了一个 powershell 实例作为调试 cmdlet 的一部分。

Import-Module 命令没有给我任何关于加载是否成功的反馈。

PS C:\Source\MyProject> Import-Module -Name "./MyAssembly.dll"
PS C:\Source\MyProject> Get-Stuffz
Get-Stuffz : The term 'Get-Stuffz' is not recognized as the name of a cmdlet, function, script file, or ope
rable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again
.
At line:1 char:1
+ Get-Stuffz
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-Stuffz:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

欢迎任何帮助或建议。

4

0 回答 0