ethanbergstrom / winget Goto Github PK
View Code? Open in Web Editor NEWPackageManagement (OneGet) package provider for use with Windows Package Manager (winget)
License: MIT License
PackageManagement (OneGet) package provider for use with Windows Package Manager (winget)
License: MIT License
Running "Find-Package OpenJS.NodeJS -Provider WinGet" on a german OS (Windows 10, x64, 21H2) does not find any packages. (winget-cli is installed)
Find-Package : No match was found for the specified search criteria and package name 'OpenJS.NodeJS'. Try
Get-PackageSource to see all available registered package sources.
In Zeile:1 Zeichen:1
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exceptio
n
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
WinGet output:
winget show Mozilla.Firefox
Found Mozilla Firefox [Mozilla.Firefox]
Version: 98.0
Publisher: Mozilla
Publisher Url: https://www.mozilla.org/en-US/
Publisher Support Url: https://support.mozilla.org/en-US/
Author: Mozilla Foundation
Moniker: firefox
Description: Firefox Browser, also known as Mozilla Firefox or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation.
Firefox uses the Gecko layout engine to render web pages, which implements current and anticipated web standards.
In 2017, Firefox began incorporating new technology under the code name Quantum to promote parallelism and a more intuitive user interface.
Firefox is officially available for Windows 7 or newer, macOS, and Linux.
Its unofficial ports are available for various Unix and Unix-like operating systems including FreeBSD, OpenBSD, NetBSD, illumos, and Solaris Unix.
Homepage: https://www.mozilla.org/en-US/firefox/
License: Mozilla Public License Version 2.0
License Url: https://www.mozilla.org/en-US/MPL/2.0
Privacy Url: https://www.mozilla.org/en-US/privacy/websites
Copyright Url: https://www.mozilla.org/en-US/foundation/trademarks/policy
Release Notes: New
• Firefox has a new optimized download flow. Instead of prompting every time, files will download automatically. However, they can still be opened from the downloads panel with just one click.
• Firefox allows users to choose from a number of built-in search engines to set as their default. In this release, some users who had previously configured a default engine might notice their default search engine has changed since Mozilla was unable to secure formal permission to continue including certain search engines in Firefox.
Fixed
• Now, you can set a default app to open a file type. Choose the application you want to use to open files of a specific type in your Firefox settings.
• After updating to Firefox version 98, "Always ask" download actions will now be reset.
• Various security fixes.
Enterprise
• Various bug fixes and new policies have been implemented in the latest version of Firefox. You can find more information in the Firefox for Enterprise 98 Release Notes.
Release Notes Url: https://www.mozilla.org/en-US/firefox/98.0/releasenotes/
Installer:
Type: wix
Locale: en-US
Download Url: https://download-installer.cdn.mozilla.net/pub/firefox/releases/98.0/win64/en-US/Firefox%20Setup%2098.0.msi
SHA256: 61962b0e80eebf389a44e8dd5bf460d5ddf6bd02e37e4ca2df3aba522a3f722b
Release Date: 2022-03-08
WinGet provider output
Find-Package Mozilla.Firefox -Provider WinGet
Name Version Source Summary
---- ------- ------ -------
Mozilla.Firefox 98.0 WinGet
PS C:\WINDOWS\system32> Find-Package Mozilla.Firefox -Provider WinGet | Format-List
FastPackageReference : Mozilla.Firefox#98.0#WinGet
ProviderName : WinGet
Source : WinGet
Status : Available
SearchKey :
FullPath :
PackageFilename :
FromTrustedSource : True
Summary :
SwidTags : {Mozilla.Firefox}
CanonicalId : winget:Mozilla.Firefox/98.0#WinGet
Metadata : {}
SwidTagText : <?xml version="1.0" encoding="utf-16" standalone="yes"?>
<SoftwareIdentity
name="Mozilla.Firefox"
version="98.0"
versionScheme="MultiPartNumeric" xmlns="http://standards.iso.org/iso/19770/-2/2015/schema.xsd">
<Meta />
</SoftwareIdentity>
Dependencies : {}
IsCorpus :
Name : Mozilla.Firefox
Version : 98.0
VersionScheme : MultiPartNumeric
TagVersion :
TagId :
IsPatch :
IsSupplemental :
AppliesToMedia :
Meta : {{}}
Links : {}
Entities : {}
Payload :
Evidence :
Culture :
Attributes : {name,version,versionScheme}
Tons of useful data is being discarded here. Specifically, for my use case, I'm interested in the Download URL. This is obviously being retrieved and used elsewhere since installing packages are going to need to download the install file. Would be nice of all of this additional metadata was exposed
https://github.com/ethanbergstrom/WinGet/blob/current/CHANGELOG.md responds with 404
Linked from: https://www.powershellgallery.com/packages/WinGet/0.0.1
Hello,
For packages with a long name (e.g., FocusriteAudioEngineeringLtd.FocusriteControl
) there is state drift. Although I have the said package installed on my OS, the PackageManagement resource recognizes that this is not the case, and every time I invoke the Start-DscConfiguration
command, I see in the logs information about reinstallation of this package.
> Start-DscConfiguration -Path `.\DscConfiguration\` -Verbose -Wait -Force
[...]
VERBOSE: [LOCALHOST]: LCM: [ Start Resource ] [[PackageManagement]FocusriteControl]
VERBOSE: [LOCALHOST]: LCM: [ Start Test ] [[PackageManagement]FocusriteControl]
VERBOSE: [LOCALHOST]: [[PackageManagement]FocusriteControl] Test-TargetResource calling Get-TargetResource using -Name
FocusriteAudioEngineeringLtd.FocusriteControl -RequiredVersion latest -ProviderName WinGet -Ensure Present -Verbose True .
VERBOSE: [LOCALHOST]: [[PackageManagement]FocusriteControl] Begin invoking Get-package -Name FocusriteAudioEngineeringLtd.FocusriteControl -RequiredVersion latest
-ProviderName WinGet -Verbose True using PSModulePath C:\Users\Piotrek\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules.
VERBOSE: [LOCALHOST]: [[PackageManagement]FocusriteControl] Source selected: WinGet
VERBOSE: [LOCALHOST]: [[PackageManagement]FocusriteControl] Package 'FocusriteAudioEngineeringLtd.FocusriteControl' not found.
VERBOSE: [LOCALHOST]: [[PackageManagement]FocusriteControl] Resource FocusriteAudioEngineeringLtd.FocusriteControl is not in the desired state. Required Ensure is
Present and actual Ensure is Absent
VERBOSE: [LOCALHOST]: LCM: [ End Test ] [[PackageManagement]FocusriteControl] in 4.1330 seconds.
VERBOSE: [LOCALHOST]: LCM: [ Start Set ] [[PackageManagement]FocusriteControl]
VERBOSE: [LOCALHOST]: [[PackageManagement]FocusriteControl] Set-TargetResource calling Test-TargetResource using -Name
FocusriteAudioEngineeringLtd.FocusriteControl -RequiredVersion latest -ProviderName WinGet -Ensure Present -Verbose True .
VERBOSE: [LOCALHOST]: [[PackageManagement]FocusriteControl] Using the provider 'WinGet' for searching packages.
VERBOSE: [LOCALHOST]: [[PackageManagement]FocusriteControl] Source selected: WinGet
VERBOSE: [LOCALHOST]: [[PackageManagement]FocusriteControl] Performing the operation "Install Package" on target "Package
'FocusriteAudioEngineeringLtd.FocusriteControl' version '3.11.0.1983' from 'WinGet'.".
WARNING: [LOCALHOST]: [[PackageManagement]FocusriteControl] Output from WinGet.exe for package reference
'FocusriteAudioEngineeringLtd.FocusriteControl#3.11.0.1983#WinGet' did not match the exepected format. Please review WinGet logs for more information.
VERBOSE: [LOCALHOST]: LCM: [ End Set ] [[PackageManagement]FocusriteControl] in 7.1980 seconds.
VERBOSE: [LOCALHOST]: LCM: [ End Resource ] [[PackageManagement]FocusriteControl]
[...]
When I check with the Get-Package
command whether the package is installed, the situation occurs that actually by the full name this package is not recognised as installed, but by the shortened name to 39 characters.
> Get-Package -Provider WinGet -Name 'FocusriteAudioEngineeringLtd.FocusriteControl'
Get-Package : No package found for 'FocusriteAudioEngineeringLtd.FocusriteControl'.
At line:1 char:1
+ Get-Package -Provider WinGet -Name 'FocusriteAudioEngineeringLtd.Focu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...lets.GetPackage:GetPackage) [Get-Package], Exception
+ FullyQualifiedErrorId : NoMatchFound,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackage
> Get-Package -Provider WinGet -Name 'FocusriteAudioEngineeringLtd.FocusriteC'
Name Version Source ProviderName
---- ------- ------ ------------
FocusriteAudioEngineeringLt... 3.11.0.1983 winget WinGet
When I use this short name in my DSC configuration, the PackageManagement resource is satisfied, but only up to a certain point, because when for some reason it decides that this package needs to be reinstalled, then the attempt ends with an error about an unknown package.
This is an example configuration highlighting the problem.
Configuration DscConfiguration {
param (
[Parameter(Mandatory)]
[ValidateNotNullorEmpty()]
[PSCredential] $Credential
)
Import-DscResource -ModuleName 'PackageManagement' -ModuleVersion '1.4.8.1'
Node $AllNodes.NodeName {
PackageManagement WinGet {
Name = 'WinGet'
RequiredVersion = '0.0.8'
Source = 'PSGallery'
}
PackageManagement FocusriteControl {
DependsOn = '[PackageManagement]WinGet'
PsDscRunAsCredential = $Credential
ProviderName = 'WinGet'
Name = 'FocusriteAudioEngineeringLtd.FocusriteControl'
RequiredVersion = 'latest'
}
}
}
This is a sample configuration compilation.
> . .\DscConfiguration.ps1
> $cred = Get-Credential
> DscConfiguration -ConfigurationData @{AllNodes = @( @{ NodeName = 'localhost'; PSDscAllowDomainUser = $true; PsDscAllowPlainTextPassword = $true } ) } -Credential $cred
Regards
Piotr Minkina
How do you list all packages?
I tried:
`find-package * -ProviderName winget
find-package -ProviderName winget`
Neither of which worked.
cobalt\Find-WinGetPackage 'vlc'
returns the package VideoLAN.VLC
while
Find-Package -ProviderName WinGet -Name 'vlc'
returns an error.
It seems that ~3 months ago it was setup with the -Exact
switch.
Any particular reason for that?
Can this be removed, or at least provided as a choice?
With WinGet installed on the system (tested).
Import-Module Cobalt
Import-Module WinGet
Get-InstalledPackage
Generates the following error:
New-SoftwareIdentity : The term 'New-SoftwareIdentity' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At C:\Users\blah\Documents\WindowsPowerShell\Modules\WinGet\0.0.4\private\ConvertTo-SoftwareIdentity.ps1:35 char:5
+ New-SoftwareIdentity @swid
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-SoftwareIdentity:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I'm sure I screwed up. What did I screw up?
Thanks,
Kizan
Introduced with #9. Querying every package for additional metadata takes forever.
PS C:\Users\Administrator> Find-Package -Provider winget -name *git* WinGet.exe is required to continue WinGet is built on WinGet.exe. Do you want WinGet to install WinGet.exe from 'https://github.com/microsoft/winget-cli' now? [Y] 是(Y) [N] 否(N) [S] 暂停(S) [?] 帮助 (默认值为“Y”): 警 告 : Multiple non-default sources are available, but the default source is not. A source name must be specified. 警告: 无法对参数“ExceptionMessage”执行参数验证。参数为 Null 或空。请提供 一个不为 Null 或空的参数,然后重试该命令。 警告: 管道元素中的“&”后面的表达式生成无效的对象。该表达式必须生成命令名称
、脚本块或 CommandInfo 对象。 警告: 部署失败,原因是 HRESULT: 0x80073CF0, 无法打开包。 错误 0x80190193: 从位置 Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.appxbundle 中打开程序包失败。
注意: 有关其他信息,请在事件日志中查找 [ActivityId] 0e80911d-35bc-0000-e86a-890ebc35d601,或使用命令行 Get-AppPackageLog -ActivityID 0e80911d-35bc-0000-e86a-890ebc35d601
server2019
When using your example DSC gist on an Azure Windows 11 VM (it also happened on a Windows 10 VM), the WinGet provider gets installed but the packages couldn't be found.
WinGet CLI is installed properly with v1.3.269
OS Info:
Name Value
---- -----
PSVersion 7.2.8
PSEdition Core
GitCommitId 7.2.8
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
InvalidOperation: PowerShell DSC resource MSFT_PackageManagement failed to execute Set-TargetResource functionality with error message: No match was found for the specified search criteria and package name '7zip.7zip'. Try Get-PackageSource to see all available registered package sources.
InvalidOperation: PowerShell DSC resource MSFT_PackageManagement failed to execute Set-TargetResource functionality with error message: No match was found for the specified search criteria and package name 'Balena.Etcher'. Try Get-PackageSource to see all available registered package sources.
....
The only thing that helps, is running the
Find-Package -Name 7zip.7zip -ProviderName "winget"
manually, then it seems to register something and the DSC runs just fine.
I've tried running the Find-Package
also in DSC, but even after running Get-PackageProvider WinGet
and Get-PackageSource -ProviderName "WinGet"
(which are returning the perfectly fine installed sources), I just seems to demand a manual intervention as errors occur like stated above.
Any help would be highly appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.