forked from Exiled-Team/EXILED
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackaging.ps1
59 lines (49 loc) · 1.96 KB
/
packaging.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<#
.SYNOPSIS
Moves a file from one location to another.
.DESCRIPTION
This function moves a file from the source location to the destination location.
.PARAMETER sourcePath
The path of the file to be moved.
.PARAMETER destinationPath
The path where the file should be moved to.
.EXAMPLE
Move-File -sourcePath "C:\Temp\file.txt" -destinationPath "D:\Backup\file.txt"
Moves the file "C:\Temp\file.txt" to "D:\Backup\file.txt".
#>
function Move-File {
param (
[Parameter(Mandatory=$true)]
[string]$sourcePath,
[Parameter(Mandatory=$true)]
[string]$destinationPath
)
# Check if the source file exists
if (-not (Test-Path -Path $sourcePath -PathType Leaf)) {
Write-Output "Source file does not exist."
return
}
# Check if the destination directory exists
$destinationDirectory = Split-Path -Path $destinationPath
if (-not (Test-Path -Path $destinationDirectory -PathType Container)) {
Write-Output "Destination directory does not exist."
return
}
# Move the file to the destination
try {
Move-Item -Path $sourcePath -Destination $destinationPath -Force
Write-Output "File moved successfully."
}
catch {
Write-Output "Failed to move the file: $_"
}
}
# Usage example for the Move-File function
# Move a file from one location to another
Move-File -sourcePath ".\EXILED-DLL-Archiver.exe" -destinationPath ".\bin\Release\EXILED-DLL-Archiver.exe"
Move-File -sourcePath ".\References\0Harmony.dll" -destinationPath ".\bin\Release\0Harmony.dll"
Move-File -sourcePath ".\References\SemanticVersioning.dll" -destinationPath ".\bin\Release\SemanticVersioning.dll"
Move-File -sourcePath ".\References\Mono.Posix.dll" -destinationPath ".\bin\Release\Mono.Posix.dll"
Move-File -sourcePath ".\References\System.ComponentModel.DataAnnotations.dll" -destinationPath ".\bin\Release\System.ComponentModel.DataAnnotations.dll"
CD .\bin\Release
.\EXILED-DLL-Archiver.exe