New-AdsRemoteItem

SYNOPSIS

Creates a new file or directory on a TwinCAT target system.

SYNTAX

NetId (Default)

New-AdsRemoteItem [-Path] <String> [-Name] <String> [-ItemType] <String> [-NetId <AmsNetId>]
 [-WhatIf] [-Confirm] [<CommonParameters>]

Route

New-AdsRemoteItem [-Path] <String> [-Name] <String> [-ItemType] <String> -InputObject <IRoute>
 [-WhatIf] [-Confirm] [<CommonParameters>]

AddressStr

New-AdsRemoteItem [-Path] <String> [-Name] <String> [-ItemType] <String> -Address <String>
 [-WhatIf] [-Confirm] [<CommonParameters>]

SessionId

New-AdsRemoteItem [-Path] <String> [-Name] <String> [-ItemType] <String> -SessionId <Int32>
 [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The New-AdsRemoteItem cmdlet creates an empty file or a directory on a remote TwinCAT target. The Path parameter specifies the directory (including the StandardDirectory prefix, e.g., TARGETDIRsubdir), and the Name parameter specifies the file or directory name to create.

EXAMPLES

Example 1

New-AdsRemoteItem -Path \TARGETDIR\ -Name MyFolder -ItemType Directory

Creates a directory 'MyFolder' in the TargetDir on the local TwinCAT system.

Example 2

New-AdsRemoteItem -Path \TARGETDIR\ -Name test.txt -ItemType File -NetId "5.80.192.47.1.1"

Creates an empty file 'test.txt' in the TargetDir on a remote TwinCAT system.

PARAMETERS

-Path

The directory path on the ADS target where the item will be created. Must include the StandardDirectory prefix (e.g., TARGETDIRsubdir). ADS path format: [DriveName:]StandardDirectory[RelativePath]. Accepted forms: bare (TARGETDIRsubdir), drive-qualified (MyMachine:TARGETDIRsubdir), or Local alias (Local:TARGETDIRsubdir). Tab completion: Completes remote directory paths on the target TwinCAT system (StandardDirectory hierarchy).

Type: String
Parameter Sets: (All)
Aliases:

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

-Name

The name of the file or directory to create.

Type: String
Parameter Sets: (All)
Aliases:

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

-ItemType

The type of item to create: 'File' or 'Directory'.

Type: String
Parameter Sets: (All)
Aliases:

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

-NetId

The AmsNetId of the target system (Default: Local). Tab completion: Completes AmsNetId values from currently reachable routes on the local TwinCAT system.

Type: AmsNetId
Parameter Sets: NetId
Aliases:

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

-InputObject

The route of the target system. Tab completion: Completes route names from currently reachable ADS systems on the local TwinCAT system.

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 target system. This can be the RouteName, NetId, HostName or IPAddress. Tab completion: Completes route names from currently reachable ADS systems on the local TwinCAT system.

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. Tab completion: Completes IDs of active TwinCAT sessions (created with New-TcSession).

Type: Int32
Parameter Sets: SessionId
Aliases: Id

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

TwinCAT.IRoute

OUTPUTS

NOTES