Skip to content

Add-FileToArchive

SYNOPSIS

Adds an file to the archive.

SYNTAX

1
2
Add-FileToArchive [-ArchiveDirectory] <String> [-FileToArchive] <String> [-ConfigurationName] <String>
 [-SourceName] <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The Add-FileToArchive function adds a file to the archive by copying it from its original location.

Its new location is a combination of the destination name, source name, date and a new name in the combination of the time and original file name.

Ex: archive/test/jdbcSource/date/time_filename.fileextension

EXAMPLES

EXAMPLE 1

1
2
3
4
5
6
7
$addFileToArchiveParams = @{
    FileToArchive = $FileToArchive
    ArchiveDirectory = $ArchiveSettings.directory
    ConfigurationName = $ConfigurationName
    SourceName = $SourceName
}
Add-FileToArchive @addFileToArchiveParams

PARAMETERS

-ArchiveDirectory

Path to archive.

1
2
3
4
5
6
7
8
9
Type: String
Parameter Sets: (All)
Aliases:

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

-ConfigurationName

Name of destination configuration.

1
2
3
4
5
6
7
8
9
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-FileToArchive

Path to file to archive.

1
2
3
4
5
6
7
8
9
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by the Write-Progress cmdlet. The Write-Progress cmdlet creates progress bars that show a command's status.

The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.

1
2
3
4
5
6
7
8
9
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

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

-SourceName

Name of source configuration.

1
2
3
4
5
6
7
8
9
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 4
Default value: None
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

System.String

OUTPUTS

None. This function returns no output.

NOTES