44// ${workspaceRoot}: the root folder of the team
55// ${file}: the current opened file
66// ${relativeFile}: the current opened file relative to workspaceRoot
7- // ${fileBasename}: the current opened file' s basename
8- // ${fileDirname}: the current opened file' s dirname
9- // ${fileExtname}: the current opened file' s extension
7+ // ${fileBasename}: the current opened file\" s basename
8+ // ${fileDirname}: the current opened file\" s dirname
9+ // ${fileExtname}: the current opened file\" s extension
1010// ${cwd}: the current working directory of the spawned process
1111{
1212 "version" : " 2.0.0" ,
4747 }
4848 }
4949 },
50+ "options" : {
51+ "env" : {
52+ // EDIT THE MODULE NAME FOR YOUR PROJECT
53+ "MODULE_NAME" : " PoshGram"
54+ }
55+ },
5056 "tasks" : [
5157 {
5258 "label" : " PesterTest" ,
5359 "type" : " shell" ,
5460 "problemMatcher" : [
5561 " $pester"
5662 ],
57- "command" : " Invoke-Pester ' ${workspaceFolder}/src/Tests/Unit' -PesterOption @{IncludeVSCodeMarker=$true}" ,
63+ "command" : " Invoke-Pester \" ${workspaceFolder}/src/Tests/Unit\" -PesterOption @{IncludeVSCodeMarker=$true}" ,
5864 },
5965 {
6066 "label" : " ." ,
6167 "type" : " shell" ,
6268 "problemMatcher" : " $msCompile" ,
63- "command" : " $PSVersionTable;Invoke-Build -Task . -File '. /src/PoshGram .build.ps1' " ,
69+ "command" : " $PSVersionTable;Invoke-Build -Task . -File ${workspaceFolder} /src//$env:MODULE_NAME .build.ps1\" " ,
6470 "group" : {
6571 "kind" : " build" ,
6672 "isDefault" : true
7076 "label" : " TestLocal" ,
7177 "type" : " shell" ,
7278 "problemMatcher" : " $msCompile" ,
73- "command" : " Invoke-Build -Task TestLocal -File '. /src/PoshGram .build.ps1' "
79+ "command" : " Invoke-Build -Task TestLocal -File \" ${workspaceFolder} /src//$env:MODULE_NAME .build.ps1\" "
7480 },
7581 {
7682 "label" : " HelpLocal" ,
7783 "type" : " shell" ,
7884 "problemMatcher" : " $msCompile" ,
79- "command" : " Invoke-Build -Task HelpLocal -File '. /src/PoshGram .build.ps1' "
85+ "command" : " Invoke-Build -Task HelpLocal -File \" ${workspaceFolder} /src//$env:MODULE_NAME .build.ps1\" "
8086 },
8187 {
8288 "label" : " Clean" ,
8389 "type" : " shell" ,
8490 "problemMatcher" : " $msCompile" ,
85- "command" : " Invoke-Build -Task Clean -File '. /src/PoshGram .build.ps1' "
91+ "command" : " Invoke-Build -Task Clean -File \" ${workspaceFolder} /src/$env:MODULE_NAME .build.ps1"
8692 },
8793 {
8894 "label" : " ValidateRequirements" ,
8995 "type" : " shell" ,
9096 "problemMatcher" : " $msCompile" ,
91- "command" : " Invoke-Build -Task ValidateRequirements -File '. /src/PoshGram .build.ps1' "
97+ "command" : " Invoke-Build -Task ValidateRequirements -File \" ${workspaceFolder} /src//$env:MODULE_NAME .build.ps1\" "
9298 },
9399 {
94100 "label" : " Analyze" ,
95101 "type" : " shell" ,
96102 "problemMatcher" : " $msCompile" ,
97- "command" : " Invoke-Build -Task Analyze -File '. /src/PoshGram .build.ps1' "
103+ "command" : " Invoke-Build -Task Analyze -File \" ${workspaceFolder} /src//$env:MODULE_NAME .build.ps1\" "
98104 },
99105 {
100106 "label" : " AnalyzeTests" ,
101107 "type" : " shell" ,
102108 "problemMatcher" : " $msCompile" ,
103- "command" : " Invoke-Build -Task AnalyzeTests -File '. /src/PoshGram .build.ps1' "
109+ "command" : " Invoke-Build -Task AnalyzeTests -File \" ${workspaceFolder} /src//$env:MODULE_NAME .build.ps1\" "
104110 },
105111 {
106112 "label" : " FormattingCheck" ,
107113 "type" : " shell" ,
108114 "problemMatcher" : " $msCompile" ,
109- "command" : " Invoke-Build -Task FormattingCheck -File '. /src/PoshGram .build.ps1' "
115+ "command" : " Invoke-Build -Task FormattingCheck -File \" ${workspaceFolder} /src//$env:MODULE_NAME .build.ps1\" "
110116 },
111117 {
112118 "label" : " Test" ,
113119 "type" : " shell" ,
114120 "problemMatcher" : " $msCompile" ,
115- "command" : " Invoke-Build -Task Test -File '. /src/PoshGram .build.ps1' "
121+ "command" : " Invoke-Build -Task Test -File \" ${workspaceFolder} /src/$env:MODULE_NAME .build.ps1\" "
116122 },
117123 {
118124 "label" : " DevCC" ,
119125 "type" : " shell" ,
120126 "problemMatcher" : " $msCompile" ,
121- "command" : " Invoke-Build -Task DevCC -File '. /src/PoshGram .build.ps1' "
127+ "command" : " Invoke-Build -Task DevCC -File \" ${workspaceFolder} /src//$env:MODULE_NAME .build.ps1\" "
122128 },
123129 {
124130 "label" : " Build" ,
125131 "type" : " shell" ,
126132 "problemMatcher" : " $msCompile" ,
127- "command" : " Invoke-Build -Task Build -File './src/PoshGram.build.ps1'"
133+ "command" : " Invoke-Build -Task Build -File \" ${workspaceFolder}/src//$env:MODULE_NAME.build.ps1\" "
134+ },
135+ {
136+ "label" : " BuildNoInfra" ,
137+ "type" : " shell" ,
138+ "problemMatcher" : " $msCompile" ,
139+ "command" : " Invoke-Build -Task BuildNoInfra -File \" ${workspaceFolder}/src//$env:MODULE_NAME.build.ps1\" "
128140 },
129141 {
130142 "label" : " InfraTest" ,
131143 "type" : " shell" ,
132144 "problemMatcher" : " $msCompile" ,
133- "command" : " Invoke-Build -Task InfraTest -File './src/PoshGram.build.ps1'"
145+ "command" : " Invoke-Build -Task InfraTest -File \" ${workspaceFolder}/src//$env:MODULE_NAME.build.ps1\" "
146+ },
147+ {
148+ "label" : " Pester-Single-Coverage" ,
149+ "type" : " shell" ,
150+ "command" : " Import-Module -Name \" ${workspaceFolder}\\ src\\ $env:MODULE_NAME\\ $env:MODULE_NAME.psm1\" ;Invoke-Pester \" ${workspaceFolder}\\ src\\ Tests\\ Unit\\ ${input:functionName}.Tests.ps1\" -CodeCoverage \" ${workspaceFolder}\\ src\\ $env:MODULE_NAME\\ *\\ ${input:functionName}.ps1\" " ,
151+ "problemMatcher" : []
152+ },
153+ {
154+ "label" : " Pester-Single-Detailed" ,
155+ "type" : " shell" ,
156+ "command" : " Import-Module -Name \" ${workspaceFolder}\\ src\\ $env:MODULE_NAME\\ $env:MODULE_NAME.psm1\" ;Invoke-Pester \" ${workspaceFolder}\\ src\\ Tests\\ Unit\\ ${input:functionName}.Tests.ps1\" -Output Detailed" ,
157+ "problemMatcher" : []
158+ },
159+ {
160+ "label" : " DevCC-Single" ,
161+ "type" : " shell" ,
162+ "problemMatcher" : " $msCompile" ,
163+ "command" : " Import-Module -Name \" ${workspaceFolder}\\ src\\ $env:MODULE_NAME\\ $env:MODULE_NAME.psm1\" ;Invoke-Pester \" ${workspaceFolder}\\ src\\ Tests\\ Unit\\ ${input:functionName}.Tests.ps1\" -CodeCoverage \" ${workspaceFolder}\\ src\\ $env:MODULE_NAME\\ *\\ ${input:functionName}.ps1\" -CodeCoverageOutputFile \" ${workspaceFolder}\\ cov.xml\" "
164+ }
165+ ],
166+ "inputs" : [
167+ {
168+ "type" : " promptString" ,
169+ "id" : " functionName" ,
170+ "description" : " Name of PowerShell function you want to test"
134171 }
135172 ]
136173}
0 commit comments