I am having an issue when trying to load modules into Powershell? I think it not loading the modules in the correct path? How do I know where the modules are installed when using install-module from the PSGallery? I am running PowerShell version 5.0.10514.6 and if I run Get-InstalledModule it list Version Name
but I can't get-command for any listed installed Modules? such as Get-Command -Module Image2Docker should show me the full list of the commands for Image2Docker Module but it comes back with nothing?
When you install modules using Install-Module, it will install to 'C:\Program Files\WindowsPowerShell\Modules' (by default) or 'C:\Users\\Documents\WindowsPowerShell\Modules\'. You can control the destination using the -Scope parameter. Default value is 'AllUsers' alternatively you can use 'CurrentUser'.
Get-Command, Import-Module etc. will look for modules in the locations specified in the $env:PSModulePath environment variable.
Check what the paths $env:PSModulePath variable contain
$env:PSModulePath -split ';'
You can add your own paths to that environment variable, just as you would add to the $env:Path variable, so if you don't see what you expect, or if the variable is missing, just create it yourself.
I have previously seen installers such the VMware PowerCLI installer mess up my $env:PSModulePath environment variable, where I had to recreate it manually.
This is very strange
if I run get-module I get
then I run the command
PS C:\Windows\system32> $env:psmodulepath
So I need to add the local user path C:\Users\jsmith484\WindowsPowershell\Modules
and now I can see the user module path C:\Users\jsmith484\WindowsPowershell\Modules but when I run find-module it doesn't work, it returns nothing and if I try to install-module the same?
any assistance would be appreciated
You must be logged in to reply to this topic.