• I need help with Power Shell

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

    Author
    Topic
    #2310221

    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

    Viewing 1 reply thread
    Author
    Replies
    • #2310252

      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

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

    Viewing 1 reply thread
    Reply To: I need help with Power Shell

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

    Your information: