Skip to content

Update-Archive

SYNOPSIS

Updates the PSImportClient archive directory.

SYNTAX

1
2
3
Update-Archive [-ArchiveSettings] <PSObject> [[-FileToArchive] <String>] [[-ConfigurationName] <String>]
 [[-SourceName] <String>] [-AddToArchive] [-RotateArchive] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

The Update-Archive function updates, meaning adding and removing, the PSImportClient archive directory where any files with source object is moved to after an import from it was successful.

The Update-Archive function attempts to update the archive by doing things in the following order.

1. Copy file with source object(s) from original location to the directory specified in the settings file. 2. Remove file from its original location. 3. Remove files in the archive directory older than specified in the settings file.

EXAMPLES

EXAMPLE 1

1
2
3
4
5
6
7
8
$archiveUpdate = @{
    AddToArchive = $true
    ArchiveSettings = $psImportClientSettings.archiveSettings
    ConfigurationName = "$($destination.Name)"
    FileToArchive = (Join-Path -Path $icConfig.sourceSettingsObject.path -ChildPath $icConfig.sourceSettingsObject.fileNameWithExtension)
    SourceName = $source.name
}
Update-Archive @archiveUpdate

PARAMETERS

-AddToArchive

Specifies if file should be added to archive.

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

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

-ArchiveSettings

Object with settings for the archive.

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

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

-ConfigurationName

Name of configuration that is invoking the archiving.

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

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

-FileToArchive

Full path for file to archive.

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

Required: False
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

-RotateArchive

Specifies if archive should be rotated.

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

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

-SourceName

Name of source that is invoking the archiving.

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

Required: False
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

PSCustomObject

System.String

OUTPUTS

None. This function returns no output.

NOTES