I installed the Powershell Tools for Visual Studio 2015 then I created a tests.ps1 files inside my Powershell project in VS2015. the test explorer recognizes the declared test, but when I try to run the test I get this: "Result Message: Failed to load Pester module. The specified module 'Pester' was not loaded because no valid module file was found in any module directory."
I discover that I did not have the Pester in my Pc, I download it from GitHub, then I add the folder to the $env:PSModulePath. Powershell identifies the module, but was not able to import it, so I move the folder from its original location to: c:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ Now any console of powershell is able to import the module: ISE, Powershell console, Powershell interactive window in VS2015.
Then I try to run the test again, I keep getting the same message.
As I stated in my question: I added the folder with the Pester to the environment variable called PSModulePath, but I added to the end of it.
For some reason the adaptor looks for the path of module only under the first folder in that environment variable.
I changed the order and moved the path to the beginning of the string. Voila!! it works.