Additional Image Support in Write-RsCatalogItem#215
Open
Branden-DeVries wants to merge 1 commit intomicrosoft:masterfrom
Open
Additional Image Support in Write-RsCatalogItem#215Branden-DeVries wants to merge 1 commit intomicrosoft:masterfrom
Branden-DeVries wants to merge 1 commit intomicrosoft:masterfrom
Conversation
nschonni
reviewed
Jan 22, 2019
| #If it is a resource we need to save the extension so the file can be recognized | ||
| $itemName = $item.Name | ||
| $property.Name = 'MimeType' | ||
| <# |
Contributor
There was a problem hiding this comment.
Better to delete code rather than comment it out if you're replacing it
jtarquino
reviewed
Jan 23, 2019
| #> | ||
| switch ($item.Extension) | ||
| { | ||
| '.png' {$property.Value = 'image/png'} |
Member
There was a problem hiding this comment.
you are missing the break; at the end of the switch statement (https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_switch?view=powershell-6)
jtarquino
reviewed
Jan 23, 2019
| switch ($item.Extension) | ||
| { | ||
| '.png' {$property.Value = 'image/png'} | ||
| {$_ -in '.jpg','.jpeg'} {$property.Value = 'image/jpeg'} |
Member
There was a problem hiding this comment.
for better readbility please split the condition for .jpg and jpeg
jtarquino
reviewed
Jan 23, 2019
| ) | ||
| { | ||
| throw "Invalid item specified! You can only upload Report, DataSource, DataSet and jpg/png files using this command!" | ||
| throw "Invalid item specified! You can only upload Report, DataSource, DataSet and jpg/png/gif/bmp files using this command!" |
Member
There was a problem hiding this comment.
please also add a test, check https://github.com/Microsoft/ReportingServicesTools/blob/c92b8b0a06819da698dc10bc21258d79d43aafc1/Tests/CatalogItems/Write-RsCatalogItem.Tests.ps1#L185 for reference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes # 214
Changes proposed in this pull request:
How to test this code:
Has been tested on (remove any that don't apply):