Copy-AdsFile

SYNOPSIS

Uploads / Downloads files from/to TwinCAT target.

SYNTAX

NetId (Default)

Copy-AdsFile [-Path] <String[]> [[-Destination] <String>] [-Directory <PathSpecifier>] [-Upload] [-Force]
 [-NetId <AmsNetId>] [<CommonParameters>]

Route

Copy-AdsFile [-Path] <String[]> [[-Destination] <String>] [-Directory <PathSpecifier>] [-Upload] [-Force]
 -InputObject <IRoute> [<CommonParameters>]

AddressStr

Copy-AdsFile [-Path] <String[]> [[-Destination] <String>] [-Directory <PathSpecifier>] [-Upload] [-Force]
 -Address <String> [<CommonParameters>]

SessionId

Copy-AdsFile [-Path] <String[]> [[-Destination] <String>] [-Directory <PathSpecifier>] [-Upload] [-Force]
 -SessionId <Int32> [<CommonParameters>]

DESCRIPTION

OBSOLETE: Use Copy-AdsRemoteItem instead. This cmdlet is maintained for backward compatibility only. This Cmdlet implements ADS file transfer operations with TwinCAT Systems. Files can be Uploaded or Downloaded from / to TwinCAT Systems that are reachable from the local system. That means all systems that are registered as "actual routes" and are online within the network.

EXAMPLES

Example 1

PS > Copy-AdsFile -Address CX_00001 -Path CurrentConfig.xml -Destination c:\tmp\Config1.xml -Directory BootDir

Downloads the CurrentConfig.xml from the BootDir of the target system to 'c:tmpConfig1.xml'

Example 2

PS > Copy-AdsFile -Address CX_00001 -Upload -Path c:\tmp\Config1.xml -Destination CurrentConfig.xml -Directory BootDir

Uploads the file "c:tmpConfig1.xml" on local system to the Target BootFolder of system CX_00001

Example 3

PS > Copy-AdsFile -Address CX_0001 -Path c:\ReadMe.txt -Destination d:\tmp\

Downloads the File "C:ReadMe.txt" from System CX_0001 to the local system and store it under d:tmpReadMe.txt

PARAMETERS

-Path

Specifies, as a string array, the path to the files to copy. Wildcard characters are permitted. If this Cmdlet is in Download mode, this is the specifier for the file on the remote side (the specified TwinCAT target system), dependant of the StandardFolder Parameter. In case of 'Uploading' these are the local FullPaths of the file to be 'uploaded' to the TwinCAT target/remote system. The source path.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: True

-Destination

The Destination path/specifier, where the file is stored. If the Cmdlet is in Download mode, this has to be the FullPath of the target location. In case of 'Uploading' this can be the FileName or a FullPath dependent of the StandardDirectory Parameter. The Destination / Target path.

Type: String
Parameter Sets: (All)
Aliases:

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

-Directory

The Directory specifier on the remote system. The Default is "Generic". The directory specifier.

Possible values: Generic, BootDir, TargetDir, ConfigDir, InstallDir, RepositoryDir, UserPath1, UserPath2, UserPath3, UserPath4, UserPath5, UserPath6, UserPath7, UserPath8, UserPath9

Type: PathSpecifier
Parameter Sets: (All)
Aliases:
Accepted values: Generic, BootDir, TargetDir, ConfigDir, InstallDir, RepositoryDir, UserPath1, UserPath2, UserPath3, UserPath4, UserPath5, UserPath6, UserPath7, UserPath8, UserPath9

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

-Upload

Switches the Cmdlet to Upload mode. If not set, the Cmdlet is in 'Download' mode. The upload switch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Force

Forces to create the Directory on the target side (and overwrites any preexisting file). The force indicator.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-NetId

The address (AmsNetId) of the system where the file is Downloaded from / Uploaded to (Default: Local) Tab completion: Completes AmsNetId values from currently reachable routes on the local TwinCAT system. The net id.

Type: AmsNetId
Parameter Sets: NetId
Aliases:

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

-InputObject

The address (Route) of the system where the file is Downloaded from / Uploaded to (Default: Local) Tab completion: Completes route names from currently reachable ADS systems on the local TwinCAT system. The input object.

Type: IRoute
Parameter Sets: Route
Aliases: Route

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Address

The address of the system where the file is Downloaded from / Uploaded to (Default: Local) This can be the RouteName, NetId, the HostName or the IPAddress. Tab completion: Completes route names from currently reachable ADS systems on the local TwinCAT system. The address.

Type: String
Parameter Sets: AddressStr
Aliases:

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

-SessionId

The target system address is derived from the Session Information where the file is Downloaded from / Uploaded to. Tab completion: Completes IDs of active TwinCAT sessions (created with New-TcSession). The session id.

Type: Int32
Parameter Sets: SessionId
Aliases: Id

Required: True
Position: Named
Default value: -1
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[]

TwinCAT.IRoute

OUTPUTS

NOTES