Install and manage PowerShell scripts from a PSRepository
- Add or remove PowerShell scripts from registered PSRepositories.
The below requirements are needed on the host that executes this module.
PowerShellGet
module v1.6.0+
Note
- Unlike PowerShell modules, scripts do not support side-by-side installations of multiple versions. Installing a new version will replace the existing one.
.. seealso:: :ref:`community.windows.win_psrepository_module` The official documentation on the **community.windows.win_psrepository** module. :ref:`community.windows.win_psrepository_info_module` The official documentation on the **community.windows.win_psrepository_info** module. :ref:`community.windows.win_psmodule_module` The official documentation on the **community.windows.win_psmodule** module.
- name: Install a script from PSGallery
community.windows.win_psscript:
name: Test-RPC
repository: PSGallery
- name: Find and install the latest version of a script from any repository
community.windows.win_psscript:
name: Get-WindowsAutoPilotInfo
state: latest
- name: Remove a script that isn't needed
community.windows.win_psscript:
name: Defrag-Partition
state: absent
- name: Install a specific version of a script for the current user
community.windows.win_psscript:
name: CleanOldFiles
scope: current_user
required_version: 3.10.2
- name: Install a script below a certain version
community.windows.win_psscript:
name: New-FeatureEnable
maximum_version: 2.99.99
- name: Ensure a minimum version of a script is present
community.windows.win_psscript:
name: OldStandby
minimum_version: 3.0.0
- name: Install any available version that fits a specific range
community.windows.win_psscript:
name: FinickyScript
minimum_version: 2.5.1
maximum_version: 2.6.19
- Brian Scholer (@briantist)