Skip to content

Commit e1ffe69

Browse files
committed
Update error handling in Get-FileProductVersion function to remove 'Stop' action
1 parent 20b39e8 commit e1ffe69

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

source/Private/Get-FileProductVersion.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ function Get-FileProductVersion
3535
{
3636
$errorMessage = $script:localizedData.Get_FileProductVersion_GetFileProductVersionError -f $Path, $_.Exception.Message
3737

38-
Write-Error -Message $errorMessage -ErrorAction 'Stop'
38+
Write-Error -Message $errorMessage
3939
}
4040
}

tests/Unit/Private/Get-FileProductVersion.Tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Describe 'Get-FileProductVersion' {
8484
$mockGetFileProductVersionErrorMessage = $script:localizedData.Get_FileProductVersion_GetFileProductVersionError -f $mockFilePath, 'Mock exception message'
8585

8686
{
87-
Get-FileProductVersion -Path $mockFilePath
87+
Get-FileProductVersion -Path $mockFilePath -ErrorAction 'Stop'
8888
} | Should -Throw $mockGetFileProductVersionErrorMessage
8989
}
9090
}

0 commit comments

Comments
 (0)