! - Run a local command in SFTP

You can run local Windows commands using the ! command.
This is the only PSFTP command that is not subject to the command quoting rules.
If any command line begins with the ! character, then the rest of the line will be passed straight to Windows without further translation.

psftp> ! (psftp command)

For example, if you want to move an existing copy of a file out of the way before downloading an updated version, you might type:
psftp> !ren file1.txt  file1_copy.txt
psftp> get file1.txt

In the above code the first line will act as a local command and the second line will act as normal PSFTP command.