Wednesday, June 7, 2023

PowerShell: Installing the latest version of Pester

Before installing the latest version of Pester, uninstall the legacy version of Pester (Pester 3.x) which is installed with most modern versions of Windows (see PowerShell: Uninstalling Pester 3.0). On a machine with PowerShell 5.0 or later install, the latest version of Pester can be installed as follows without running as administrator:

Install-Module -Name Pester

Once install verify that version of Pester is the most recent:

(Get-Module -ListAvailable Pester).Version

An example of installing Pester is as follows (not that a user is prompted to accept the modules being installed):

E:\Users\Jann\PowerShellRepos> Install-Module -Name Pester

Untrusted repository

You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository

cmdlet. Are you sure you want to install the modules from 'PSGallery'?

[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A

No comments :

Post a Comment