Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EncodingTransformation for Encoding and int instances wrapped in PSObject #37

Conversation

santisq
Copy link
Owner

@santisq santisq commented Nov 6, 2024

Same issue as #34 but when Encoding and int instances are wrapped in PSObject:

$utf8 = [System.Text.Encoding]::UTF8 | Write-Output
Get-ZipEntry .\test.zip | Get-ZipEntryContent -Encoding $utf8

# Get-ZipEntryContent: Cannot process argument transformation on parameter 'Encoding'.
#                      Could not convert input 'System.Text.UTF8Encoding+UTF8EncodingSealed' to a valid Encoding object.

$utf8 = [System.Text.Encoding]::UTF8.CodePage | Write-Output
Get-ZipEntry .\test.zip | Get-ZipEntryContent -Encoding $utf8

# Get-ZipEntryContent: Cannot process argument transformation on parameter 'Encoding'.
#                      Could not convert input '65001' to a valid Encoding object.

@santisq santisq added the bug Something isn't working label Nov 6, 2024
@santisq santisq self-assigned this Nov 6, 2024
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.95%. Comparing base (ef826cd) to head (f397433).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #37      +/-   ##
==========================================
+ Coverage   87.92%   87.95%   +0.03%     
==========================================
  Files          36       36              
  Lines        1565     1569       +4     
  Branches      207      207              
==========================================
+ Hits         1376     1380       +4     
  Misses        145      145              
  Partials       44       44              
Flag Coverage Δ
PS_5.1 87.06% <100.00%> (+0.03%) ⬆️
PS_7_Linux 84.25% <100.00%> (+0.04%) ⬆️
PS_7_Windows 84.63% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@santisq santisq merged commit 15cf8e4 into main Nov 6, 2024
7 checks passed
@santisq santisq deleted the 36-fix-encodingtransformation-for-encoding-and-int-instances-wrapped-in-psobject branch November 6, 2024 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix EncodingTransformation for Encoding and int instances wrapped in PSObject
1 participant