HPE 3PAR StoreServ Storage
1752562 Members
4439 Online
108788 Solutions
New Discussion юеВ

Re: Automatic import of HPE 3PAR PowerShell Toolkit modules?

 
Sheldon Smith
HPE Pro

Automatic import of HPE 3PAR PowerShell Toolkit modules?

First, I admit to being a Power Shell newb. I've downloaded the new 3PAR toolkit. I copied the HPE3PARPSToolkit folder into my PSModulePath, %UserProfile%\Documents\WindowsPowerShell\Modules, so I now have the .psm1 files in %UserProfile%\Documents\WindowsPowerShell\Modules\HPE3PARPSToolkit.

Get-Module -ListAvailable shows my system Modules directory and the modules within. It doesn't show my personal Modules folder nor the 3PAR .psm1 files.
While I can manually import the 3PAR modules explicitly entering the path, I'd like to have the 3PAR modules automatically available whenever I start PS.

What am I doing wrong?


Note: While I am an HPE Employee, all of my comments (whether noted or not), are my own and are not any official representation of the company

Accept or Kudo

2 REPLIES 2
apol
Frequent Advisor

Re: Automatic import of HPE 3PAR PowerShell Toolkit modules?

I have the same problem. The older version works like expected. The install guide of the older version includes "Copy the files to <psmodule-path>". This part is missing in the new version, but even when you do it, it does not work. I tried the "old" system wide path in system32, the new one in program files, and the personal one. And the manual import takes too long to include a "import-module ..." in every script.

rmay_bk
Valued Contributor

Re: Automatic import of HPE 3PAR PowerShell Toolkit modules?

A "well-formed" module is a module that is stored in a directory that has the same name as the base name of at least one file in the module directory. If a module is not well-formed, Windows PowerShell does not recognize it as a module.

The "base name" of a file is the name without the file name extension. In a well-formed module, the name of the directory that contains the module files must match the base name of at least one file in the module.

https://docs.microsoft.com/en-us/powershell/developer/module/installing-a-powershell-module

I also had to right click the .psm1 files, go to Properties, and check the "unblock" since these files were downloaded from teh evil internets.