Skip to content

Test-TppObject

SYNOPSIS

Test if an object exists

SYNTAX

DN (Default)

Test-TppObject -Path <String[]> [-ExistOnly] [-VenafiSession <PSObject>] [<CommonParameters>]

GUID

Test-TppObject -Guid <Guid[]> [-ExistOnly] [-VenafiSession <PSObject>] [<CommonParameters>]

DESCRIPTION

Provided with either a DN path or GUID, find out if an object exists.

EXAMPLES

EXAMPLE 1

$multDNs | Test-TppObject
Object                    Exists
--------                  -----
\VED\Policy\My folder1    True
\VED\Policy\My folder2    False

Test for existence by Path

EXAMPLE 2

Test-TppObject -Path '\VED\Policy\My folder' -ExistOnly

Retrieve existence for only one object

PARAMETERS

-Path

DN path to object. Provide either this or Guid. This is the default if both are provided.

Type: String[]
Parameter Sets: DN
Aliases: DN

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Guid

Guid which represents a unqiue object. Provide either this or Path.

Type: Guid[]
Parameter Sets: GUID
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-ExistOnly

Only return boolean instead of Object and Exists list. Helpful when validating just 1 object.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-VenafiSession

Authentication for the function. The value defaults to the script session object $VenafiSession created by New-VenafiSession. A TPP token or VaaS key can also provided. If providing a TPP token, an environment variable named TppServer must also be set.

Type: PSObject
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $script:VenafiSession
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Path or Guid.

OUTPUTS

PSCustomObject will be returned with properties 'Object', a System.String, and 'Exists', a System.Boolean.

NOTES

http://VenafiPS.readthedocs.io/en/latest/functions/Test-TppObject/

https://github.com/Venafi/VenafiPS/blob/main/VenafiPS/Public/Test-TppObject.ps1

https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-isvalid.php