Function Expand-Archive([string]$Path, [string]$Destination) {
$7z_Application = "C:\Program Files\7-Zip\7z.exe"
$7z_Arguments = @(
'x' ## eXtract files with full paths
'-y' ## assume Yes on all queries
"`"-o$($Destination)`"" ## set Output directory
"`"$($Path)`"" ## <archive_name>
)
& $7z_Application $7z_Arguments
}
Get-ChildItem "C:\source" -Filter *.7z | ForEach-Object {
Expand-Archive -Path $_.FullName -Destination "\\servername\c$\destination"
}
Function Expand-Archive([string]$Path, [string]$Destination) {
$7z_Application = "C:\Program Files\7-Zip\7z.exe"
$7z_Arguments = @(
'x' ## eXtract files with full paths
'-y' ## assume Yes on all queries
"`"-o$($Destination)`"" ## set Output directory
"`"$($Path)`"" ## <archive_name>
)
& $7z_Application $7z_Arguments
Remove-Item * -Include *.7z
}
https://gallery.technet.mi
From there on it's just Move-Item (or Get-ChildItem -Recurse "somewhere" | Move-Item "toSomewhereElse". Check this out for that...
https://msdn.microsoft.com
Let me know if that helps?