When creating a module manifest with the following
$settings = @{
Path = $(Join-Path -Path $PSScriptRoot -ChildPath "module.psd1")
Author = "Author"
CompanyName = "Company"
ModuleVersion = "0.0.0"
Guid = $(New-Guid)
PowerShellVersion = "5.1.0"
FunctionsToExport = "*"
NestedModules = $(ls *.psm1)
VariablesToExport = "G_*"
}
New-ModuleManifest @settings
and trying to import it with
using module "../modules/Common/module.psd1"
Write-Host "Hello World!"
with powershell 5.1 i see
.\test_using_modules.ps1 : The specified module was not loaded because no
valid module file was found in any module directory.
however it works just fine with powershell 7.1. With powershell 5.1 it works if cd-ing into module dir and importing that module in there.
From docs on modules, I do not see a big difference wrt module manifests. Any suggestions on what I can be doing wrong?