Initialize-Module
1.3
It handles necessary prerequisites for PowerShell Gallery interaction, including:
- Setting the security protocol to TLS 1.2.
- Ensuring the NuGet package provider is available.
- Installing/updating and importing the 'Microsoft.PowerShell.PSResourceGet' module for
It handles necessary prerequisites for PowerShell Gallery interaction, including:
- Setting the security protocol to TLS 1.2.
- Ensuring the NuGet package provider is available.
- Installing/updating and importing the 'Microsoft.PowerShell.PSResourceGet' module for modern gallery operations.
For each module specified by the -Name parameter, the function will:
1. Attempt to install or update it to the latest version from the PowerShell Gallery. Modules are typically installed for AllUsers.
2. Import the module into the current session.
This automates the common tasks required to make PowerShell modules ready for use.
Installation Options
Owners
Package Details
Author(s)
- Jonathan Pitre
Tags
Dependencies
This script has no dependencies.
Release Notes
1.3 - 2025-06-20
- Replaced Install-Module, Update-Module, and Get-Module commands with Install-PSResource, Update-PSResource, and Get-InstalledPSResource commands for improved performance and modern PowerShell Gallery interaction.
- Enhanced module management efficiency by leveraging the Microsoft.PowerShell.PSResourceGet module's optimized cmdlets.
- Fixed an error with the transcript file not being created on a fresh reboot.
1.2 - 2025-06-17
- Added error action silently continue to the Import-Module commands for Microsoft.PowerShell.PSResourceGet to avoid errors when the module is not installed.
1.1 - 2025-06-16
Added log file and transcript.
Added log path and file parameters.
1.0 - 2025-05-30
Initial release.
FileList
- Initialize-Module.nuspec
- Initialize-Module.ps1
Version History
Version | Downloads | Last updated |
---|---|---|
1.3 (current version) | 168 | 6/20/2025 |
1.2 | 96 | 6/17/2025 |
1.1 | 19 | 6/17/2025 |
1.0 | 142 | 5/30/2025 |