OK, now that you've introduced that requirement, we've gotten this far:
$zipPackage = (New-Object -COM Shell.Application).NameSpace($zipfilename)
$destinationFolder = (New-Object -COM Shell.Application).NameSpace($destination)
foreach ($item in $zipPackage.Items())
{
$destinationItem = "$destinationFolder\$item"
$exists = Test-Path -Path $destinationItem
if (!$exists) # If the item doesn't exist in the desination directory...
{
if ($destinationItem.PsIsContainer)
{
# If the item DOES NOT exist, and it is a folder, what do we need to do?
}
else
{
$destinationFolder.CopyHere($item)
}
}
else
{
if ($destinationItem.PsIsContainer)
{
# If the item DOES exist, and it is a folder, what do we need to do?
}
else
{
# Remove the already-existing item, then copy the new one over
Remove-Item -Path $destinationItem
$destinationFolder.CopyHere($item)
}
}
}