You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added data table snippet
* added max length of datatable
* spelling
* Added Assertt Mock snippet
* Added Pester Parameter test
* added pester test for mandatory parameter
Takes a datatable object and iterates through it to get the max length of the string columns - useful for data loads into a SQL Server table with fixed column widths by @SQLDBAWithABeard
"description": "Takes a datatable object and iterates through it to get the max length of the string columns - useful for data loads"
161
+
}
162
+
```
163
+
58
164
### Parameter-Credential
59
165
60
166
Add a `-Credential` parameter that supports a PSCredential object in a variable, `-Credential (Get-Credential)`, or `-Credential Username` (will prompt). Includes an empty PSCredential object as the default value but this is the first tabstop so pressing backspace after inserting the snippet removes it. by @omniomi
@@ -76,6 +182,41 @@ Add a `-Credential` parameter that supports a PSCredential object in a variable,
76
182
}
77
183
```
78
184
185
+
### PesterTestForMandatoryParameter
186
+
187
+
Quickly create a Pester Test for existence of a mandatory parameter by @SQLDBAWithABeard
188
+
189
+
#### Snippet
190
+
191
+
```json
192
+
"Pester for Mandatory Pester": {
193
+
"prefix": "mandatoryParamPester",
194
+
"body": [
195
+
"It \"${1:FunctionName} Should have a mandatory parameter ${2:ParameterName}\" {",
196
+
" (Get-Command ${1:FunctionName}).Parameters['${2:ParameterName}'].Attributes.Mandatory | Should -BeTrue",
197
+
"}"
198
+
],
199
+
"description": "Pester Test for Parameter"
200
+
}
201
+
```
202
+
203
+
### PesterTestForParameter
204
+
205
+
Quickly create a Pester Test for existence of a parameter by @SQLDBAWithABeard
206
+
207
+
#### Snippet
208
+
209
+
```json
210
+
"Pester for Parameter": {
211
+
"prefix": "Param Pester",
212
+
"body": [
213
+
"It \"${1:FunctionName} Should have a parameter ${2:ParameterName}\" {",
214
+
" (Get-Command ${1:FunctionName}).Parameters['${2:ParameterName}'].Count | Should -Be 1",
215
+
"}"
216
+
],
217
+
"description": "Pester Test for Parameter"
218
+
}
219
+
```
79
220
### PSCustomObject
80
221
81
222
A simple PSCustomObject by @brettmillerb. It has 4 properties that you can tab through to quickly fill in.
0 commit comments