<img src="//trc.taboola.com/1222697/log/3/unip?en=page_view" width="0" height="0" style="display:none">


The Knowledgebase articles are deprecated. Please visit the new Guides and Resources here: https://www.uipath.com/developers/guides-and-resources.

Knowledge Base

IT Automation. PowerShell. Read Text Files



This sample gets all the text files from the folder and displays their contain using PowerShell commands.

Steps to automate

  1. In case there isn't a text document in the folder, the workflow creates one.
  2. Get all the text documents from the folder.
  3. For each one, extracts their content and displays it.


  1. Use "Write text file" activity to create a text document. If you have text files in folder you can skip this part.
  2. Using "Invoke PowerShell" activity, you can send commands from your workflow to Windows PowerShell.
  3. Display the content of each text document using a "For Each" and a "Message Box" activity.