Only install PowerShell module if necessary
This commit is contained in:
parent
ea83940e39
commit
9ba134d202
2 changed files with 19 additions and 2 deletions
scripts/Common/Scripts
|
@ -102,3 +102,18 @@ function Test-PSPackage {
|
|||
|
||||
[bool] (Get-Package $Name -ErrorAction SilentlyContinue);
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks whether a module with the specified name is installed.
|
||||
|
||||
.PARAMETER Name
|
||||
The name of the module to check.
|
||||
#>
|
||||
function Test-PSModule {
|
||||
param(
|
||||
[string] $Name
|
||||
)
|
||||
|
||||
[bool](Get-Module -ListAvailable $Name -ErrorAction SilentlyContinue);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue