salt.modules.win_psget

Module for managing PowerShell through PowerShellGet (PSGet)

depends
  • PowerShell 5.0

  • PSGet

Support for PowerShell

salt.modules.win_psget.avail_modules(desc=False)

List available modules in registered Powershell module repositories.

Parameters

desc (bool) -- If True, the verbose description will be returned.

CLI Example:

salt 'win01' psget.avail_modules
salt 'win01' psget.avail_modules desc=True

salt.modules.win_psget.bootstrap()

Make sure that nuget-anycpu.exe is installed. This will download the official nuget-anycpu.exe from the internet.

CLI Example:

salt 'win01' psget.bootstrap

salt.modules.win_psget.get_repository(name)

Get the details of a local PSGet repository

Parameters

name (str) -- Name of the repository

CLI Example:

salt 'win01' psget.get_repository MyRepo

salt.modules.win_psget.install(name, minimum_version=None, required_version=None, scope=None, repository=None)

Install a Powershell module from powershell gallery on the system.

Parameters
  • name (str) -- Name of a Powershell module

  • minimum_version (str) -- The maximum version to install, e.g. 1.23.2

  • required_version (str) -- Install a specific version

  • scope (str) -- The scope to install the module to, e.g. CurrentUser, Computer

  • repository (str) -- The friendly name of a private repository, e.g. MyREpo

CLI Example:

salt 'win01' psget.install PowerPlan

salt.modules.win_psget.list_modules(desc=False)

List currently installed PSGet Modules on the system.

Parameters

desc (bool) -- If True, the verbose description will be returned.

CLI Example:

salt 'win01' psget.list_modules
salt 'win01' psget.list_modules desc=True

salt.modules.win_psget.register_repository(name, location, installation_policy=None)

Register a PSGet repository on the local machine

Parameters
  • name (str) -- The name for the repository

  • location (str) -- The URI for the repository

  • installation_policy (str) -- The installation policy for packages, e.g. Trusted, Untrusted

CLI Example:

salt 'win01' psget.register_repository MyRepo https://myrepo.mycompany.com/packages

salt.modules.win_psget.remove(name)

Remove a Powershell DSC module from the system.

Parameters

name (str) -- Name of a Powershell DSC module

CLI Example:

salt 'win01' psget.remove PowerPlan

salt.modules.win_psget.update(name, maximum_version=None, required_version=None)

Update a PowerShell module to a specific version, or the newest

Parameters
  • name (str) -- Name of a Powershell module

  • maximum_version (str) -- The maximum version to install, e.g. 1.23.2

  • required_version (str) -- Install a specific version

CLI Example:

salt 'win01' psget.update PowerPlan

© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.win_psget.html