forked from haavarstein/Evergreen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9684519
commit c2627f3
Showing
5 changed files
with
51 additions
and
49 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Function Get-MicrosoftPowerShellCore { | ||
<# | ||
.SYNOPSIS | ||
Returns the latest PowerShell Core version number. | ||
.DESCRIPTION | ||
Returns the latest PowerShell Core version number. | ||
.NOTES | ||
Author: Aaron Parker | ||
Twitter: @stealthpuppy | ||
.LINK | ||
https://github.com/aaronparker/Get.Software | ||
.EXAMPLE | ||
Get-PowerShellCoreVersion | ||
Description: | ||
Returns the latest PowerShell Core version number. | ||
#> | ||
[CmdletBinding()] | ||
Param() | ||
|
||
# Get latest version and download latest PowerShell Core release via GitHub API | ||
# Query the PowerShell Core repository for releases, keeping the latest stable release | ||
$Content = Invoke-WebContent -Uri $script:resourceStrings.Applications.MicrosoftPowerShellCore.Uri ` | ||
-ContentType $script:resourceStrings.Applications.MicrosoftPowerShellCore.ContentType -Raw | ||
$JsonReleases = $Content | ConvertFrom-Json | ||
$LatestRelease = $JsonReleases | Where-Object { $_.prerelease -eq $False } | Select-Object -First 1 | ||
|
||
# Build the output object with release details | ||
ForEach ($release in $latestRelease.assets) { | ||
$PSObject = [PSCustomObject] @{ | ||
Version = $LatestRelease.tag_name | ||
Platform = "Platform" | ||
Architecture = "x64" | ||
URI = $release.browser_download_url | ||
Size = $release.size | ||
} | ||
Write-Output -InputObject $PSObject | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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