Unable to load module in C# environment using POWERSHELL and Process


want 'import-module' called 'applocker' via c# program. can 'import-module' manually, execute command in powershell window. need same through c# program.

execute powershell commands through c# program. can create 'ps1' (powershell) script , execute script using 'process' , 'processstartinfo' class object.

, what, trying here import module. have created powershell script file, contains import-module applocker.
, execute script through c# program (with of 'process' , 'processstartinfo' class object). getting below mentioned exception.

the specified module 'applocker' not loaded because no valid module file found in module directory.

, happens specific module. although module listed in 'windows powershell ise' window. , have verified locations , modules, , available; infact being displayed in powershell via get-psprovider cmdlet. (note: able import-module powershell window, fails while importing through c# program)

highly appreciated!

we use path module folder.

import-module c:\windows\system32\windowspowershell\v1.0\modules\applocker


\_(ツ)_/



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

some help on Event 540

WMI Repository 4GB limit - Win 2003 Ent Question

Event ID 1302 (error 1307) DFS replication service encountered an error while writing to the debug log file