PS: Package Managers

less than 1 minute read


Description:

Powershell Package Managers are the Windows equivelent of yum, apt-get, etc for Linux. It is used to automate SDII (software discovery, installation, and inventory).

NOTE: Make sure to start Powershell as an admin and type: set-executionpolicy bypass

To Resolve:

  1. First thing to do is to upgrade your PS to version 5 found here.

  2. Now open up PS and Type:

Get-Module -Listavailable

Import-Module Packagemanagement

#This Will Show A List Of All The Commands For The Module.
Gcm -Module Packagemanagement

# As example, we install FF
Find-Package -Name Firefox
# Installs Firefox
Install-Package -Name Firefox -Source Chocolatey
# This Will Uninstall Firefox
Uninstall-Package -Name Firefox

 

  1. To install Chocolatey as a PackageProvider, Type:
Iex ((New-Object Net.Webclient).Downloadstring('https://chocolatey.org/Install.ps1')) 
# Close And Re-Open Powershell

# Now, To Install A Package You Just Type:
Choco Install (Packagename)

# To Uninstall
Choco Uninstall (Packagename).

 

References:

http://blogs.technet.com/b/packagemanagement/archive/2015/04/29/introducing-packagemanagement-in-windows-10.aspx#pi47623=2
https://chocolatey.org/
http://blogs.msdn.com/b/mvpawardprogram/archive/2014/10/06/package-management-for-powershell-modules-with-powershellget.aspx
http://learn-powershell.net/2014/04/03/checking-out-oneget-in-powershell-v5/
https://www.youtube.com/watch?v=N-hWOUL8roU