-
Notifications
You must be signed in to change notification settings - Fork 0
/
Boot.ps1
62 lines (47 loc) · 1.57 KB
/
Boot.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
60
61
# Create Config file if it doesn't exist.
if(!(Test-Path -Path ./Config.ps1)){
Copy-Item -Path ./Config_Template.ps1 -Destination ./Config.ps1
}
# Test for PSSQLite module
$mod = Get-InstalledModule -Name PSSQLite
if($null -eq $mod){
# Module not installed
Write-Host "Please install the module PSSQLite by running the following command"
Write-Host -ForegroundColor Yellow "Install-Module -Name PSSQLite"
} else {
# Module is Installed
Function Boot-AMM{
. .\Config.ps1
. .\DatabaseFunctions.ps1
. .\HelperFunctions.ps1
. .\OfferFunctions.ps1
. .\ReportingFunctions.ps1
. .\TradeingFunctions.ps1
. .\AmmFunctions.ps1
. .\tibet.ps1
}
. Boot-AMM
# Check database
if(-Not (Test-Path -Path (Get-DatabaseConfig).database)){
Write-Host -ForegroundColor Red "No Database Detected"
Write-Host -ForegroundColor Yellow "Creating Database"
# Checking if Folder Exists
$directory = Split-Path $config.database -Parent
if(-NOT (Test-Path -Path $directory)){
New-Item -ItemType Directory -Path $directory
}
# Creating Tables in database
Create-XCHTradeLogDatabase
}
# This section is needed for the PowerShell Jobs to function correctly
$function = {
. .\Config.ps1
. .\DatabaseFunctions.ps1
. .\HelperFunctions.ps1
. .\OfferFunctions.ps1
. .\ReportingFunctions.ps1
. .\TradeingFunctions.ps1
. .\AmmFunctions.ps1
. .\tibet.ps1
}
}