I have a module in the folder that I created, C: \ PowerShellScripts \ Modules. I call it mod.psm1. This file contains two simple functions: Write-hello and Write-bye.
Now I have added this path (C: \ PowerShellScripts \ Modules) to my PSModulePath environment variable path.
Accordingly, this should automatically load the module when PowerShell starts. Right?
But when I start PowerShell and try Write-hello or Write-bye, it gives an error
write-hello: the term "write-hello" is not recognized as the name of a cmdlet, function, script file, or operating program
PowerShell does not load the mod.psm1 file, although $ ENV: PSModulePath shows my path (C: \ PowerShellScripts \ Modules)
And I need to use Import-Module again manually. What could be wrong?
source share