VS2015 – copy header files

use post build event

利用帶入巨集變數$(SolutionDir),在powershell script讀取SolutionDir

powershell -ExecutionPolicy Unrestricted $(SolutionDir)\copyheader.ps1 -SolutionDir $(SolutionDir)

copyheader.ps1

param([string]$SolutionDir);
$src1 = $SolutionDir + "Http"
$dest1 = $SolutionDir + "output\http"
Copy-Item -Path $src1 -Filter "*.h" -Recurse -Destination $dest1 -Container -force

-force 強制overwrite
這樣會recursive的複製.h檔到對應的目錄

試過xcopy bat,比較起來powershell script處理方式較簡潔

This entry was posted in Tips. Bookmark the permalink.

Leave a Reply