2014-07-23 2 views
0

bin 폴더에 dll을 만들고 다른 lib 폴더에서 다른 DLL을 참조하는 프로젝트가 있습니다. 먼저 lib 폴더의 모든 것을 복사 한 다음 내 응용 프로그램의 bin 폴더에서 복사하고 모든 dll을 내 솔루션의 배포 된 위치에 복사 할 수 있어야합니다. 많은 참조가 자신의 폴더 구조에 있으므로 lib 폴더를 반복해야합니다.powershell을 통해 파일 복사

답변

0

같은 것을하기 위해 찾고있는 다른 사람들과 나눌 생각이었습니다. 다음은 powershell 스크립트입니다.

Clear-Host 
Write-Host "Copying the LIB folder now.." 
$LibFolderPath = "C:\lib" 
$DestPath = "C:\website\bin\" 
$BinPath = "C:\project\bin" 
ForEach($file in Get-Childitem $LibFolderPath -Recur`enter code here`se -ErrorAction SilentlyContinue ` 
| Where-Object {$_.Extension -Match "dll" -or $_.Extension -Match "pdb"}) 
{ 
Write-Host "Copying file: $file" 
Copy-Item -Path $file.fullname -Destination $DestPath -force 
} 


Write-Host "Copying the BIN folder now.." 
ForEach($file in Get-Childitem $BinPath -Recurse -ErrorAction SilentlyContinue ` 
| Where-Object {$_.Extension -Match "dll" -or $_.Extension -Match "pdb"}) 
{ 
Write-Host "Copying file: $file" 
Copy-Item -Path $file.fullname -Destination $DestPath -force 
} 
관련 문제