Last active
April 13, 2018 11:20
-
-
Save seesharper/d75f14632db60f9734c75e6b5deb56a9 to your computer and use it in GitHub Desktop.
List the latest OmniSharp release
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
#! "netcoreapp2.0" | |
#r "nuget: WindowsAzure.Storage, 9.1.1" | |
using Microsoft.WindowsAzure.Storage; | |
using Microsoft.WindowsAzure.Storage.Auth; | |
using Microsoft.WindowsAzure.Storage.Blob; | |
await ListLatestOmniSharpRelease(); | |
public static async Task ListLatestOmniSharpRelease() | |
{ | |
// Create the client object using the Blob service endpoint. | |
CloudBlobClient blobClient = new CloudBlobClient(new Uri(@"https://roslynomnisharp.blob.core.windows.net/")); | |
// Get a reference to a container that's available for anonymous access. | |
CloudBlobContainer container = blobClient.GetContainerReference("releases"); | |
var result = await container.ListBlobsSegmentedAsync(string.Empty, true, BlobListingDetails.None, new int?(), new BlobContinuationToken(),null, null); | |
var blobs = result.Results.Cast<CloudBlockBlob>() | |
.Where(b => !b.Uri.AbsoluteUri.Contains("http-")) | |
.OrderByDescending(cbb => cbb.Properties.LastModified).ToArray(); | |
var lastReleases = blobs.Take(10).OrderBy(b => b.Uri.AbsolutePath); | |
foreach(var lastRelease in lastReleases) | |
{ | |
WriteLine(lastRelease.Uri); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment