GithubHelp home page GithubHelp logo

ethanbergstrom / winget Goto Github PK

View Code? Open in Web Editor NEW
46.0 46.0 1.0 101 KB

PackageManagement (OneGet) package provider for use with Windows Package Manager (winget)

License: MIT License

PowerShell 100.00%

winget's People

Contributors

ethanbergstrom avatar kendr1ck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rendermewell

winget's Issues

List all packages

How do you list all packages?

I tried:
`find-package * -ProviderName winget

find-package -ProviderName winget`

Neither of which worked.

Find-Package does only exact searchs

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?

Get-InstalledPackage Errors

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

Multiple non-default sources are available, but the default source is not. A source name must be specified.

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

Doesn't work on non-english operating systems

Running "Find-Package OpenJS.NodeJS -Provider WinGet" on a german OS (Windows 10, x64, 21H2) does not find any packages. (winget-cli is installed)

exception:

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

  • Find-Package OpenJS.NodeJS -Provider WinGet
  •   + CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exceptio
     n
      + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
    

Missing information from winget

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

[DSC] InvalidOperation: PowerShell DSC resource MSFT_PackageManagement failed to execute Set-TargetResource functionality with error message

Setup

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

Error Message

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.

Steps to reproduce

  1. Create a .ps1 file with your gist
  2. Run the gist as a local administrator

What I've tried so far

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.