package provider

# A package provider is a package source that contains packages (programs).
# Every package provider has a package source.
# Working with packageprovider commandlets the powershell should run
# as administrator.

# for using the packagemanagement you have to install NuGet package provider:
   find-packageprovider -Name "NuGet" -AllVersions
   install-packageprovider -name NuGet -force
   Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet
# a local 'repository' is aligned
# registering a package source to this repository
# install packages (programs) from the package source to the local repository
# commandlets out of the package can be used

# if the powershell is run normal the packageprovider can only used for the local windows-user.
# if the powershell is run as administrator the packageprovider can be used systemwide.

# PackageManagements, lists local packageprovider which can be used, type of packages (?)
   Get-PackageProvider

# output
   Name                     Version          DynamicOptions
   ----                         -------             --------------
   msi                         3.0.0.0           AdditionalArguments
   msu                        3.0.0.0
   NuGet                    2.8.5.208       Destination, ExcludeVersion, Scope, ...
   PowerShellGet      1.0.0.1           PackageManagementProvider, Type, Scope, AllowClobber, ...
   Programs               3.0.0.0           IncludeWindowsInstaller, IncludeSystemComponent

# msi: local installed program (msi)
# musu: local windows update files
# NuGet: external packageprovider
# PowerShellGet: PackageManagementProvider
# Programs: local install programs (exe)

# list all programms, that are installed as msi:
   get-package -providername msi

# get a list of all available package providers:
   get-packageprovider –listavailable

# get the package source of a package provider
   get-packagesource -providername PowerShellGet

# output
   Name                             ProviderName     IsTrusted  Location
   ----                             ------------     ---------  --------
   PSGallery                        PowerShellGet    False      https://www.powershellgallery.com/api/v2

# to list all, internal (local) and external package provider
   Find-PackageProvider

# Get-PSDrive, Drive-Provider
    Get-PSDrive

# output
   Name           Used (GB)     Free (GB)   Provider      Root                                   CurrentLocation
   ----               ----------     -----------   ---------      -----                                   ---------------
   Alias                                                     Alias
   C                      128,02          300,67    FileSystem       C:\                                   Users\user
   Cert                                                     Certificate        \
   Env                                                      Environment
   F                                                          FileSystem       F:\
   Function                                              Function
   HKCU                                                 Registry          HKEY_CURRENT_USER
   HKLM                                                 Registry          HKEY_LOCAL_MACHINE
   Variable                                               Variable
   WSMan                                               WSMan

# Microsoft call them 'Navigation Provider' or 'Commandlet Provider'.

# get all installed software on windows
   get-package -providername Programs

Optional:
   - Active Directory
   - IIS-Webserver
   - Microsoft SQL Server

# commandlets
# commandlets consist of a verb, noun, parameterlist
# example:
   get-packageprovider –listavailable
# get = verb
# packageprovider = noun
# -listavailable = parameter