.
This commit is contained in:
parent
a657f6f516
commit
2cec4e795e
17
Eingang/where-filter.md
Normal file
17
Eingang/where-filter.md
Normal file
@ -0,0 +1,17 @@
|
||||
## Abfrage where nach einer Liste filtern
|
||||
|
||||
Mittwoch, 10. Januar 2024
|
||||
16:32
|
||||
|
||||
You can then read in this file as array with
|
||||
|
||||
$list= Get-Content -Path "<PATH TO THE FILE>"
|
||||
|
||||
Next combine this list to build the pattern like
|
||||
|
||||
$pattern= (($list| ForEach-Object {[regex]::Escape($_)}) –join"|")
|
||||
and do
|
||||
|
||||
Get-AppxPackage | Where-Object {$_.name -notmatch $pattern}
|
||||
|
||||
Aus <https://stackoverflow.com/questions/52152228/how-to-filter-a-list-with-a-list-of-strings-in-powershell>
|
Loading…
Reference in New Issue
Block a user