I am having a bit of a time figuring this one out.
I have an array, that contains folder names (not the full path) and I am trying to use Get-ChildItem, and either use include/exclude, filter, or where-object and cannot for the life of me get this to filter out just the folder names in the array.
In my results I want to ONLY show Metadata.xml files that are located in folders that are in the array.
Here is some code I have tried:
Powershell
$GetXML=@(Get-ChildItem$sourceDir-Recurse-Include$FullyDeployedAssets-Filter"Metadata.xml")$GetXML=@(Get-ChildItem$sourceDir-Recurse-Filter"Metadata.xml")|Where-Object{$_.Name-like$FullyDeployedAssets}
Inside the $FullyDeployedAssets array I have tried both of these:
Text
*nickelodeon.com-XPTL0000000000265607**nickelodeon.com-XPTL0000000000265624**Showtime.com-XPTL0001412329131000*
and
...