How do I install the ACE module in PowerShell Core 6.1.1 (pwsh.exe)?
- Thu, Apr 11 2019 at 6:13 pm #1117898Ramon TanParticipantMember Points: 764Rank: 2
I’ve been using Get-ACEdata for about 2 years now. It works just fine, with all my MS-ACCESS databases. I’ve been using Windows PowerShell 5.1 ISE. Now I wish to run in the environment: VS Code as editor, and Powershell Core 6.1 (pwsh.exe) as shell.
In trying to install the ACE module, I created the sub-folder: (In PS 5.1 ISE, it’s ..\Documents\WindowsPowerShell\Modules\)
C:\Users\MyUserid\Documents\VS Code PowerShell\Modules\
Per Technet instructions I copied the ACE.psm1 file from the site:
into it, and at the prompt I ran:
It failed. The error message stated:
” … ‘ACE’ was not loaded because no valid module file was found in any module directory.”.
Clearly I didn’t place the ACE.psm1 file into the right sub-directory.
Would be grateful for some guidance as to the proper placement of the ACE.psm1 file in the VS Code environment.
- Fri, Apr 12 2019 at 1:43 am #1118051Luc FullenwarthModeratorMember Points: 16,066Rank: 4
The following command displays all locations where you can save your modules.
You can add new locations to this variable or simply use an existing location.
Once you have chosen your destination, you must create a subfolder with the same name as the PSM1 file.
I have highlighted this part because it is the key for a module to be found.
For example, if you chose ‘C:\Users\UserName\Documents\PowerShell\Modules’ as location:
New-Item -Path 'C:\Users\UserName\Documents\PowerShell\Modules\ACE'
Then you copy the ACE.psm1 file to this folder.
PowerShell will now be able to import it with the Import-Module cmdlet associated to the Name parameter.
Import-Module -Name ACE
A workaround could be to specify the path to the ACE.psm1 file instead of providing the Name parameter.
- Fri, Apr 12 2019 at 8:01 am #1120336Ramon TanParticipantMember Points: 764Rank: 2
- Fri, Apr 12 2019 at 9:20 am #1120340Luc FullenwarthModeratorMember Points: 16,066Rank: 4
No worries, you are welcome!
- You must be logged in to reply to this topic.