User Tools

Site Tools


transformations:powershell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
transformations:powershell [2018/01/11 20:58] dmitrytransformations:powershell [2021/07/17 16:26] (current) craigt
Line 1: Line 1:
-===== PowerShell =====+{{ transformations:PowerShellAction.png}} 
 +====== POWERSHELL ====== 
 +Category: Workflow / External\\
  
-Category: Workflow / External.+\\  
 +=====Description===== 
 +This action allows executing PowerShell commands and scripts from within EasyMorph. PowerShell 3.0 or above is required.
  
-This transformation allows executing PowerShell commands and scripts right in EasyMorphIt requires PowerShell 3.0 or above installed.+\\  
 +=====Use cases===== 
 +PowerShell is a very versatile scripting language supported by the vast ecosystem of the .NET framework. Having EasyMorph integrated with Powershell opens access to a large number of PowerShell cmdlets which help automate various tasks (e.g. advanced file operations, sending emails, computer management, and administration).
  
-It is possible to send values of column to the executed PowerShell commands through the built-in **$input** variable in PowerShell, for instance:+EasyMorph actions can effectively be inserted into PowerShell command pipelines (e.g. generate a list of files in EasyMorph, filter it using EasyMorph expressions, and then send the resulting list into PowerShell). 
 + 
 +Finally, it becomes possible to write custom cmdlets (e.g. in C#) and run them from EasyMorph using EasyMorph parameters or column data. 
 + 
 +\\  
 +=====Action settings===== 
 +^ Setting  ^ Description 
 +|Input pipeline\\ (accessible via $input)|Select the input pipeline, if any.  Options:  //None//, //Column//, or //Table//.| 
 +|Commands<sup>*</sup>|Enter one more PowerShell commands.| 
 +|Output and errors|Select whether output and errors will be captured by EasyMorph.  Options:  //Do not capture output. Fail on errors.//\\ or //Capture output and error collections.//
 +<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].\\ 
 + 
 +\\  
 +=====Remarks===== 
 +It is possible to send values of column to the executed PowerShell commands through the built-in **$input** variable in PowerShell, for instance:
  
   $input | Sort-Object   $input | Sort-Object
Line 11: Line 31:
 Note that **$input** is an enumerator for the sequence, not the sequence itself. Note that **$input** is an enumerator for the sequence, not the sequence itself.
  
 +\\ 
 It is possible to insert EasyMorph parameters right into the script text. Just insert parameter names in curly braces. For instance: It is possible to insert EasyMorph parameters right into the script text. Just insert parameter names in curly braces. For instance:
  
   Copy-Item "{Source file}" c:\test   Copy-Item "{Source file}" c:\test
  
-It'also possible to capture the output sequence from the PowerShell script back to EasyMorph. Note that the output sequence should be explicitly converted in the PowerShell script into a sequence of basic types such as //string//, //integer//, //float//, //DateTime// or //bool//. Formatted output of the standard PowerShell console is not captured.+\\  
 +It is also possible to capture the output sequence from the PowerShell script back to EasyMorph. Note that the output sequence should be explicitly converted in the PowerShell script into a sequence of basic types such as //string//, //integer//, //float//, //DateTime// or //bool//. Formatted output of the standard PowerShell console is not captured.
  
-**See also** +\\  
-  * Blog: [[http://blog.easymorph.com/2017/12/running-powershell-commands-in-easymorph.html|Running PowerShell commands in EasyMorph]]+=====Community examples===== 
 +  [[https://community.easymorph.com/t//1442/4|Web page table information]] ([[https://community.easymorph.com/uploads/short-url/9mWELRWkmVY3kq93SX5IpZMlPuf.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Parse HTML table//; Action position: //1//) 
 +  * [[https://community.easymorph.com/t//1869/6|Coverting Cell to Separate Columns]] ([[https://community.easymorph.com/uploads/short-url/ktZECKXUuEJAEq0fobEmmoXzsGu.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Input data//; Action position: //1//) 
 +  * [[https://community.easymorph.com/t//2153/2|Bzip2 or gzip format]] ([[https://community.easymorph.com/uploads/short-url/jPrYO6n9pgvzySEsydPWLo0uYq8.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Table 1//; Action position: //1//) 
 +  * [[https://community.easymorph.com/t//2667/1|Run a task only when free RAM is above threshold]] ([[https://community.easymorph.com/uploads/short-url/aU83eid5IQaSt2mJk8hybsitpw3.morph|Project]]; Module: //MemInfo//; Group: //Tab 1//; Table: //Table 1//; Action position: //1//) 
 + 
 + 
 +\\  
 +=====See also=====
   * [[transformations:runprogram|Action: Run program]]   * [[transformations:runprogram|Action: Run program]]
-  * [[https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell|Installing Windows PowerShell]]+  * Blog: [[http://blog.easymorph.com/2017/12/running-powershell-commands-in-easymorph.html|Running PowerShell commands in EasyMorph]] 
 +  * Microsoft documentation: [[https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7.1|Installing Windows PowerShell]] 
transformations/powershell.1515722290.txt.gz · Last modified: 2018/01/11 20:58 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki