< Back

New-SFTPItem

Sat Jan 18, 2020 7:58 pm

NAME New-SFTPItem



SYNOPSIS

Create a file or directory on remote host using SFTP.





SYNTAX

New-SFTPItem [-SessionId] <Int32[]> [-Path] <String> [[-ItemType] <String>] [-Recurse] [<CommonParameters>]



New-SFTPItem [-SFTPSession] <SftpSession[]> [-Path] <String> [[-ItemType] <String>] [-Recurse] [<CommonParameters>]





DESCRIPTION

Create a file or directory on remote host using SFTP.





PARAMETERS

-SessionId <Int32[]>

SSH Session Id for an existing session.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Path <String>

Path on remote host to create the item.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ItemType <String>

Type of item to create. Options are: * File



* Directory



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Recurse [<SwitchParameter>]

@{Text=}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-SFTPSession <SftpSession[]>

SFTP Session Object of an exiting session.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.Int32[]





SSH.SftpSession[]







OUTPUTS



NOTES









-------------------------- EXAMPLE 1 --------------------------



New-SFTPItem -SessionId 0 -Path /tmp/help -ItemType Directory



FullName : /tmp/help

LastAccessTime : 3/17/2015 7:58:11 PM

LastWriteTime : 3/17/2015 7:58:11 PM

Length : 6

UserId : 1000





PS C:\\> Get-SFTPPathAttribute 0 -Path /tmp/help





LastAccessTime : 3/17/2015 7:58:11 PM

LastWriteTime : 3/17/2015 7:58:11 PM

Size : 6

UserId : 1000

GroupId : 1000

IsSocket : False

IsSymbolicLink : False

IsRegularFile : False

IsBlockDevice : False

IsDirectory : True

IsCharacterDevice : False

IsNamedPipe : False

OwnerCanRead : True

OwnerCanWrite : True

OwnerCanExecute : True

GroupCanRead : True

GroupCanWrite : True

GroupCanExecute : True

OthersCanRead : True

OthersCanWrite : False

OthersCanExecute : True

Extensions :







RELATED LINKS

Online Version: https://github.com/darkoperator/Posh-SS ... aster/docs