Scripting with PowerShell |
Top Previous Next |
As well as a Command Line interface FileLocator Network also provides external .NET components that can be used to control searches. Using PowerShell it is possible to run a search with just a few lines of script, e.g.
This simple example loads the saved search named 'Main Search' and runs it against the list of saved target computers. Once the search has finished the results are exported to a file in text format.
The component model also allows complex customization of a saved search before running it, e.g.
As with most PowerShell objects it is possible to query the methods and properties of an object using get-member (or the alias gm) e.g. to query the search object:
or the Criteria object:
Also, to list enumerations using the Enum class:
Error Handling
If an error occurs the pertinent information is normally contained within the InnerException, e.g.
|