I have a strange problem I have created a module and placed it in the “C:\Windows\System32\WindowsPowerShell\v1.0\Modules” directory .
I can open powershell and import my module fine but it does not work when I do the following.
I have batch file that calls the powershell script using the following command START /min /wait powershell "C:\test.ps1" "%1"
The script starts but it is unable to import module.
I placed this command “Get-Module -ListAvailable | Out-File c:\module.txt” in the test.ps1.
When I review the module.txt file I see it does not list my module there.
It seems that for some reason when I call the script this way it can’t access the module