Copy-AdsRemoteItem
SYNOPSIS
Copies files from/to a TwinCAT target system, between ADS paths, or between local paths.
SYNTAX
NetId (Default)
Copy-AdsRemoteItem [-Path] <String[]> [-Destination] <String> [-Force] [-NetId <AmsNetId>]
[<CommonParameters>]
Route
Copy-AdsRemoteItem [-Path] <String[]> [-Destination] <String> [-Force] -InputObject <IRoute>
[<CommonParameters>]
AddressStr
Copy-AdsRemoteItem [-Path] <String[]> [-Destination] <String> [-Force] -Address <String>
[<CommonParameters>]
SessionId
Copy-AdsRemoteItem [-Path] <String[]> [-Destination] <String> [-Force] -SessionId <Int32>
[<CommonParameters>]
DESCRIPTION
The Copy-AdsRemoteItem cmdlet implements file copy operations with TwinCAT systems. It supports four modes: download (ADS to local), upload (local to ADS), ADS-to-ADS copy (between StandardDirectories on the same or different targets), and local-to-local copy. The transfer direction is automatically detected from the path format. All TwinCAT systems that are registered as actual routes and are online within the network are supported.
EXAMPLES
Example 1
PS > Copy-AdsRemoteItem -Address CX_00001 -Path "Local:\BOOTDIR\CurrentConfig.xml" -Destination c:\tmp\Config1.xml
Downloads the CurrentConfig.xml from the BootDir of the target system to 'c:tmpConfig1.xml'.
Example 2
PS > Copy-AdsRemoteItem -Address CX_00001 -Path c:\tmp\Config1.xml -Destination "Local:\BOOTDIR\CurrentConfig.xml"
Uploads the file 'c:tmpConfig1.xml' on the local system to the target BootFolder of system CX_00001.
Example 3
PS > Copy-AdsRemoteItem -Address CX_0001 -Path "\TARGETDIR\ReadMe.txt" -Destination d:\tmp\
Downloads the file 'ReadMe.txt' from the TargetDir of system CX_0001 to the local system and stores it under d:tmpReadMe.txt.
Example 4
PS > Copy-AdsRemoteItem -Path "Local:\TARGETDIR\ReadMe.txt" -Destination "Local:\BOOTDIR\ReadMe.txt" -Force
Copies the file 'ReadMe.txt' from the TargetDir to the BootDir on the local TwinCAT system (ADS-to-ADS copy).
Example 5
PS > Copy-AdsRemoteItem -Path c:\tmp\Config1.xml -Destination d:\backup\Config1.xml
Copies a local file to another local path (local-to-local copy).
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. ADS path format: [DriveName:]StandardDirectory[RelativePath]. Accepted forms: bare (TARGETDIRfile.txt), drive-qualified (MyMachine:TARGETDIRfile.txt), or Local alias (Local:TARGETDIRfile.txt). Tab completion: Completes both remote ADS file/directory paths on the target system and local filesystem paths. 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. ADS path format: [DriveName:]StandardDirectory[RelativePath]. Accepted forms: bare (TARGETDIRfile.txt), drive-qualified (MyMachine:TARGETDIRfile.txt), or Local alias (Local:TARGETDIRfile.txt). Tab completion: Completes both remote ADS file/directory paths on the target system and local filesystem paths. The Destination / Target path.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
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. This can be the RouteName, NetId, the HostName or the IPAddress. Required when using bare ADS paths (e.g., TARGETDIRfile.txt) to target a remote system. Optional when using drive-qualified paths - defaults to the local system if omitted. 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 port.
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.