New-WssBackupConfiguration

Creates a file specification that specifies the files and folders to include in or exclude from a backup.

Syntax

New-WssBackupConfiguration
   [-FilePath] <String>
   [-FileName] <String>
   [-IsDirectory]
   [-IsExcludeSpec]
   [<CommonParameters>]

Description

The New-WssBackupConfiguration cmdlet creates a file specification for a backup of a volume. The file specification lists the files and folders to include in or exclude from the backup.

Examples

Example 1: Create a backup file specification

PS C:\> $Spec = New-WssBackupConfiguration -FilePath "c:\users\" -FileName * -IsDirectory -IsExcludeSpec

This command creates a backup file specification that excludes folders in the c:\users path from the backup. It then stores the backup specification in the variable named $Spec.

Parameters

-FileName

Specifies the name of a file to back up. Use * for this parameter to back up all files in the path that the FilePath parameter specifies.

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

-FilePath

Specifies the path that contains the files to back up.

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

-IsDirectory

Indicates that the file specification refers to a folder.

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

-IsExcludeSpec

Indicates that the cmdlet excludes the files in the specification from the backup

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

Outputs

Microsoft.WindowsServerSolutions.DataProtection.ServerBackup.ObjectModel.BackupFileSpec

This cmdlet generates the object that specifies whether files or folders are included or excluded in the server backup.