Skip to content

Commit 5cce09f

Browse files
Start-DbaMigration.Tests - Fix additional PS 5.1 .Count issues
Wrap $script:ssisCalls and Where-Object results in @() for PS 5.1 compatibility where .Count returns $null on single objects. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8d2dbee commit 5cce09f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/Start-DbaMigration.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,10 @@ Describe $CommandName -Tag UnitTests {
433433

434434
$null = Start-DbaMigration -Source "sql1" -Destination "sql2" -Exclude $excludeForSsisOnly
435435
$script:stopMessages | Should -BeNullOrEmpty
436-
$script:ssisCalls.Count | Should -Be 1
436+
@($script:ssisCalls).Count | Should -Be 1
437437
$script:ssisCalls[0].Source.VersionMajor | Should -Be 15
438438
$script:ssisCalls[0].Destination | Should -Be "sql2"
439-
($script:messages | Where-Object { $PSItem -like "*Migrating SSIS catalog" }).Count | Should -Be 1
439+
@($script:messages | Where-Object { $PSItem -like "*Migrating SSIS catalog" }).Count | Should -Be 1
440440
} finally {
441441
foreach ($functionName in $functionNames) {
442442
if ($originalFunctions.ContainsKey($functionName)) {

0 commit comments

Comments
 (0)