Run TUFLOW From PowerShell: Difference between revisions

Content deleted Content added
Created page with "PowerShell is a modern scripting language and command interpreter for Windows that can be used as an alternative to more traditional batch files. When creating a PowerShell sc..."
 
No edit summary
Line 1:
PowerShell is a modern scripting language and command interpreter for Windows that can be used as an alternative to more traditional batch files.
When creating a PowerShell script to run TUFLOW, much of the functionality will be similar to batch files, but PowerShell offers some additional benefits such as a more modern syntax and the ability to better interact with other features of the Windows operating system. Perhaps one of the most useful features would be the ability to send an email once a TUFLOW simulation has finished. This would allow, for example, a script running a TUFLOW simulation on a server to inform a user on their own computer that a simulation has finished, and details of that simulation to be sent within the email too.
 
Unlike batch files, a PowerShell script will not run by default when double clicking it in File Explorer. Instead, a user can run the PowerShell script via the command line, for example by searching and opening “PowerShell” from the Windows start menu.
 
A PowerShell script can be created in a similar way to a batch file. For example, right click in File Explorer, then click New > Text Document, and then provide a file name and extension (.ps1 for PowerShell). Alternatively, when using the [[Create_TUFLOW_Project|Create TUFLOW Project Tool in QGIS]], a PowerShell script is automatically generated in addition to a batch file: [[Create_TUFLOW_Project]].
 
=A simple example=