If you have a Microsoft Visual Studio 2010 solution, which contains setup projects and you want to copy all msi packages from the “Release” folders to one folder you can use the following script:

 

$SourceFolder = "C:\Source"
$DestinationFolder = "C:\Destination"

"Copy *.msi packages from [Release] subfolders in $SourceFolder to the $DestinationFolder"
if(Test-Path $SourceFolder )
{
    foreach ($item in Get-ChildItem "$SourceFolder" -filter "*.msi" -recurse)
    {
        if ($item.FullName -like "*Release*" )
        {
            Copy-Item $item.FullName -Destination "$DestinationFolder"
        }
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.