Skip to content

Commit 066d50a

Browse files
Keep help-link tests compatible with PowerShell 5.1
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 4bcdb89 commit 066d50a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/PublicHelpLinks.Tests.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ $publicFunctionsPath = Join-Path -Path $publicFunctionsPath -ChildPath 'public'
1313
$testCases = Get-ChildItem -Path $publicFunctionsPath -Filter '*.ps1' -Recurse -File |
1414
Sort-Object -Property FullName |
1515
ForEach-Object {
16-
$relativePath = [IO.Path]::GetRelativePath($publicFunctionsPath, $_.FullName)
17-
$relativeDirectory = Split-Path -Path $relativePath -Parent
16+
$relativeDirectory = $_.DirectoryName.Remove(0, $publicFunctionsPath.Length).TrimStart(
17+
[char[]] @([IO.Path]::DirectorySeparatorChar, [IO.Path]::AltDirectorySeparatorChar)
18+
)
1819
$documentationPath = if ($relativeDirectory) {
1920
'{0}/{1}' -f ($relativeDirectory -replace '[\\/]', '/'), $_.BaseName
2021
} else {

0 commit comments

Comments
 (0)