Integrate copy-binary-ps1 script

This commit is contained in:
Jonathan Jenne
2024-01-31 10:05:28 +01:00
parent c3fccc3c20
commit 9ac9895ed4
17 changed files with 68 additions and 13 deletions

View File

@@ -1,11 +1,29 @@
param(
[String]$SourcePath,
[String]$FileName,
[String]$Configuration
[String]$Configuration,
[String]$ProjectName
)
if ($Configuration -eq "Release") {
$DestinationPath = "P:\Install .Net\0 DD - Bibliotheken\Modules\$FileName"
Copy-Item $SourcePath -Destination $DestinationPath
}
$ArchiveFolderName = "Archiv"
$DestinationPath = "P:\Install .Net\0 DD - Bibliotheken\Modules\$ProjectName\"
$DestinationFilePath = [IO.Path]::Combine($DestinationPath, $FileName)
$ArchiveBasePath = [IO.Path]::Combine($DestinationPath, $ArchiveFolderName)
if ($Configuration -eq "Release") {
$DateFolderName = $((Get-Date).ToString('yyyy-MM-dd_hh-mm'))
$ArchivePath = [IO.Path]::Combine($ArchiveBasePath, $DateFolderName)
if (!(Test-Path -Path $ArchiveBasePath)) {
New-Item -Path $ArchiveBasePath -Type Directory
}
if (Test-Path -Path $DestinationFilePath) {
if (!(Test-Path -Path $ArchivePath)) {
New-Item -Path $ArchivePath -Type Directory
}
Copy-Item $DestinationFilePath -Destination $ArchivePath
}
Copy-Item $SourcePath -Destination $DestinationFilePath
}