Import-Module stops working sporadically

71 views Asked by At

I have a problem where Import-Module -Name "./MyAssembly.dll" stops working sporadically. If I restart the computer, everything seems to work as normal for a while, but it's getting really frustrating.

The reason for importing the same module (in different Powershell sessions) is because I'm currently writing a cmdlet using C#, and I start a powershell instance as part of debugging the cmdlet.

The Import-Module command gives me no feedback whatsoever of whether or not the loading succeeded.

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

Any help or suggestions are welcome.

0

There are 0 answers