PowerShell.ReleasesAPI-Help.xml
<?xml version="1.0" encoding="utf-8"?> <helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-PwshReleases</command:name> <command:verb>Get</command:verb> <command:noun>PwshReleases</command:noun> <maml:description> <maml:para>Get PowerShell releases</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Get releases of PowerShell 6.0 and higher from the official GitHub repo.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-PwshReleases</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>FilterReleaseVersion</maml:name> <maml:description> <maml:para>Filter by the release version.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>NoPreReleases</maml:name> <maml:description> <maml:para>Filter out pre-release items.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>FilterAssetsByPlatform</maml:name> <maml:description> <maml:para>Filter the platform (Commonly the operating system) for the asset in a release.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none"> <maml:name>FilterAssetsByArchitecture</maml:name> <maml:description> <maml:para>Filter the architecture for the asset in a release.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="4" aliases="none"> <maml:name>FilterAssetsByFileType</maml:name> <maml:description> <maml:para>Filter the file type for the asset in a release</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none"> <maml:name>FilterAssetsByArchitecture</maml:name> <maml:description> <maml:para>Filter the architecture for the asset in a release.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="4" aliases="none"> <maml:name>FilterAssetsByFileType</maml:name> <maml:description> <maml:para>Filter the file type for the asset in a release</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>FilterAssetsByPlatform</maml:name> <maml:description> <maml:para>Filter the platform (Commonly the operating system) for the asset in a release.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>FilterReleaseVersion</maml:name> <maml:description> <maml:para>Filter by the release version.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>NoPreReleases</maml:name> <maml:description> <maml:para>Filter out pre-release items.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>PwshReleaseItem[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> Get-PwshReleases -FilterReleaseVersion "7.1" -NoPreReleases</dev:code> <dev:remarks> <maml:para>Get all of the releases of PowerShell with the release version of '7.1' and filter out pre-releases.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> $pwshRelease = Get-PwshReleases -FilterReleaseVersion "7.1" -NoPreReleases -FilterAssetsByPlatform "macOS" -FilterAssetsByFileType "pkg" | Where-Object { $PSItem.Tag -eq "v7.1.3" } PS C:\> $pwshRelease Name : v7.1.3 Release of PowerShell ReleaseVersion : 7.1 Tag : v7.1.3 ReleaseDate : 3/11/2021 11:29:58 PM IsPreRelease : False Assets : {macOS x64 [pkg]} ReleasePage : https://github.com/PowerShell/PowerShell/releases/tag/v7.1.3 PS C:\> $pwshRelease.Assets[0].DownloadFile("/tmp/") Get all of the releases of PowerShell with the release version of '7.1', filter out pre-releases, and then filter to only show assets that are for 'macOS' with a file type of 'pkg'. Then filter to get the release tag for 'v7.1.3' with 'Where-Object'. Then download the first asset to the '/tmp/' directory.</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> </helpItems> |