Powershell: some modules are not available when called through CreateProcess ()

Under what conditions do some PowerShell modules become unavailable?

When I create a process with CreateProcess()and command line

powershell -Command "Get-Module -ListAvailable"

I do not get all the modules that I get when I execute the same statement from the command line.

Are there any fields that I have to set inside the STARTUPINFO or PROCESS_INFORMATION structures?

+3
source share
2 answers

Some modules are not available in the 32-bit version of PowerShell. On Windows Server 2008 R2 with PowerShell v1.0, this is:

  • ADRMS
  • Applocker
  • Bestractices
  • Servermanager
+3
source

PSModulePath. , 2 PSModulePath , , 2 .

, ?

+2

Source: https://habr.com/ru/post/1772874/


All Articles