Skip to content

Commit

Permalink
v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed Oct 1, 2021
1 parent 422e16c commit 498c214
Show file tree
Hide file tree
Showing 8 changed files with 188 additions and 29 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog for WingetTools

## v0.6.0

+ Update `Install-Winget` to allow installing latest stable or preview build.
+ Update `Get-WGReleaseNote` to allow getting latest stable or preview release note.
+ Updated help documentation.

## v0.5.1

+ Revised `Install-Winget` to better test for the VCLibs requirement.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ If there are problems with commands in this module, try running the winget comma

Visit the winget Github repository for more information about the project at <https://github.com/microsoft/winget-cli>.

Last Updated _2021-09-15 13:51:49Z_
Last Updated _2021-10-01 18:43:06Z_
2 changes: 1 addition & 1 deletion WingetTools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
RootModule = 'WingetTools.psm1'

# Version number of this module.
ModuleVersion = '0.5.1'
ModuleVersion = '0.6.0'

# Supported PSEditions
CompatiblePSEditions = @('Desktop','Core')
Expand Down
64 changes: 55 additions & 9 deletions docs/Get-WGReleaseNote.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: WingetTools-help.xml
Module Name: WingetTools
online version: https://bit.ly/3nauPEz
Expand All @@ -14,7 +14,7 @@ Get the latest release note for winget.
## SYNTAX

```yaml
Get-WGReleaseNote [-AsMarkdown] [-Online] [<CommonParameters>]
Get-WGReleaseNote [-AsMarkdown] [-Online] [-Preview] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -28,13 +28,22 @@ This command will query the Github repository for the winget project and display
```powershell
PS C:\> Get-WGReleaseNote
Name : Windows Package Manager v1.0.11692
Version : v1.0.11692
Published : 6/24/2021 8:32:44 PM
Name : Windows Package Manager v1.1.12653
Version : v1.1.12653
Published : 9/27/2021 6:08:01 PM
Prerelease : False
Notes : This release fixes a few bugs. The first one is related to users
and installers executing [Ctrl]+[c]. The next is a fallback when
...
Notes : This release represents our Windows Package Manager 1.release
candidate build for Windows 10 (1809+).
Experimental features have been disabled in this release. We will
follow this release with another Pre-release "developer"
build at GitHub so users can continue with experimental features
available.
# Bugs
#797 Silent install of "winget install git.git" is not working
#1497 Make rename retry more frequently for longer, then try
making a hardlink
```

The default output.
Expand All @@ -54,11 +63,32 @@ PS C:\> Get-WGReleaseNote | Select-Object Name,Version,Published
Name Version Published
---- ------- ---------
Windows Package Manager v1.0.11692 v1.0.11692 6/24/2021 8:32:44 PM
Windows Package Manager v1.1.12653 v1.1.12653 9/27/2021 6:08:01 PM
```

The output is an object.

### Example 4

```powershell
PS C:\> Get-WGReleaseNote -Preview
Name : Windows Package Manager v1.1.12701
Version : v1.1.12701
Published : 9/28/2021 10:30:01 AM
Prerelease : True
Notes : This release is the first development build after the Windows
Package Manager 1.1 release candidate build for Windows 10
(1809+).
Experimental features have been enabled in this release. This
build will be released to Windows Insider Dev builds, and
Windows Package Manager Insiders.
```

Get the release note for the latest preview.

## PARAMETERS

### -AsMarkdown
Expand Down Expand Up @@ -93,6 +123,22 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Preview
Get latest preview release.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
Expand Down
27 changes: 21 additions & 6 deletions docs/Install-WinGet.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: WingetTools-help.xml
Module Name: WingetTools
online version: https://bit.ly/2WYteX6
Expand All @@ -14,7 +14,7 @@ Install the latest winget release from Github.
## SYNTAX

```yaml
Install-WinGet [-Passthru] [-WhatIf] [-Confirm] [<CommonParameters>]
Install-WinGet [-Preview] [-Passthru] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -42,7 +42,7 @@ Aliases: cf

Required: False
Position: Named
Default value: None
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
Expand All @@ -58,21 +58,36 @@ Aliases:

Required: False
Position: Named
Default value: None
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Shows what would happen if the cmdlet runs. The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -Preview
Install the latest preview build.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Expand Down
89 changes: 82 additions & 7 deletions en-US/WingetTools-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,17 @@ DAX Studio DaxStudio.DaxStudio 2.16.2.632</dev:code>
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Preview</maml:name>
<maml:description>
<maml:para>Get latest preview release.</maml:para>
</maml:description>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
Expand Down Expand Up @@ -432,6 +443,18 @@ DAX Studio DaxStudio.DaxStudio 2.16.2.632</dev:code>
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Preview</maml:name>
<maml:description>
<maml:para>Get latest preview release.</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>
Expand Down Expand Up @@ -471,13 +494,22 @@ DAX Studio DaxStudio.DaxStudio 2.16.2.632</dev:code>
<maml:title>-------------------------- Example 1 --------------------------</maml:title>
<dev:code>PS C:\&gt; Get-WGReleaseNote

Name : Windows Package Manager v1.0.11692
Version : v1.0.11692
Published : 6/24/2021 8:32:44 PM
Name : Windows Package Manager v1.1.12653
Version : v1.1.12653
Published : 9/27/2021 6:08:01 PM
Prerelease : False
Notes : This release fixes a few bugs. The first one is related to users
and installers executing [Ctrl]+[c]. The next is a fallback when
...</dev:code>
Notes : This release represents our Windows Package Manager 1.release
candidate build for Windows 10 (1809+).

Experimental features have been disabled in this release. We will
follow this release with another Pre-release "developer"
build at GitHub so users can continue with experimental features
available.

# Bugs
#797 Silent install of "winget install git.git" is not working
#1497 Make rename retry more frequently for longer, then try
making a hardlink</dev:code>
<dev:remarks>
<maml:para>The default output.</maml:para>
</dev:remarks>
Expand All @@ -495,11 +527,31 @@ Notes : This release fixes a few bugs. The first one is related to users

Name Version Published
---- ------- ---------
Windows Package Manager v1.0.11692 v1.0.11692 6/24/2021 8:32:44 PM</dev:code>
Windows Package Manager v1.1.12653 v1.1.12653 9/27/2021 6:08:01 PM</dev:code>
<dev:remarks>
<maml:para>The output is an object.</maml:para>
</dev:remarks>
</command:example>
<command:example>
<maml:title>-------------------------- Example 4 --------------------------</maml:title>
<dev:code>PS C:\&gt; Get-WGReleaseNote -Preview


Name : Windows Package Manager v1.1.12701
Version : v1.1.12701
Published : 9/28/2021 10:30:01 AM
Prerelease : True
Notes : This release is the first development build after the Windows
Package Manager 1.1 release candidate build for Windows 10
(1809+).

Experimental features have been enabled in this release. This
build will be released to Windows Insider Dev builds, and
Windows Package Manager Insiders.</dev:code>
<dev:remarks>
<maml:para>Get the release note for the latest preview.</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<command:relatedLinks>
<maml:navigationLink>
Expand Down Expand Up @@ -560,6 +612,17 @@ Windows Package Manager v1.0.11692 v1.0.11692 6/24/2021 8:32:44 PM</dev:code>
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Preview</maml:name>
<maml:description>
<maml:para>Install the latest preview build.</maml:para>
</maml:description>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
Expand Down Expand Up @@ -599,6 +662,18 @@ Windows Package Manager v1.0.11692 v1.0.11692 6/24/2021 8:32:44 PM</dev:code>
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Preview</maml:name>
<maml:description>
<maml:para>Install the latest preview build.</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>
Expand Down
15 changes: 12 additions & 3 deletions functions/Get-WGReleaseNote.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ Function Get-WGReleaseNote {
[Parameter(HelpMessage = "Create a markdown document.")]
[alias("md")]
[switch]$AsMarkdown,
[switch]$Online
[switch]$Online,
[Parameter(HelpMessage = "Get latest preview release")]
[switch]$Preview
)

Write-Verbose "[$((Get-Date).TimeofDay)] Starting $($myinvocation.mycommand)"
Expand All @@ -18,8 +20,15 @@ Function Get-WGReleaseNote {
Write-Verbose "[$((Get-Date).TimeofDay)] Getting information from $uri"
$get = Invoke-RestMethod -uri $uri -Method Get -ErrorAction stop

Write-Verbose "[$((Get-Date).TimeofDay)] getting latest release"
$data = $get | Select-Object -first 1
if ($Preview) {
Write-Verbose "[$((Get-Date).TimeofDay)] Getting latest preview release"
$data = $get | Where-Object {$_.PreRelease} | Select-Object -first 1
}
else {
Write-Verbose "[$((Get-Date).TimeofDay)] Getting latest stable release"
$data = $get | Where-Object {-not $_.PreRelease} | Select-Object -first 1

}

$data | Select-Object -Property Name, tag_name, published_at, prerelease,

Expand Down
12 changes: 10 additions & 2 deletions functions/Install-Winget.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Function Install-WinGet {
[OutputType("None")]
[OutputType("Microsoft.Windows.Appx.PackageManager.Commands.AppxPackage")]
Param(
[Parameter(HelpMessage = "Install the latest preview build.")]
[switch]$Preview,
[Parameter(HelpMessage = "Display the AppxPackage after installation.")]
[switch]$Passthru
)
Expand Down Expand Up @@ -41,10 +43,16 @@ Function Install-WinGet {
Try {
Write-Verbose "[$((Get-Date).TimeofDay)] Getting information from $uri"
$get = Invoke-RestMethod -Uri $uri -Method Get -ErrorAction stop
if ($preview) {
Write-Verbose "[$((Get-Date).TimeofDay)] Getting latest preview release"
$data = ($get | where-object {$_.Prerelease} | Select-Object -first 1).Assets | Where-Object name -Match 'msixbundle'
}
else {
Write-Verbose "[$((Get-Date).TimeofDay)] Getting latest stable release"
$data = ($get | where-object {-Not $_.Prerelease} | Select-Object -first 1).Assets | Where-Object name -Match 'msixbundle'

Write-Verbose "[$((Get-Date).TimeofDay)] getting latest release"
}
#$data = $get | Select-Object -first 1
$data = $get[0].assets | Where-Object name -Match 'msixbundle'

$appx = $data.browser_download_url
#$data.assets[0].browser_download_url
Expand Down

0 comments on commit 498c214

Please sign in to comment.