I'm in a relatively special situation.
I have a Restify API built on node.js that uses process.exec('powershell.exe')
with some extra parameters to enter Mac Addresses into a database. This requires the ActiveDirectory module. Whenever I add a Mac Address, it creates a new process of powershell and imports the module, every time. This is incredibly inefficient, especially when I enter multiple at a time - for each mac address, it creates a new process and imports the module.
Is there anyway I could instead have an existing Powershell process with the ActiveDirectory module already loaded, then execute commands on it using the same process.exec('...')
method?