16 lines
622 B
PowerShell
16 lines
622 B
PowerShell
# 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.
|
|
|
|
#Copy items to desktop
|
|
Copy-Item './extract.py' '..';
|
|
Get-ChildItem | Where-Object { $_.name -match '\.zip'} | ForEach-Object {Copy-Item -Path $_.name -Destination '..' }
|
|
|
|
#Capture zip password from filename
|
|
$pwPattern = [regex] "[A-z 0-9 \-]{1,251}\((?<PW>[A-z0-9]{1,251})\)\.zip";
|
|
|
|
$files = Get-ChildItem;
|
|
$passwords = [Regex]::Matches($files, $pwPattern);
|
|
$passwords.groups | Where-Object {$_.Name -match "PW"} | ForEach-Object {Write-Output $_.Value }
|
|
|
|
Write-Output Done; |