{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/core/issues/2090","repository_url":"https://api.github.com/repos/dotnet/core","labels_url":"https://api.github.com/repos/dotnet/core/issues/2090/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/core/issues/2090/comments","events_url":"https://api.github.com/repos/dotnet/core/issues/2090/events","html_url":"https://github.com/dotnet/core/issues/2090","id":385861046,"node_id":"MDU6SXNzdWUzODU4NjEwNDY=","number":2090,"title":"Inconsistent field/property names in the releases.json file","user":{"login":"tristanbarcelon","id":5810165,"node_id":"MDQ6VXNlcjU4MTAxNjU=","avatar_url":"https://avatars3.githubusercontent.com/u/5810165?v=4","gravatar_id":"","url":"https://api.github.com/users/tristanbarcelon","html_url":"https://github.com/tristanbarcelon","followers_url":"https://api.github.com/users/tristanbarcelon/followers","following_url":"https://api.github.com/users/tristanbarcelon/following{/other_user}","gists_url":"https://api.github.com/users/tristanbarcelon/gists{/gist_id}","starred_url":"https://api.github.com/users/tristanbarcelon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tristanbarcelon/subscriptions","organizations_url":"https://api.github.com/users/tristanbarcelon/orgs","repos_url":"https://api.github.com/users/tristanbarcelon/repos","events_url":"https://api.github.com/users/tristanbarcelon/events{/privacy}","received_events_url":"https://api.github.com/users/tristanbarcelon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-29T18:10:49Z","updated_at":"2018-12-12T14:08:55Z","closed_at":null,"author_association":"NONE","body":"The releases.json file for 1.0, 1.1, and 2.1 have inconsistent field/property names which causes errors when specific properties are accessed in code such as powershell. From one release record to another, there will be some sdk records that will have a version property while others will have version-sdk.\r\n\r\nTake for example this releases.json file for [1.1](https://raw.githubusercontent.com/dotnet/core/master/release-notes/1.1/releases.json). In this code snippet, I have set $Platform to x64 and $ReleaseType = sdk so it is only looking at the sdk property of a given release if it exists. $RawContentUrl is a variable calculated from the [release index](https://github.com/dotnet/core/blob/master/release-notes/releases-index.json). If the release index for 1.1 is https://github.com/dotnet/core/blob/master/release-notes/1.1/releases.json, $RawContentUrl will be https://raw.githubusercontent.com/dotnet/core/master/release-notes/1.1/releases.json.\r\n\r\n```Powershell\r\n$DotnetRelease = ((New-Object System.Net.WebClient).DownloadString($RawContentUrl) | ConvertFrom-Json )\r\n\r\n$DotnetRelease.releases.GetEnumerator() | Where-Object { (-not $_.'release-version'.ToString().Contains('-')) -and $_.PSOBject.Properties['sdk'].Value } ` |\r\n                        Select-Object -Property 'sdk' | Where-Object { -not $_.sdk.version.ToString().Contains('-') } | ForEach-Object { \r\n                            $_.sdk.files.GetEnumerator() | Where-Object { $_.name -ilike \"*win-$($Platform)*.exe\" } ` | \r\n                            Select-Object -Property @{ label = 'ReleaseType'; expression = { $ReleaseType }}, url, hash }\r\n```\r\n\r\nI get an error _You cannot call a method on a null-valued expression_ but only on specific release records. 1.1.11 -1.1.9 works just fine. I get an error for 1.1.8 because the property is called version-sdk instead of version. 1.1.7 is fine too.\r\n\r\nIn the [1.0 releases.json file](https://raw.githubusercontent.com/dotnet/core/master/release-notes/1.0/releases.json), release 1.0.1 does not have a release-version property while others do. This causes a similar error with the expression `-not $_.'release-version'.ToString().Contains('-')`.\r\n\r\nIn general, I'm writing a utility that will enumerate available SDK, WindowsHosting, or Runtime executables to facilitate selection of the proper file to download given a known target runtime while also excluding pre-release versions with dashes in the value. There is a dotnet-install.ps1 utility but it does not install Windows hosting executables. There is a dotnetcore-windowshosting package but it does some strange things I do not understand, such as downloading the server hosting package, but only installing IIS ASP.Net Core Module even though both dotnetcore and asp.net core runtimes are already packaged with the windows hosting bundle.\r\n\r\nWould it be possible to correct the releases.json files to be more consistent?"},"comment":{"url":"https://api.github.com/repos/dotnet/core/issues/comments/446599971","html_url":"https://github.com/dotnet/core/issues/2090#issuecomment-446599971","issue_url":"https://api.github.com/repos/dotnet/core/issues/2090","id":446599971,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjU5OTk3MQ==","user":{"login":"tristanbarcelon","id":5810165,"node_id":"MDQ6VXNlcjU4MTAxNjU=","avatar_url":"https://avatars3.githubusercontent.com/u/5810165?v=4","gravatar_id":"","url":"https://api.github.com/users/tristanbarcelon","html_url":"https://github.com/tristanbarcelon","followers_url":"https://api.github.com/users/tristanbarcelon/followers","following_url":"https://api.github.com/users/tristanbarcelon/following{/other_user}","gists_url":"https://api.github.com/users/tristanbarcelon/gists{/gist_id}","starred_url":"https://api.github.com/users/tristanbarcelon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tristanbarcelon/subscriptions","organizations_url":"https://api.github.com/users/tristanbarcelon/orgs","repos_url":"https://api.github.com/users/tristanbarcelon/repos","events_url":"https://api.github.com/users/tristanbarcelon/events{/privacy}","received_events_url":"https://api.github.com/users/tristanbarcelon/received_events","type":"User","site_admin":false},"created_at":"2018-12-12T14:08:55Z","updated_at":"2018-12-12T14:08:55Z","author_association":"NONE","body":"Hi @riezebosch, I did get some traction on this though at the expense of ignoring ones that cause issues. I'm also thinking that some of the values are incorrect. Try this cmdlet to see if it works out for you. Feel free to use it and provide comments.\r\n\r\n[Get-AvailableDotnetCoreReleaseFile.txt](https://github.com/dotnet/core/files/2672172/Get-AvailableDotnetCoreReleaseFile.txt)\r\n"}}
{"actor":{"display_login":"tristanbarcelon"}}