Giter VIP home page Giter VIP logo

psgallerymodule's Introduction

PSMGalleryModule

Simple Function to retrieve Module(s) info(s) from the PSGallery. Its an attempt to search the psgallery with it's API. The idea at the begining was to be able to retrieve module download infos.

How it works

The function builds an odata query for the psgallery api. It uses a basic class to expand all properties and give the possibility to download the package.

Install

Fork the projet and clone it, or install from the psgallery directly : Install-Module -Name PSGalleryModule

Search Options

You can search by Module Name, by Authors, or by Date.

Find-GalleryModule -Module Pshtml* -Version LatestVersion
Find-GalleryModule -Author Lxlechat -Version LatestVersion
Find-GalleryModule -Date 17/09/2019 -Version LatestVersion
Find-GalleryModule -Module Pshtml -Version PreRelease

You can not use the author, module or date parameter at the same time.

Download

You can use the Download switch to download the package as a zip file. By default the package will be downloaded in the current directory. To change this behavior, use the outpath parameter.

As the files are saved as zip files, you can directly pipe the result to Expand-Archive.

Find-GalleryModule -Module PSClassUtils -DownLoad | Expand-Archive

Wildcards

You can use the * wildard if you dont know the exact name of the module.

Find-GalleryModule -Module class*
Find-GalleryModule -Module *class
Find-GalleryModule -Module *class*
Find-GalleryModule -Module *

Examples

Retrieve all modules named psclassutils. In this example, it will return all the published versions of this particular module.

Find-GalleryModule -Module psclassutils

Retrieve latestversion of psclassutils modules Check last 2 properties:

Find-GalleryModule -Module Psclassutils -Version LatestVersion

...
Title                    : Title
Version                  : 2.6.3
DownLoadCount            : 234
VersionDownLoadCount     : 81

Retrieve the infos for the latest published version of the PSClassUtils and AdsiPS modules, and display only the id, version, authors, description

Find-GalleryModule -Module 'psclassutils','adsips' -Version LatestVersion |
    Select-Object -Property id,version,authors,description,versiondownloadcount

Id                   : AdsiPS
Version              : 1.0.0.3
Authors              : Francois-Xavier Cat
Description          : PowerShell module to interact with Active Directory using ADSI and the System.DirectoryServices namespace (.NET Framework)
VersionDownLoadCount : 873

Id                   : PSClassUtils
Version              : 2.6.3
Authors              : Stéphane van Gulick
Description          : Contains a set of utilities to work with Powershell Classes.
VersionDownLoadCount : 85

Retrieve the infos for the latest module created by the authors wich start with Jérôme

Find-GalleryModule -Author Jérôme -Version LatestVersion |
    Select-Object -Property Authors,Id

Authors             Id
-------             --
Jérôme Bezet-Torres ENILog
Jérôme Bezet-Torres FreeNas
Jérôme Bezet-Torres UpdatePwshModule

Download the latest module created by the authors wich start with Damien

Find-GalleryModule -Author Damien -Version LatestVersion -OutPath c:\temp

    Répertoire : C:\temp

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       04/09/2019     17:12          15439 comparecomputer.1.0.0.zip
-a----       04/09/2019     17:12           9278 ConfigExport.1.0.0.1.zip
-a----       04/09/2019     17:12           5173 GetBIOS.1.2.0.zip
-a----       04/09/2019     17:12         762749 MDTMonitor.1.0.0.zip
-a----       04/09/2019     17:12           6412 PS1ToEXE.1.0.0.1.zip
-a----       04/09/2019     17:12           6035 PSTalk.1.0.0.zip
-a----       04/09/2019     17:12           7563 SetBIOS.1.0.0.zip

You can pass module names from the pipeline.

'AdsiPS','PSClassutils' | Find-GalleryModule -Version LatestVersion

or

Get-Module | Find-GalleryModule -Version LatestVersion

More infos

-https://github.com/NuGet/Home/wiki/Filter-OData-query-requests

-https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-odata/72d4ebf9-5480-49a4-b88b-c5782f726c87

psgallerymodule's People

Contributors

jm2k69 avatar lazywinadmin avatar lxlechat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

psgallerymodule's Issues

Filter system enhancement

In the actual form, the function supports a wildcard at the end of the module

Get-PSModuleInfo -Module Git*

But this returns only modules that begins with Git.

Enhancement:
remove wildcard support, and add to switches : -Contains or -BeginsWith

-contains should return all modules that contains git in their id.
-BeginsWith should return all modules that begins with git in their id.

Expand all properties

Maybe have a switch that will automatically expand all expandables properties, just like i did for versiondownloadcount, and downloadcount .. !

Downloading PreRelease Version

-Prerelease version is different thant latestversion
Filter should be like that :

?$filter=(Id eq 'module') and IsPrerelease and IsAbsoluteLatestVersion

-Adding a switch PreRelease

Add Filter for Powershell Edition

Add Core and PSEditons if it possible. You need to filter the Tags like this
packages?q=Tags%3A"PSEdition_Core" or "PSEdition_Desktop"

Only 100 result

When I launch $(Get-PSGModuleInfo -Module *).count the result is only 100

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.