Powershell: Installing Modules on Target System

回眸只為那壹抹淺笑 提交于 2019-11-30 20:40:43

问题


When I do this -

PS C:\> $env:psmodulePath.split(";")

I get two folders - i.e. User Module Folder and System Module Folder.

User Module Folder
C:\Users\winUser1\Documents\WindowsPowerShell\Modules

System Module Folder
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

Now, when I am copying my psm1 files under system module folder, and trying to do import-module from ISE x86, the scripts are not getting loaded, but vice-versa is true - i.e. working from user module folder.

But, in a production environment, I want any user to be able to execute the scripts. Any idea how to achieve the same ?

NOTE: I am using Windows 2008 R2 and Windows 7 - All 64-Bit Versions, but scripts should run as 32-bit version


回答1:


Try to copy them under the SysWOW64 folder. The SysWOW64 folder contains the 32-bit system files and the System32 contains the 64-bit system files

C:\windows\SysWOW64\WindowsPowerShell\v1.0\Modules



来源:https://stackoverflow.com/questions/10501484/powershell-installing-modules-on-target-system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!