-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopyToLocalNuget.ps1
More file actions
21 lines (15 loc) · 906 Bytes
/
copyToLocalNuget.ps1
File metadata and controls
21 lines (15 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$localNugetReposetory = $env:LocalNugetReposetory
if ($localNugetReposetory -eq $null) {
$localNugetReposetory = '~\Source\LocalNugetRepo'
}
if (Test-Path $localNugetReposetory) {
Write-Host "Copy Files To $localNugetReposetory"
Get-ChildItem -Directory | Where-Object {$_.Name -ne 'packages'} | Get-ChildItem -Filter *.nupkg -Recurse | Copy-Item -Destination $localNugetReposetory -Verbose
Get-ChildItem -Directory | Where-Object {$_.Name -ne 'packages'} | Get-ChildItem -Filter *.nupkg -Recurse | Remove-Item -Verbose
$nugetLocationOutput = nuget locals global-packages -list
$nugetLocation = $nugetLocationOutput.SubString('global-packages:'.Length).Trim()
if (Test-Path $nugetLocation) {
Write-Host "Remove folder from local nuget $nugetLocation"
Get-ChildItem $nugetLocation -Directory -Filter NDProperty* | Remove-Item -Recurse -Force -Verbose
}
}