How do I install the ACE module in PowerShell Core 6.1.1 (pwsh.exe)?
- This topic has 3 replies, 2 voices, and was last updated 4 years, 5 months ago by
Luc Fullenwarth.
- AuthorPosts
- Thu, Apr 11 2019 at 6:13 pm #1117898
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:
https://gallery.technet.microsoft.com/scriptcenter/af687d99-5611-4097-97e4-691fda84ad42#content
into it, and at the prompt I ran:
Import-module ACE
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.
Many thanks.
- Fri, Apr 12 2019 at 1:43 am #1118051
The following command displays all locations where you can save your modules.
$env:PSModulePath
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.
Import-Module C:\Temp\ACE.psm1
- Fri, Apr 12 2019 at 8:01 am #1120336
- Fri, Apr 12 2019 at 9:20 am #1120340
No worries, you are welcome!
- AuthorPosts
- You must be logged in to reply to this topic.