Skip to content

Function Package

Chris Hunt edited this page May 23, 2016 · 1 revision

Package

SYNOPSIS

Test for installed package.

DESCRIPTION

Test that a specified package is installed.

PARAMETERS

Target [String]

[Parameter(
  Mandatory = $true,
  Position = 2)]

Property [String]

[Parameter(
  Position = 3,
  ParameterSetName = 'Set 2')]

Should [ScriptBlock]

[Parameter(
  Mandatory = $true,
  Position = 3,
  ParameterSetName = 'Set 1')]
[Parameter(
  Mandatory = $true,
  Position = 4,
  ParameterSetName = 'Set 2')]

Assertions

Be, BeNullOrEmpty

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

package 'Microsoft Visual Studio Code' { should not BeNullOrEmpty }

-------------------------- EXAMPLE 2 --------------------------

package 'Microsoft Visual Studio Code' version { should be '1.1.0' }

-------------------------- EXAMPLE 3 --------------------------

package 'NonExistentPackage' { should BeNullOrEmpty }