I have a PowerShell query.
I have the below 2 string arrays. What I want to be able to do is to return only those entries from $RecycleBinPaths that do not begin with all the entries from $ExcludeRecycleBinsPathWildCards (i.e. Wildcard pattern match)
$RecycleBinPaths = @('C:\$Recycle.Bin','D:\$RECYCLE.BIN','E:\$RECYCLE.BIN','F:\$RECYCLE.BIN','L:\$RECYCLE.BIN','M:\$RECYCLE.BIN','S:\$RECYCLE.BIN','T:\$RECYCLE.BIN')
$ExcludeRecycleBinsPathWildCards = @('C:\','F:\')
In the above example I want the output to be:
D:\$RECYCLE.BIN
E:\$RECYCLE.BIN
L:\$RECYCLE.BIN
M:\$RECYCLE.BIN
S:\$RECYCLE.BIN
T:\$RECYCLE.BIN
In fact $ExcludeRecycleBinsPathWildCards array above can contain any number of entries, not necessarily just 2 as shown above.
Are you able to help? Thanks.