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
Post a Comment