1

I'm currently importing my custom Powershell datatypes using the "Using Module" keyword and instantiating using the "New-Object" cmdlet.

Example:

Using Module .\MyClass.psm1
$a = New-Object -TypeName MyClass -ArgumentList ($param1, $param2)

My issue is that I would like to modify the module and reload the datatype without having to restart the shell, but I can't seem to find a way to do this with the "Using" keyword. Does anyone know how to make this work?

2
  • stackoverflow.com/questions/11799697/… Commented Jun 27, 2018 at 19:08
  • The "Import-Module" command doesn't import classes only functions and variables. The best way I've found to do this is with the "Using Module" keyword. The "Remove-Module" command similarly does not remove classes. Commented Jun 27, 2018 at 19:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.