Differences

This shows you the differences between the selected revisions of the page.

2015-02-26 2015-02-26
guide_custom_commands_automation (martin) suggesting for other tasks (martin)
Line 10: Line 10:
See also [[library_example_listing_files_matching_wildcard|Listing files matching wildcard]]. See also [[library_example_listing_files_matching_wildcard|Listing files matching wildcard]].
 +
 +You can alter the script for other tasks, instead of grepping the matching files. You can for example [[library_session_removefiles|remove]] or [[library_session_getfiles|download]] the matching files. Just modify the action in ''if ($fileInfo.Name -Like $wildcard)'' block accordingly.
<code powershell> <code powershell>
Line 45: Line 47:
            if ($fileInfo.Name -Like $wildcard)             if ($fileInfo.Name -Like $wildcard)
            {             {
 +                # Modify the code below if you want to do another task with
 +                # matching files, instead of grepping their contents
 +
                Write-Host ("File {0} matches mask, searching contents..." -f $filePath)                 Write-Host ("File {0} matches mask, searching contents..." -f $filePath)
                $tempPath = ($env:temp + "\" + $fileInfo.Name)                 $tempPath = ($env:temp + "\" + $fileInfo.Name)

Last modified: by martin