Function create-7zip([String] $aDirectory, [String] $aZipfile){
[string]$pathToZipExe = "C:\Program Files-zipz.exe";
[Array]$arguments = "a", "-tzip", "$aZipfile", "$aDirectory", "-r";
& $pathToZipExe $arguments;
}
$files="c:\backup"
$target="c:\archive"
$dirs = Get-ChildItem -Path $files | Where-Object { $_.Attributes -eq "Directory" }
Foreach ($dir in $dirs){
$name = $dir.name
$newname = $name.ToLower() -replace(" ","")
create-7zip $files $target.zip
}