Skip to content

Function Registry

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

Registry

SYNOPSIS

Test a Registry Key.

DESCRIPTION

Test the Existance of a Key or the Value of a given Property.

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, BeExactly, Exist, Match, MatchExactly

EXAMPLES

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

Registry HKLM:\SOFTWARE\Microsoft\Rpc\ClientProtocols { Should Exist }

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

Registry HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ "NV Domain" { Should Be mybiz.local  }

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

Registry 'HKLM:\SOFTWARE\Callahan Auto\' { Should Not Exist }