question

ChristopherJack-1763 avatar image
0 Votes"
ChristopherJack-1763 asked ChristopherJack-1763 edited

Populate variable with filenames with select characters

Hi,

I am wanting to populate $source with only the filenames which have UK in it.

Currently using

$source = Get-ChildItem -Path "\\Suppressions\" -Filter '*.csv'

How would I get that to just pick UK filenames?

TIA

windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndreasBaumgarten avatar image
1 Vote"
AndreasBaumgarten answered

Hi @ChristopherJack-1763 ,

maybe this is helpful to get started:

 $source = Get-ChildItem -Path .\Junk -file  "*UK*.*"
 $source


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ChristopherJack-1763 avatar image
0 Votes"
ChristopherJack-1763 answered

Thanks Andreas.. much appreciated

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.