I am having difficulty understanding the syntax of yaml. I want to convert the below power shell commands for restoring nuget packages and building visual studio solution to yaml. I am not able to get it correct, pls help.
PowerShell Commnds:
$ProjectPath = "e:\GitExperiment\SGen"
Set-Location $ProjectPath
$MSBuildPath = "C:\Program Files (x86)\Microsoft VisualStudio\2019\BuildTools\MSBuild\Current\Bin"
$NugetExePath = "C:\Program Files (x86)\NuGet\nuget.exe"
& $NugetExePath restore $ProjectPath\SGen.sln
& $MSBuildPath\MSBuild.exe $ProjectPath\SGen.sln /t:Build /p:Configuration=Release /p:TargetFramework=v4.7.2 /p:SkipPostSharp=True /p:RunCodeAnalysis=False
YAML
stages:
- BUILD
- UNITTEST
- DEPLOY
BUILD_RestoreNugetPackages:
script:
- '$ProjectPath = e:\GitExperiment\SGen"'
- 'Set-Location $ProjectPath'
- '$MSBuildPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe"'
- '$NugetExePath = "C:\Program Files (x86)\NuGet\nuget.exe"'
- '"$NugetExePath restore $ProjectPath\SGen.sln"'
stage: BUILD
tags:
- ci
BUILD_SolutionBuild:
script:
- "& $MSBuildPath $ProjectPath\\SGen.sln /t:Build /p:Configuration=Release /p:TargetFramework=v4.7.2 /p:SkipPostSharp=True /p:RunCodeAnalysis=False"
stage: BUILD
tags:
- ci
I tried using quotes and double quotes and escaping characters in yaml. But couldn't get the commands right. Please help.