Modules are giving me some headaches


hi,

i creating software packages , distributes them sccm 2012 r2.

i using powershell scripting , using modules.

i creating subdirectory in each package , storing same module in each package.

i read many things modules still unclear.

1. may store module in subdirectory on network directory (my package)?

2. must done load/unload module?

3. storing memory variables in module , make them persist in whole process. defining them public correct. need absolutely using functions or may define variable $global:emplpackage="c:\temp"?

thanks,

françois

hifracine,

1. can specify module path in cmdlet "import-module"

3. if want make module variables available outside the module, can use global scope.

for more detiled information variable scope, please refer these articles:

powershell: script module variables not available outside of ise

about_scopes

if there else regarding issue, please feel free post back.

best regards,

anna wang



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

server manager error: ADAM.events.xml could not be enumerated.

Cannot access Anywhere Access using domain name?

WMI Failure: Unable to update Local Resource Group