Support PSObject wrapped values in ArgumentToEncodingTransformationAttribute (#24555)

This commit is contained in:
Jordan Borean
2024-11-12 08:41:22 +05:00
committed by GitHub
parent 31b70ecd9f
commit ba238808fb
2 changed files with 4 additions and 0 deletions
@@ -89,6 +89,8 @@ Describe "File encoding tests" -Tag CI {
It "Parameter 'Encoding' should accept '<encoding>'" -TestCases @(
@{ encoding = 1251 }
@{ encoding = "windows-1251" }
# Piping the string creates a PSObject boxed value that we are testing.
@{ encoding = ("windows-1251" | Write-Output) }
) {
param ( $encoding )
$testFile = "${TESTDRIVE}/fileEncoding-$($encoding).txt"