Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepowershell
titleshell command
find-packageprovider

Image Added

Listing Installed Package Providers

Code Block
languagepowershell
titleshell command
get-packageprovider

Adding a Package Provider

Code Block
languagepowershell
titleshell command
// install the package provider
install-packageprovider <provider-name> -verbose

// add the package provider to the list of available providers on your machine
import-packageprovider <provider-name>

// check if package provider installed correctly
get-packageprovider -verbose


Code Block
languagepowershell
titleSample Code
// install the package provider
install-packageprovider ChocolateyGet  -verbose

// add the package provider to the list of available providers on your machine
import-packageprovider ChocolateyGet

// you might have to install something from the package provider to allow its commands to be executed, for example chocolatey requires the choco.exe file to be available as a Windows application, use the command below to install chocolatey as a separate Windows application
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

// check if package provider installed correctly
get-packageprovider -verbose

Image Added

Installing a Package

Code Block
languagepowershell
titleshell command
// check if a package provider is available on your local machine
get-packageprovider -verbose

install-package <package-name>
// OR
install-package -source <provider-name> -name <package-name>


Code Block
languagepowershell
titleSample Code
// see what package providers are available on your machine
get-packageprovider -verbose

install-package mysql

// you might get a warning ssaying there are multiple source providers, rerun the command as follows
install-package -source chocolatey -name mysql 

Image Added

Complete example of installing a Package Provider and a Package

Code Block
languagepowershell
titleSample Code
// Check if the package provider exists
find-packageprovider ChocolateyGet  -verbose

// install the package provider
install-packageprovider ChocolateyGet  -verbose

// add the package provider to the list of available providers on your machine
import-packageprovider ChocolateyGet

// now install a package
get-packageprovider -verbose
// if the above might fail because choco.exe needs to be aavailable, use the command below to install chocolatey as a separate Windows application
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

install-package mysql

// you might get a warning ssaying there are multiple source providers, rerun the command as follows
install-package -source chocolatey -name mysql