From 8f9b6a9c4651bf8b532bd2f5a79f97fa4163a0b2 Mon Sep 17 00:00:00 2001 From: Audrey Aaliyah Jensen Date: Fri, 25 Aug 2023 10:35:57 -0500 Subject: [PATCH] get zips without regex --- Sandbox Scripts/prepare.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Sandbox Scripts/prepare.ps1 b/Sandbox Scripts/prepare.ps1 index eb4bd86..ad59d08 100644 --- a/Sandbox Scripts/prepare.ps1 +++ b/Sandbox Scripts/prepare.ps1 @@ -4,8 +4,9 @@ # take all *.eml and make .mht copies. Copy-Item './extract.py' '..'; -$pattern = [regex] "[/ A-z0-9\[\]\{\}\(\)\-_.:`"'+]{1,251}(\.zip)"; -Get-ChildItem | Where-Object {$_.name -match $pattern } | Group-Object -Property Name | ForEach-Object { - Copy-Item './..'; -} + +Get-ChildItem | Where-Object { $_.name -match '\.zip'} | ForEach-Object {Write-Output $_.name } + +$files = Get-ChildItem | Group-Object -Property extension -NoElement | Where-Object {$_.extension -like "zip"}; +$files | Where-Object {$_.extension -like "zip"} | ForEach-Object { Write-Output $_.name}; Write-Output Done; \ No newline at end of file