I am able to successfully unzip a zipped file using a Powershell script as follows:
$filePath = "s:\Download Data Feed\"
$zip = Get-ChildItem -Recurse -Path $filePath | Where-Object { $_.Extension -eq ".zip" }
foreach ($file in $zip) {
Expand-7Zip -ArchiveFileName $file -Password "Password" -TargetPath $filePath
}
Read-Host -Prompt "Press Enter to exit"
The zip file are csv files. But what I would like is to unzip the csv file in a folder of the same name as the zip file itself (just as when you right click the zipped file you can choose to extract it as the file itself or to a folder of the same name as the zip file). I've tried looking at the switches for Expand-7Zip command but can't find any.
Thanks