Differences
This shows you the differences between the selected revisions of the page.
| 2013-05-15 | 2013-05-20 | ||
| library_powershell (martin) | powershell preview (martin) | ||
| Line 216: | Line 216: | ||
| Use method ''[[library_session_fileexists|Session.FileExists]]'' from [[library|WinSCP .NET assembly]]. | Use method ''[[library_session_fileexists|Session.FileExists]]'' from [[library|WinSCP .NET assembly]]. | ||
| - | If you do not have your favourite language, use [[library_powershell|PowerShell]]. See [[library_session_fileexists#powershell|PowerShell example for Session.FileExists]]. | + | If you do not have your favourite language, use [[library_powershell|PowerShell]]: |
| + | |||
| + | <code powershell> | ||
| + | $remotePath = "/home/user/test.txt" | ||
| + | |||
| + | if ($session.FileExists($remotePath)) | ||
| + | { | ||
| + | Write-Host("File {0} exists" -f $remotePath) | ||
| + | } | ||
| + | </code> | ||
| + | |||
| + | See complete [[library_session_fileexists#powershell|PowerShell example for Session.FileExists]]. | ||
| ~~AD~~ | ~~AD~~ | ||