Skip to content

Latest commit

 

History

History
114 lines (71 loc) · 4.25 KB

Readme.md

File metadata and controls

114 lines (71 loc) · 4.25 KB

PsGet Utils

Set of commands to install PowerShell modules from central directory, local files, or the web.

Installation

In your prompt execute:

(new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/psget/psget/master/GetPsGet.ps1") | iex

And if you get something like this:

Downloading PsGet from https://github.com/psget/psget/raw/master/PsGet/PsGet.psm1
PsGet is installed and ready to use

You are done. The PowerShell script downloads GetPsGet.ps1 and sends it to Invoke-Expression to install the PsGet Module.

Alternatively, you can install manually

  1. Copy PsGet.psm1 to your modules folder (e.g. $Env:PsGet\PsGet\ )
  2. Execute Import-Module PsGet (or add this command to your profile)
  3. Enjoy!

Features

  1. Install modules from central directory, local files, or the web
  2. Install modules to user profile or for all users (elevated access required)
  3. Install multifile modules from ZIP
  4. Import module after install
  5. Alter your profile to load a given module PowerShell starts up
  6. Execute Install.ps1
  7. Tab completion for modules, ismo Ps

Examples

To install something from central directory just type:

install-module PsUrl

This command queries central directory to find required information about the PsUrl module and install it if found.

As another example on how to install the PsUrl module, use

install-module -ModuleUrl https://github.com/chaliy/psurl/raw/master/PsUrl/PsUrl.psm1

With zipped modules like posh-git, you can install zip package via

install-module -ModuleUrl https://github.com/dahlbyk/posh-git/zipball/master

This command executes Install.ps1 which installs script for posh-git. (posh-git is in the directory, so install-module posh-git is enough.)

And of course, it supports local files, both ZIP and PSM1:

install-module -ModulePath \TestModules\HelloWorld.zip
install-module -ModulePath \TestModules\HelloWorld.psm1

You can also have a given module start with your profile:

install-module PsUrl -Startup   

NuGet can even install the modules:

install-module -nugetpackageid SomePowerShellModuleOnNuget
install-module -nugetpackageid SomePrivatePowerShellModule -nugetsource http://mynugetserver/nuget/feed/

If you need update module, execute Update-Module which downloads the latest version and replace local one

update-module PsUrl

FAQ

Q: Error File [x] cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details. A: By default, PowerShell restricts execution of all scripts which is all about security. As a "fix", please run PowerShell as Administrator and call

Set-ExecutionPolicy RemoteSigned

For mode details, run get-help about_Execution_Policies.

Q: How to add my module to the directory? A: Review a small section of the wiki

Roadmap

The roadmap is not sorted in any order; it is simply a list for what should be done.

  1. Support for beyond just PSM1 types of modules
  2. Support for modules with more than one file with NuGet packages
  3. Support for versions of the modules
  4. Git/Hg/Svn sources git

Resources

  1. Blog about PsGet
  2. PowerShell wrapper for NuGet — also has name PsGet and now on GitHub.
  3. Instruction how to pack PowerShell module to NuGet package

Contributing

If you are interested in contributing to PsGet, please read this page from wiki

Credits

Module based on Install-Module by Joel Bennett

Bitdeli Badge