Removing a Class Module Without Restarting the Shell?

So for a script I’m writing I’m importing a class module via the “Using Module” keyword and instantiating using the New-Object cmdlet.

i.e.

Using Module .mynewclass.psm1 $new = New-Object -Typename mynewclass -ArgumentList("foo") 

While this is super nifty, it seems like it’s pretty much impossible to remove this class module, which means every time I make a modification to the class I need to close my PS instance and reopen which gets really annoying (and no, remove-module does not work).

Does anyone know a way to remove the module? I can’t find anything on it anywhere and I’m losing hope. Also when will Powershell not suck at custom-class instantiation?

Thanks in advance

submitted by /u/-Action_Hank-
[link] [comments]

Leave a Reply