-
Notifications
You must be signed in to change notification settings - Fork 30
New WinSCPItem
Creates a new item on a remote system.
New-WinSCPItem [[-Path] <String[]>] [-Confirm] [-Force] [-ItemType <String>] [-Name <String>]
[-TransferOptions <TransferOptions>] [-Value <String>] [-WhatIf] -WinSCPSession <Session> [<CommonParameters>]
Creates a new item on a remote system.
PS C:\> New-WinSCPItem -Path NewWinSCPItem.txt
Directory: ./
Mode LastWriteTime Length Name
---- ------------- ------ ----
--------- 6/30/2017 1:41:47 PM 0 NewWinSCPItem.txt
PS C:\> $sessionOption = New-WinSCPSessionOption -HostName $env:COMPUTERNAME -Protocol Ftp
PS C:\> New-WinSCPSession -SessionOption $sessionOption
Opened Timeout HostName
------ ------- --------
True 00:01:00 ftp.dotps1.github.io
PS C:\> New-WinSCPItem -Path NewWinSCPItem.txt -Value "Hello World!"
Directory: ./
Mode LastWriteTime Length Name
---- ------------- ------ ----
--------- 6/30/2017 2:05:35 PM 12 NewWinSCPItem.txt
PS C:\> Remove-WinSCPSession
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseOverwrite the item if it already exists.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe type of item to create, file or directory.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: File
Accept pipeline input: False
Accept wildcard characters: FalseThe name of the new item. If this parameter is not used, the item will be named the last segment in the Path parameter value.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe full path to the new item. If the Name parameter is used, it will be appened to this value.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalseDefines options for file transfers.
Type: TransferOptions
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn initial value to put in the item.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows 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: False
Accept pipeline input: False
Accept wildcard characters: FalseIt represents a session and provides methods for manipulating remote files over SFTP, SCP or FTP session.
Type: Session
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
System.String[] System.String