Skip to content

Function Share

Mark Wragg edited this page Jun 17, 2019 · 1 revision

Share

SYNOPSIS

Test if a share exists.

DESCRIPTION

Uses the Win32_Share WMI class to test if a share exists.

PARAMETERS

Target [String]

The share name to test for. Eg 'C$' or 'MyShare'.

[Parameter(Mandatory, Position=1)]
[Alias('Name')]

Should [ScriptBlock]

A Script Block defining a Pester Assertion.

[Parameter(Mandatory, Position=2)]

Assertions

Assertions: -BeNullOrEmpty

EXAMPLES

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

Share 'MyShare' { Should -Not -BeNullOrEmpty }

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

Share 'BadShare' { Should -BeNullOrEmpty }