@LuisB647 In V22, these methods are available directly from the Toolbox, however in 19.1, this requires you to add a couple items to your Toolbox window.
Right-click in your Toolbox in whatever tab you want these methods added. I usually use the General tab for these things, but you can create a new one, or use an existing one.
Select "Choose Items...".
In the "Choose Toolbox Items" window, select the "Pega Robot Static Members" tab.
Select the "From Global Assembly Cache" radio button. This is usually referred to as "the GAC" (pronounced like gack).
Select the latest version of the MSCORLIB assembly. The easiest way to locate the assembly is to click on the combo box and press the letter "N" on your keyboard. You can scroll up from here to find MSCORLIB as it is closer to the end of the "M" than the beginning.
Locate the "File" node.
Beneath this node are two static methods you'll want; AppendAllText and WriteAllText.
WriteAllText will create the file if it doesn't exist (and you have permissions in that location to do so) and set the contents equal to whatever you supply it.
AppendAllText will append whatever text you supply to the end of the file. If you want your new text to start with a new line, you need to insert that yourself.