Test-SCServiceTemplate

Validates a service template and stores any errors in the ValidationErrors property of the service template.

Syntax

Test-SCServiceTemplate
    [-ServiceTemplate] <ServiceTemplate>
    [-Update]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [<CommonParameters>]

Description

The Test-SCServiceTemplate cmdlet validates a service template and stores the errors in the ValidationErrors property of the service template.

Examples

Example 1: Validate a service template

PS C:\> $SvcTemplate = Get-SCServiceTemplate -Name "ServiceTemplate01" | where { $_.Release -eq "Beta" }
PS C:\> $UpdatedSvcTemplate = Test-SCServiceTemplate -ServiceTemplate $SvcTemplatePS C:\> $UpdatedSvcTemplate.ValidationErrors[0]

The first command gets the Beta release of the service template object named ServiceTemplate01 and stores the object in the $SvcTemplate variable.

The second command validates the service template in $SvcTemplate.

The third command displays the first validation error for service template from the validation error array.

Parameters

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

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

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

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

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

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

-ServiceTemplate

Specifies a service template object.

Type:ServiceTemplate
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Update

Updates the settings for an object.

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

Outputs

ServiceTemplate

This cmdlet returns a ServiceTemplate object.