-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathStart-Solution.cmd
More file actions
69 lines (55 loc) · 2.03 KB
/
Start-Solution.cmd
File metadata and controls
69 lines (55 loc) · 2.03 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
rem @echo off
setlocal enabledelayedexpansion
REM ------------------------------------------------------------
REM Determine the folder name (solution name)
REM ------------------------------------------------------------
set "CurrentDir=%~dp0"
for %%F in ("%CurrentDir:~0,-1%") do set "FolderName=%%~nxF"
REM ------------------------------------------------------------
REM Find the .slnx file matching the folder name
REM ------------------------------------------------------------
set "SolutionFile=%CurrentDir%%FolderName%.slnx"
if not exist "%SolutionFile%" (
echo ERROR: Could not find solution file "%FolderName%.slnx"
echo Make sure the .slnx file has the same name as the folder.
exit /b 1
)
REM ------------------------------------------------------------
REM Parse optional parameters
REM ------------------------------------------------------------
set "DryRun="
set "Help="
:parseArgs
if "%~1"=="" goto argsDone
if /I "%~1"=="-DryRun" (
set "DryRun=-DryRun"
) else if /I "%~1"=="-Help" (
set "Help=-Help"
)
shift
goto parseArgs
:argsDone
REM ------------------------------------------------------------
REM script location for module-playbook-example
REM ------------------------------------------------------------
set "ScriptPath=..\oqtane-ai-playbook\module-playbook-example\sync-governance.ps1"
if not exist "%ScriptPath%" (
echo ERROR: Could not find script: %ScriptPath%
exit /b 1
)
REM ------------------------------------------------------------
REM Run the PowerShell script
REM ------------------------------------------------------------
echo Running governance sync script...
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%ScriptPath%" -SolutionPath "%SolutionFile%" %DryRun% %Help%
if errorlevel 1 (
echo Script reported an error.
exit /b 1
)
REM ------------------------------------------------------------
REM Open the solution
REM ------------------------------------------------------------
echo Opening solution: "%SolutionFile%"
start "" "%SolutionFile%"
endlocal
exit /b 0