News, tips, advice, support for Windows, Office, PCs & more
Home icon Home icon Home icon Email icon RSS icon

We're community supported and proud of it!

  • I need help with Power Shell

    Home Forums Developers, developers, developers DevOps Lounge I need help with Power Shell

    Topic Resolution: Resolved
    Viewing 2 reply threads
    • Author
      • #2310221
        AskWoody Plus

        I need help with Power Shell. I am trying to extract the files form the “C:\Users\Public\Documents\R-Technics\SongShow Plus\Songs” directory that have “paul r” as part of the file name. and put them in the directory “Paulr” in a text file called “Paulr.txt”. I am putting the following command into PS: get-childItem -include *paul r* > Paulr\Paulr.txt
        I have navigated to C:\Users\Public\Documents\R-Technics\SongShow Plus\Songs so the power shell command line looks like this:
        PS C:\Users\Public\Documents\R-Technics\SongShow Plus\Songs> get-childItem -include *paul r* > Paulr\Paulr.txt
        The file Paulr.txt is created in folder Paulr but it is empty.
        can anyone help me?

        I am running window 10 ver. 2004

      • #2310252
        Paul T
        AskWoody MVP

        You have a space in your file spec so you need to quote it.
        Try it without the redirect first, to make sure it’s working.
        Use “-Filter” rather than “-Include”, it’s more efficient.
        If you only want the names, use “-Name”.

        e.g. get-childItem -name -filter "*paul r*"

        cheers, Paul

      • #2310353
        AskWoody Plus

        Thanks Paul, I made the changes that you suggested and that worked.  I really appreciate your help. This can be closed

    Viewing 2 reply threads

    Please follow the -Lounge Rules- no personal attacks, no swearing, no politics or religion.

    Reply To: I need help with Power Shell

    You can use BBCodes to format your content.
    Your account can't use Advanced BBCodes, they will be stripped before saving.