Skip to content

Commit 7e1e4da

Browse files
authored
Update InvokeMSI.Tests.ps1 (#9)
Fixed MSI Pester tests in cases where MSI tmp files have a variable-length hex suffix
1 parent 96fd1a6 commit 7e1e4da

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

TestHarnesses/T1218.007_Msiexec/InvokeMSI.Tests.ps1

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Describe 'Invoke-ATHMSI' {
105105
$Result.RunnerProcessId | Should -Not -BeNullOrEmpty
106106
$Result.RunnerProcessName | Should -Not -BeNullOrEmpty
107107
$Result.RunnerChildProcessId | Should -Not -BeNullOrEmpty
108-
$Result.RunnerChildProcessName | Should -Match 'MSI[A-Z0-9]{4}\.tmp'
108+
$Result.RunnerChildProcessName | Should -Match 'MSI[A-Z0-9]{2,4}\.tmp'
109109
$Result.RunnerChildProcessCommandLine | Should -Not -BeNullOrEmpty
110110
}
111111

@@ -183,7 +183,7 @@ Describe 'Invoke-ATHMSI' {
183183
$Result.MsiExecProcessCommandLine | Should -BeNull
184184
$Result.RunnerProcessId | Should -Not -BeNullOrEmpty
185185
$Result.RunnerChildProcessId | Should -Not -BeNullOrEmpty
186-
$Result.RunnerChildProcessName | Should -Match 'MSI[A-Z0-9]{4}\.tmp'
186+
$Result.RunnerChildProcessName | Should -Match 'MSI[A-Z0-9]{2,4}\.tmp'
187187
$Result.RunnerChildProcessCommandLine | Should -Not -BeNullOrEmpty
188188
}
189189

@@ -261,7 +261,7 @@ Describe 'Invoke-ATHMSI' {
261261
$Result.MsiExecProcessCommandLine | Should -BeNull
262262
$Result.RunnerProcessId | Should -Not -BeNullOrEmpty
263263
$Result.RunnerChildProcessId | Should -Not -BeNullOrEmpty
264-
$Result.RunnerChildProcessName | Should -Match 'MSI[A-Z0-9]{4}\.tmp'
264+
$Result.RunnerChildProcessName | Should -Match 'MSI[A-Z0-9]{2,4}\.tmp'
265265
$Result.RunnerChildProcessCommandLine | Should -Not -BeNullOrEmpty
266266
}
267267

@@ -313,7 +313,7 @@ Describe 'Invoke-ATHMSI' {
313313
$Result.MsiExecProcessCommandLine | Should -BeNull
314314
$Result.RunnerProcessId | Should -Not -BeNullOrEmpty
315315
$Result.RunnerChildProcessId | Should -Not -BeNullOrEmpty
316-
$Result.RunnerChildProcessName | Should -Match 'MSI[A-Z0-9]{4}\.tmp'
316+
$Result.RunnerChildProcessName | Should -Match 'MSI[A-Z0-9]{2,4}\.tmp'
317317
$Result.RunnerChildProcessCommandLine | Should -Not -BeNullOrEmpty
318318
}
319319
}

0 commit comments

Comments
 (0)