編集

次の方法で共有


Test-UevTemplate

Verifies whether a template complies with the schema for UE-V.

Syntax

Test-UevTemplate
    [-Path] <String[]>
    [<CommonParameters>]
Test-UevTemplate
    -LiteralPath <String[]>
    [<CommonParameters>]

Description

The Test-UevTemplate cmdlet verifies whether a settings location template complies with the XML schema for Microsoft User Experience Virtualization (UE-V).

Examples

Example 1: Test a file

PS C:\> Test-UevTemplate -Path "MicrosoftWordpad.xml" | Format-Table -AutoSize
Path                                                                                     Status Message
----                                                                                     ------ -------
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftWordpad.xml Valid  The template is valid.

This command tests whether the specified file is a valid settings location template. The command passes the results to the Format-Table cmdlet by using the pipeline operator. For more information, type Get-Help Format-Table.

Example 2: Test several files

PS C:\> Test-UevTemplate -Path "*Microsoft*.xml" | Format-Table -AutoSize
Path                                                                                               Status Message
----                                                                                               ------ -------
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftCalculator.xml        Valid  The template is valid.
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftInternetExplorer9.xml Valid  The template is valid.
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftLync2010.xml          Valid  The template is valid.
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftNotepad.xml           Valid  The template is valid.

This command tests whether several files are valid settings location templates. The command checks all .xml files that have names that contain the specified string. The command passes the results to Format-Table by using the pipeline operator.

Example 3: Test a file specified by its literal path

PS C:\> Test-UevTemplate -LiteralPath "MicrosoftWordpad.xml" | Format-Table -AutoSize
Path                                                                                     Status Message
----                                                                                     ------ -------
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftWordpad.xml Valid  The template is valid.

This command tests whether the specified file is a valid settings location template file. The command passes the results to Format-Table by using the pipeline operator.

Example 4: Test all the files in the current directory by using the pipeline

PS C:\> Test-UevTemplate -Path "*.xml" | Format-Table -AutoSize
Path                                                                                               Status Message
----                                                                                               ------ -------
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftCalculator.xml        Valid  The template is valid.
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftInternetExplorer9.xml Valid  The template is valid.
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftLync2010.xml          Valid  The template is valid.
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftNotepad.xml           Valid  The template is valid.
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftOffice2010.xml        Valid  The template is valid.
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftVisualStudio2010.xml  Valid  The template is valid.
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftWindows7.xml          Valid  The template is valid.
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftWindows8.xml          Valid  The template is valid.
C:\Program Files\Microsoft User Experience Virtualization\Templates\MicrosoftWordpad.xml           Valid  The template is valid.

This command uses a wildcard to test if each file is a settings location template, and then passes the results to Format-Table by using the pipeline operator.

Parameters

-LiteralPath

Specifies an array of literal file paths. The cmdlet validates the settings location templates that have the literal paths that you specify.

Type:String[]
Aliases:PSPath
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Path

Specifies an array of file paths. The cmdlet validates the settings location templates that have the paths that you specify. Use wildcards to specify multiple files.

Type:String[]
Aliases:Name
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

string[]

An array of paths to settings location templates.

Outputs

Microsoft.UEV.Commands.TestTemplateResult

This cmdlet generates a TestTemplateResult object that contains the validation result for a settings location template.