Last active
February 23, 2018 12:13
-
-
Save unitycoder/c4c5330ad3494ee5b2344a0a86324a3d to your computer and use it in GitHub Desktop.
Fetch Github Latest Release "tag_name" with PowerShell in Visual Studio Pre-Build Event
This file contains 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
powershell.exe -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;$web = New-Object System.Net.WebClient;$web.Headers['User-Agent'] = 'DefinitelyBrowser';$results = $web.DownloadString('https://api.github.com/repos/user/repo/releases/latest');$results = $results | ConvertFrom-Json;$results = $results | select -expand tag_name;echo $results | Out-File $(ProjectDir)PreviousVersion.txt;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment