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

Possible encoding error in New-AppSourceSubmission #2692

Closed
jonaswre opened this issue Sep 19, 2022 · 4 comments
Closed

Possible encoding error in New-AppSourceSubmission #2692

jonaswre opened this issue Sep 19, 2022 · 4 comments

Comments

@jonaswre
Copy link
Contributor

jonaswre commented Sep 19, 2022

I was just trying to get New-AppSourceSubmission to work.

But it seems like there is an Issure with the encoding when posting or putting content.

First error I recieved was in.

$packageUpload = Invoke-IngestionApiPost -authContext $authContext -path "/products/$productId/packages" -Body $body -silent:($silent.IsPresent)

If the filename has any special characters (äöü) then the request fails with internal server error (500).
There is an easy workaround. I just renamed the file.

But for the second problem there is no easy workaround.

The following line "reuploads" the terms and services which need to have special characters.

$result = Invoke-IngestionApiPut -authContext $authContext -path "/products/$productId/properties/$($property.id)" -Body ($property | ConvertTo-HashTable -recurse) -silent:($silent.IsPresent)

Just because was curious i edited the terms and services to "Test".

That "fixed" it.

Just as a note the terms were correctly printed in the log which could mean the get works fine.

@freddydk
Copy link
Contributor

Will investigate, thanks Jonas

@freddydk
Copy link
Contributor

This is apparently a bug in PowerShell - if your body contains UTF-8 characters - you cannot transfer a json string - you need to transfer a byte[]

freddydk pushed a commit that referenced this issue Sep 20, 2022
freddydk added a commit that referenced this issue Sep 20, 2022
@jonaswre
Copy link
Contributor Author

It seems like json and powershell are arch rivals. Thanks for the fix.

@freddydk
Copy link
Contributor

Shipped in 4.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants