How to Append to a List From PowerShell

PowerShell gives system administrators and regular users the power to manage Windows. You can update the Windows registry, manipulate the file system and perform other system tasks by typing commands into PowerShell's command line. While working in the PowerShell interface, you may need to record notes and ideas. One way to do this is to add them to a list using PowerShell's "Append-Content" Cmdlet.


    • 1

      Click the Windows "Start" button, and type "Windows PowerShell" -- without the quotes -- in the Start menu's search box. The PowerShell icon appears at the top of the menu.

    • 2

      Click that icon to open the PowerShell window. The PowerShell prompt appears in the window.

    • 3

      Type the following text after the prompt:

      Add-Content C:\myList.txt "`nXYZ"

      Replace "C:\myList.txt" with the path name of the file that contains your list. Replace "XYZ" with the text you wish to add to the list.

    • 4

      Press "Enter." PowerShell executes the commands and appends your text to your list.

    • 5

      Append additional items to the list by running the command again and replacing "XYZ" with the text you want to append to your list.

Tips & Warnings

  • Press your "Up" and "Down" arrow keys to retrieve previously typed commands.

  • View PowerShell's editing menu by clicking the blue icon in the upper-left corner of the window. Access this menu when you need to copy or paste commands into the window.

Related Searches



Related Ads