Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shorten TestDrive directory name (#2239)
* 2238 Shorten TestDrive directory name. Pester currently uses a full GUID as its temp directory name, which uses 36 characters. This contributes to test errors when paths used in tests exceed the Windows max path of 260 characters. The `[IO.Path]::GetTempFileName()` only uses 4 characters for the unique/random part of its filename. Follow the same pattern in `New-RandomTempDirectory` by only using the 4 characters. A GUID, when converted to a string, only uses hex characters: 0-9 and a-f, which gives us 65,536 unique possible values. Instead, lets use `[IO.Path]::GetRandomFileName()`. It generates a name that uses all letters of the alphabet and the numbers 0-9, which gives us 36^4 = 1,679,616 possible values. * shorter name in registry * Pester_ prefix --------- Co-authored-by: Jakub Jareš <me@jakubjares.com>
- Loading branch information