Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Import system modules automatically?

I am using Windows 2008 r2 64 bit system.

While testing our script ,we did right click on powershell (which is present in taskbar) and import system modules.

Our scripts will be used while deployment. So in destination machine we are not sure whether all system modules are imported or not?

How to make import all the system modules imported if not imported already?

like image 311
Samselvaprabu Avatar asked Apr 05 '12 10:04

Samselvaprabu


1 Answers

There's a hidden powershell switch to load system modules:

powershell.exe -ImportSystemModules

System modules reside in the $pshome\modules folder. The equivalent command to load them would be:

Get-Module -ListAvailable | Where-Object {$_.Path -like "$PSHOME*"} | Import-Module

UPDATE:

The -ImportSystemModules switch has no impact in v3, looks like it is going away.

like image 156
Shay Levy Avatar answered Nov 15 '22 04:11

Shay Levy