< Back

Rename-SFTPFile

Sat Jan 18, 2020 7:59 pm

NAME Rename-SFTPFile



SYNOPSIS

Move or Rename remote file via a SFTP Session





SYNTAX

Rename-SFTPFile [-SessionId] <Int32[]> [-Path] <String> [-NewName] <String> [<CommonParameters>]



Rename-SFTPFile [-SFTPSession] <SftpSession[]> [-Path] <String> [-NewName] <String> [<CommonParameters>]





DESCRIPTION

Move or Rename remote file via a SFTP Session specified by index or SFTP Session object.





PARAMETERS

-SessionId <Int32[]>

SFTP Session Id of an exiting session.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Path <String>

Full path to file to rename



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NewName <String>

New name for file.



Required? true

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SFTPSession <SftpSession[]>

Exiting SFTP Session object.



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 --------------------------



Rename-SFTPFile -SessionId 0 -Path /tmp/anaconda-ks.cfg -NewName anaconda-ks.cfg.old -Verbose

VERBOSE: Renaming /tmp/anaconda-ks.cfg to anaconda-ks.cfg.old

VERBOSE: File renamed







RELATED LINKS

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