-
Notifications
You must be signed in to change notification settings - Fork 39
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
New-StoreBrokerConfigFile generates incorrect targetPublishDate value in PowerShell Core 6.2+ #179
Comments
Thought this issue was specific to PowerShell Core but am also seeing this on Azure DevOps using Windows PowerShell 5.x. |
Interesting. This does not repro for me at all on PS 5.1.19013.1002. Here's the simple repro: $rawSub = '{"id":"123245","applicationCategory":"UtilitiesAndTools","visibility":"Public","targetPublishMode":"Immediate","targetPublishDate":"1601-01-01T00:00:00.0000000Z","friendlyName":"Submission 87","trailers":[]}'
$sub = $rawSub | convertfrom-json
Write-Host (' "targetPublishDate": .*,' -replace '"targetPublishDate": .*,', "`"targetPublishDate`": $($sub.targetPublishDate | ConvertTo-Json)") On PS 5.1.19013.1002, this returns back: I'd like to better understand why we're seeing a difference in behavior here before I'd take any change to the code. |
Yep, looks to be PowerShell Core specific. PowerShell Core 6.2.0 PS> $x = ConvertFrom-Json '{"id":"123245","applicationCategory":"UtilitiesAndTools","visibility":"Public","targetPublishMode":"Immediate","targetPublishDate":"1601-01-01T00:00:00.0000000Z","friendlyName":"Submission 87","trailers":[]}'
PS> $x.targetPublishDate | ConvertTo-Json
{
"value": "1601-01-01T00:00:00Z",
"DateTime": "Monday, January 1, 1601 12:00:00 AM"
} Windows PowerShell 5.1.18362.145 PS> $x = ConvertFrom-Json '{"id":"123245","applicationCategory":"UtilitiesAndTools","visibility":"Public","targetPublishMode":"Immediate","targetPublishDate":"1601-01-01T00:00:00.0000000Z","friendlyName":"Submission 87","trailers":[]}'
PS> $x.targetPublishDate | ConvertTo-Json
"1601-01-01T00:00:00.0000000Z" My Azure Pipeline data point is invalid. It was working with a tainted StoreBroker configuration file. Thanks! |
Thanks for calling attention to this though. This looks like further debt with ensuring that this runs correctly with PS Core 6+. I think more end-to-end testing needs to be done in that environment so that a holistic look at all the work that needs to be done can be done at once. For instance, if this change was to be fixed, we'd also need to make a similar change for the IAP code in PackageTool, and possibly with the API-interacting code in the other files (still to be tested). It might also be worthwhile checking to see if this is actually working as intended by the PowerShell team, or if it's in fact a bug in PS Core 6. |
Windows 10 1909 18363.418
PSVersion 6.2.0 ⚠ PowerShell Core ⚠ (Also seeing this on Azure DevOps with Windows PowerShell)
StoreBroker 1.19.1
When generating a new configuration via
New-StoreBrokerConfigFile
, thetargetPublishDate
value is incorrectly specified as an object containingvalue
andDateTime
properties. When attempting to submit this later viaUpdate-ApplicationSubmission
the API will reject it.Generated snippet:
Sample response (
MS-CorrelationId: e767cde6-b049-4908-804f-beeaa36eafbd
):The text was updated successfully, but these errors were encountered: