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**"
PSModuleTest.psd1
@{
ModuleVersion = '1.0'
GUID = '7e8f93e6-5bde-4043-918e-322066c5340e'
Author = 'ravi'
CompanyName = 'Unknown'
Copyright = '(c) 2016 Ravi. All rights reserved.'
FunctionsToExport = '*'
CmdletsToExport = '*'
VariablesToExport = '*'
AliasesToExport = '*'
}
PSModuleTest.psm1
function ModuleTestFunction
{
Write-Host "Hello world!!!"
}
Once above two files are placed under correct folder I have tested whether the module path is included in $env:PSModulePath or not and its there. I also verified that I am not on older version of PowerShell by entering $host command.
When I executed Get-Module command, surprizingly i dont see my new module loaded. So I tried to load the module by entering below command and it did not worked.
Import-Module -Name PSModuleTest -Force -Verbose
See below image for all the command's output for more details.
