Link to home
Start Free TrialLog in
Avatar of Erwin Pombett
Erwin PombettFlag for Switzerland

asked on

how can i import module from my Doc/WindowPS/Modules when i started PS ISE as an admin ?

I need to start my PS iSE as administrator.

My modules are in my user path. when i pass the command
        Get-Module -ListAvailable
i dont have the list for my user.

i dont want to move my modules to a different location.

how can I import my modules ?


thank you in advance.

Toshi
ASKER CERTIFIED SOLUTION
Avatar of footech
footech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Erwin Pombett

ASKER

hello footech,

thank you for your reply,

if i use the following line the $p value is empty.
$p = [Environment]::GetEnvironmentVariable('PSModulePath','User')
i can fill the $p as follows:
$p=$env:PSModulePath.

samething for filling the PSModulePath back, i can only doit with

$env:PSModulePath=$p.


is it normal that i can not doing it the way you paste it.
both following command doesn't output any error when passed.

$p = [Environment]::GetEnvironmentVariable('PSModulePath','User')
[Environment]::SetEnvironmentVariable('PSModulePath',$p,'User')

do you have any idea that could avoid your commands to pass on my PSISE ?

thank you in advance.
It's fine not to have anything as the result of [Environment]::GetEnvironmentVariable('PSModulePath','User').  By default that is blank.

As I mentioned, first you have to check $env:PSModulePath.  Is your path there?

If it's already there, then you don't have to add it.  The set command doesn't produce any output.

Have you tried the following command?
Get-Module -ListAvailable -All
Did you read the last link I provided?  Do you have the folders named correctly for your modules?
ok, every thing is working, i added the path to the PSModulePath and things are ok.