From 667acf6b0b0aa45c31f184f9cd05bf126226d651 Mon Sep 17 00:00:00 2001 From: Audrey Aaliyah Jensen Date: Fri, 25 Aug 2023 10:16:17 -0500 Subject: [PATCH] Copy zips to desktop --- Sandbox Scripts/prepare.ps1 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Sandbox Scripts/prepare.ps1 b/Sandbox Scripts/prepare.ps1 index 1d4554c..eb4bd86 100644 --- a/Sandbox Scripts/prepare.ps1 +++ b/Sandbox Scripts/prepare.ps1 @@ -2,11 +2,10 @@ # Regex the password from the zip's filename. Copy to var # Open 7zip, extract to desktop, input password. # take all *.eml and make .mht copies. -#Set-Location './Sandbox Scripts'; -Copy-Item './extract.py' '..'; -# Here's the RegEx: [/ A-z0-9\[\]\{\}\(\)\-\_.:"'+]{1,251}(\.zip) +Copy-Item './extract.py' '..'; $pattern = [regex] "[/ A-z0-9\[\]\{\}\(\)\-_.:`"'+]{1,251}(\.zip)"; -Get-ChildItem | Where-Object {$_.name -match $pattern }; -Write-Output $zips +Get-ChildItem | Where-Object {$_.name -match $pattern } | Group-Object -Property Name | ForEach-Object { + Copy-Item './..'; +} Write-Output Done; \ No newline at end of file