How do I install the ACE module in PowerShell Core 6.1.1 (pwsh.exe)?

Viewing 3 reply threads
  • Author
    Posts
    • #1117898
      Ramon Tan
      Participant
      Member Points: 764
      Rank: 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:

      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.

    • #1118051
      Luc Fullenwarth
      Moderator
      Member Points: 16,066
      Rank: 4

      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
      avatar
    • #1120336
      Ramon Tan
      Participant
      Member Points: 764
      Rank: 2

      Mr Fullenwarth — my sincere thanks again, my mistake was to forget the sub-folder ACE.

      C:\Users\ ... \Powershell\Modules
      

      when I should have copied it to

      C:\Users\ ...\Powershell\Modules\ACE

      Many thanks for your generous assistance.

      avatar
    • #1120340
      Luc Fullenwarth
      Moderator
      Member Points: 16,066
      Rank: 4

      No worries, you are welcome!

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
© 4sysops 2006 - 2022

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account