From 7778941b40d9c92cbc3ce2a50aa005b06d67a67e Mon Sep 17 00:00:00 2001 From: Mark Kraus Date: Wed, 22 Nov 2017 03:34:05 -0600 Subject: [PATCH] Fix Import-CliXml Tests (#5521) Add checks that ProcessName is not null or empty. --- .../Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 index c53bced022..1ddc40d5c2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 @@ -125,7 +125,7 @@ Context "Import-CliXML" { BeforeAll { - $gpsList = Get-Process powershell + $gpsList = Get-Process pwsh $gps = $gpsList | Select-Object -First 1 $filePath = Join-Path $subFilePath 'gps.xml' @@ -161,7 +161,9 @@ $fileContent | Should Not Be $null $importedProcess = Import-Clixml $filePath + $importedProcess.ProcessName | Should Not BeNullOrEmpty $gps.ProcessName | Should Be $importedProcess.ProcessName + $importedProcess.Id | Should Not BeNullOrEmpty $gps.Id | Should Be $importedProcess.Id } @@ -173,7 +175,9 @@ $fileContent | Should Not Be $null $importedProcess = Import-Clixml $filePath + $importedProcess.ProcessName | Should Not BeNullOrEmpty $gps.ProcessName | Should Be $importedProcess.ProcessName + $importedProcess.Id | Should Not BeNullOrEmpty $gps.Id | Should Be $importedProcess.Id }