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). Make sure to start Powershell as an admin and type set-executionpolicy remotesigned.

To Resolve:

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

  2. Now open up PS and Type:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    
    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
    
  3. To install Chocolatey as a PackageProvider, Type:

    1
    2
    3
    4
    5
    6
    7
    8
    
    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:

“Introducing PackageManagement in Windows 10”
“Chocolatey”
“Package Management for PowerShell Modules with PowerShellGet”
“Checking Out OneGet in PowerShell V5”

Comments