This is an old revision of the document!
rm
Removes one or more remote files.
rm <file> [ <file2> ... ]
Advertisement
If remote recycle bin is configured, moves file to the bin instead of deleting it. Filename can be replaced with wildcard to select multiple files.
Can remove non-empty directories recursively.
XML log element: rm
Examples
rm index.html rm index.html about.html rm *.html
Converting to .NET Assembly
When converting script to .NET Assembly, map rm
command to Session.RemoveFiles
method.
Parameters mapping: Command parameter file
maps to method parameter path
. When multiple source file parameters are used, you need to call Session.RemoveFiles
multiple times. You have to convert relative paths to absolute paths.
For example, following script snippet:
cd /home/martinp/public_html rm index.html about.html
Advertisement
maps to following PowerShell code:
$session.RemoveFiles("/home/martinp/public_html/index.html") $session.RemoveFiles("/home/martinp/public_html/about.html")