PowerShell/test
Dan Travison 4683934793 Update PowerShell to handle the case where the Windows PowerShell module path is already in the environment's PSModulePath (#7727)
This change updates ModuleIntrinsics.GetModulePath to handle the case where the Windows PowerShell module path is already in the environment's PSModulePath or when launched from a different version of PowerShell.

Previously, GetModulePath would append $PSHOME\Modules to the PSModulePath after removing the path for the launching version without considering the Windows PowerShell module path. The result, was the Windows PowerShell modules were found first and loaded incompatible modules; such as the built-in modules.

The change detects the Windows PowerShell module path and inserts $PSHOME\Modules path before it. The new test simulates launching from a different version of pwsh that has already added the Windows PowerShell module path.

Fixes #7679
2018-09-10 10:58:38 -07:00
..
common Add tests to report when package references are out of date (#7661) 2018-08-31 12:50:51 -07:00
csharp Add xunit project to PowerShell.sln and make it runable from within VisualStudio (#7254) 2018-08-02 11:51:04 -07:00
docker/networktest Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
hosting Merged PR 4656: Add back the powershell-core source for hosting tests 2018-08-21 17:24:06 +00:00
packaging/windows Simplify the paths the MSI uses (#6442) 2018-04-02 10:47:29 -07:00
powershell Update PowerShell to handle the case where the Windows PowerShell module path is already in the environment's PSModulePath (#7727) 2018-09-10 10:58:38 -07:00
shebang Reorganize tests 2016-01-14 17:00:06 -08:00
tools Update to latest package references, runtime framework, and SDK (#7646) 2018-08-30 18:39:44 -07:00
README.md Add test/README.md 2016-03-30 23:30:26 -07:00
Test.Common.props Update to latest package references, runtime framework, and SDK (#7646) 2018-08-30 18:39:44 -07:00

Testing

The tests are organized by testing language. Thus Pester tests, which are written in the PowerShell language, are in ./powershell and xUnit tests, written in C#, are in ./csharp. The sanity tests for the Full .NET build of PowerShell are in ./fullclr, and the third-party shebang test is in ./shebang.