-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSqlQueryEditor_Setup.ps1
More file actions
47 lines (42 loc) · 1.59 KB
/
SqlQueryEditor_Setup.ps1
File metadata and controls
47 lines (42 loc) · 1.59 KB
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
# Step 1: Navigate to your project directory (adjust the path as necessary)
$projectPath = "C:\Git\SqlQueryEditor"
if (!(Test-Path $projectPath)) {
New-Item -ItemType Directory -Path $projectPath
}
Set-Location -Path $projectPath
# Step 2: Create the scripts and logs directories
$scriptPath = Join-Path -Path $projectPath -ChildPath "scripts"
$logPath = Join-Path -Path $projectPath -ChildPath "logs"
if (!(Test-Path $scriptPath)) {
New-Item -ItemType Directory -Path $scriptPath
}
if (!(Test-Path $logPath)) {
New-Item -ItemType Directory -Path $logPath
}
# Step 3: Create the initial script files
$psScriptFile = Join-Path -Path $scriptPath -ChildPath "SqlQueryEditor.ps1"
$xamlFile = Join-Path -Path $scriptPath -ChildPath "SqlQueryEditor.xaml"
if (!(Test-Path $psScriptFile)) {
New-Item -ItemType File -Path $psScriptFile
}
if (!(Test-Path $xamlFile)) {
New-Item -ItemType File -Path $xamlFile
}
# Step 4: Create the initial log files
$transcriptLogFile = Join-Path -Path $logPath -ChildPath "SqlQuery_Transcript.log"
$userActivityLogFile = Join-Path -Path $logPath -ChildPath "SqlQuery_User_Activity.log"
if (!(Test-Path $transcriptLogFile)) {
New-Item -ItemType File -Path $transcriptLogFile
}
if (!(Test-Path $userActivityLogFile)) {
New-Item -ItemType File -Path $userActivityLogFile
}
# Step 5: Create the README.md file
$readmeFile = Join-Path -Path $projectPath -ChildPath "README.md"
if (!(Test-Path $readmeFile)) {
New-Item -ItemType File -Path $readmeFile
}
# Step 6: Initialize a Git repository and make the first commit
git init
git add .
git commit -m "Initial commit"