silverhack/monkey365

[Bug]: Get-AstFunction is not recognized

qbrusa opened this issue · 3 comments

qbrusa commented

What happened?
When I import monkey365 with command "Import-Module .\monkey365.psm1" I have an error message about Get-AstFunction

How to reproduce it
Steps to reproduce the behavior:

  1. What command are you running?
    Import-Module .\monkey365.psm1
  2. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots or Logs
import_error

From where are you running Monkey365?
Please, complete the following information:

  • Resource: VirtualBox VM
  • OS: Windows 10
  • PowerShell Version [$PsVersionTable]: 5.1.19041.2673
  • Monkey365 Version: latest
  • Others:

Additional context
Add any other context about the problem here.

Hi @qbrusa,

It is not a bug and you're using the "Import-Module" incorrectly. Please, see docs about how to correctly import a module in PowerShell.

https://silverhack.github.io/monkey365/install-instructions/
https://learn.microsoft.com/en-us/powershell/scripting/developer/module/importing-a-powershell-module?view=powershell-7.3

qbrusa commented

Hi @silverhack, Finaly I have found that Import-Module .\monkey365.psd1 works. But If I want to use the default command to import a module, Powershell return to me that no valide module exist :
image

I think you could update your doc (or push your Powershell module in PSGallery ?), and thank you for your great work.

Hi @qbrusa there is no error and your issue is the same as the last one. You're seeing these errors because the folder does not have the same name as the PSD1. You should rename the folder from Monkey365-main to Monkey365. Once the name is changed you will be able to import the module. And all is explained here.

Cheers,