Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
_PackageCopier.ps1
""
"Package Copier Starting..........."
""
if($args.length -ne 2)
{
$source = resolve-path "..\..\packages"
$destination = resolve-path "..\..\_nuget_repository\"
}
else
{
$source = $args[0]
$destination = $args[1]
}
if( -not (Test-Path -PathType Container $source))
{
throw "source directory does not exist, source: " + $source
}
if( -not (Test-Path -PathType Container $destination))
{
throw "Destination directory does not exist!! " + $destination
}
Get-ChildItem -Recurse -Filter "*.nupkg" $source `
| Where-Object { -not( Test-Path -PathType Leaf (Join-Path $destination $_.Name)) } `
| Copy-Item -Destination $destination -Verbose `
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.