Set of commands to install PowerShell modules from contral directory, local file or from the web.
- Install modules from central directory
- Install modules from web or local file
- Install modules to user profile or for all users ( elevated access required )
- Install multifile modules from ZIP
- Import module after install
- Alter you profle to load module every time that PowerShell starts
- Execute Install.ps1 if found in module folder
To install something from central directory just type:
This command will query central directory to find required information about PsUrl module and install it if found.
Another example is how to install
PsUrl module located at https://github.com/chaliy/psurl/raw/master/PsUrl/PsUrl.psm1 , to install it just execute
install-module -ModuleUrl https://github.com/chaliy/psurl/raw/master/PsUrl/PsUrl.psm1
or zipped modules like
posh-git. Zip package is located at https://github.com/dahlbyk/posh-git/zipball/master , to install it just execute
Also this command will execute Install.ps1 that is install scrtipt for
posh-git. (pls note
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
Command also can make given module to start with your profile
install-module PsUrl -Startup
While this tool streamlines installation of the modules, it should be installed manually for now.
PsGet.psm1to your modules folder (e.g.
Import-Module PsGet(or add this command to your profile)
(new-object Net.WebClient).DownloadString("http://bit.ly/GetPsGet") | iex
Or long version:
(new-object Net.WebClient).DownloadString("https://github.com/chaliy/psget/raw/master/GetPsGet.ps1") | invoke-expression
Q: Error "File xxx 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. This is all about security. To "fix" this run PowerShell as Administrator and call
For mode details run get-help about_signing or git-help about_Execution_Policies.
Roadmap is not sorted in any order. This is just list what is think should be done.
- Support for other than PSM1 types of modules
- Support for modules with more than one file with NuGet packages
- Support for NuGet repositories
- Support for versions of the modules
- Git/Hg/Svn sources
- Blog about PsGet - http://blog.chaliy.name/tagged/psget
- Another module management for PowerShell https://github.com/spmason/RequirePS , nice point is that it supports GIT as source for modules
- PowerShell wrapper for NuGet http://code.andrewnurse.net/psget (yes also has name PsGet)
- Instruction how pack PowerShell module to NuGet package - http://haacked.com/archive/2011/04/19/writing-a-nuget-package-that-adds-a-command-to-the.aspx
Module based on http://poshcode.org/1875 Install-Module by Joel Bennett