I am trying to load PowerShell Script Module. Below is the step I am following
I have created 2 files under folder "C:\windows\system32\WindowsPowerShell\v1.0\Modules**PSModuleTest**"
ModuleVersion = '1.0'
GUID = '7e8f93e6-5bde-4043-918e-322066c5340e'
Author = 'ravi'
CompanyName = 'Unknown'
Copyright = '(c) 2016 Ravi. All rights reserved.'
FunctionsToExport = '*'
CmdletsToExport = '*'
VariablesToExport = '*'
AliasesToExport = '*'
Write-Host "Hello world!!!"
Import-Module -Name PSModuleTest -Force -Verbose
You can see from your screenshot above that after you've imported it PSModuleTest has no exported commands.
You need to declare PSModuleTest.psm1 in your module manifest file as long as you have a manifest available. e.g.
# Script module or binary module file associated with this manifest. RootModule = 'PSModuleTest.psm1'
This is normally the first field in the manifest if you used
New-ModuleManifest to create it.
Your module won't be visible in a session until it has either been explicitly loaded or auto-loaded. It can only auto-load if commands can be discovered relatively easily (or the commands in the module are cached).
This command will show modules, included those which are not loaded: