Skip to content

Commit 596c62a

Browse files
Copy-DbaLogin - Fix Join-Path usage in test to resolve null path parameter error
The Join-Path calls were incorrectly chained, causing the second call to receive null for the -Path parameter. Split into two separate statements with explicit parameters to ensure cross-platform compatibility. (do Copy-DbaLogin) Co-authored-by: Chrissy LeMaire <[email protected]>
1 parent c0aa632 commit 596c62a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/Copy-DbaLogin.Tests.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ Describe $CommandName -Tag IntegrationTests {
294294
# This test verifies that the protection code exists and is properly structured
295295
# Manual testing should be performed in a domain environment to verify the protection works
296296

297-
$functionPath = Join-Path -Path $TestConfig.ModuleBase -ChildPath "public" | Join-Path -ChildPath "Copy-DbaLogin.ps1"
297+
$publicPath = Join-Path -Path $TestConfig.ModuleBase -ChildPath "public"
298+
$functionPath = Join-Path -Path $publicPath -ChildPath "Copy-DbaLogin.ps1"
298299
$functionContent = Get-Content $functionPath -Raw
299300
$functionContent | Should -BeLike '*LoginType -eq "WindowsGroup"*'
300301
$functionContent | Should -BeLike '*potential lockout risk*'

0 commit comments

Comments
 (0)