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
|[PSCustomObject](#pscustomobject): _A simple PSCustomObject by @brettmillerb_|
18
+
|:------------------|
19
+
|[CalculatedProperty](#calculatedproperty): _Create a calculated property for use in a select-object call by @corbob_|
20
20
|[DateTimeWriteVerbose](#datetimewriteverbose): _Write-Verbose with the time and date pre-pended to your message by @ThmsRynr_|
21
+
|[Parameter-Credential](#parameter-credential): _Add a standard credential parameter to your function by @omniomi_|
22
+
|[PSCustomObject](#pscustomobject): _A simple PSCustomObject by @brettmillerb_|
21
23
22
24
## Snippets
23
25
24
-
### PSCustomObject
26
+
### CalculatedProperty
25
27
26
-
A simple PSCustomObject by @brettmillerb. It has 4 properties that you can tab through to quickly fill in.
28
+
Create calculated property for use in Select Statements
27
29
28
30
#### Snippet
29
31
30
32
```json
31
-
"PSCustomObject": {
32
-
"prefix": "PSCustomObject",
33
-
"body": [
34
-
"[PSCustomObject]@{\r",
35
-
"\t${item1} = ${Property1}\r",
36
-
"\t${item2} = ${Property2}\r",
37
-
"\t${item3} = ${Property3}\r",
38
-
"\t${item4} = ${Property4}\r",
39
-
"}"
40
-
],
41
-
"description": "Creates a PSCustomObject"
33
+
"Add Calculated Property": {
34
+
"prefix": "cf",
35
+
"body": [
36
+
"@{'Name' = '$1' ; 'Expression' = {$2}}",
37
+
],
38
+
"description": "Create calculated property for use in Select Statements"
42
39
}
43
40
```
44
41
@@ -58,6 +55,48 @@ Quickly add a `Write-Verbose` with the current date and time inserted before the
58
55
}
59
56
```
60
57
58
+
### Parameter-Credential
59
+
60
+
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
61
+
62
+
#### Snippet
63
+
64
+
```json
65
+
"Parameter-Credential": {
66
+
"prefix": "parameter-credential",
67
+
"body": [
68
+
"# Specifies the user account credentials to use when performing this task.\r",
"description": "Parameter declaration snippet for a Credential parameter."
76
+
}
77
+
```
78
+
79
+
### PSCustomObject
80
+
81
+
A simple PSCustomObject by @brettmillerb. It has 4 properties that you can tab through to quickly fill in.
82
+
83
+
#### Snippet
84
+
85
+
```json
86
+
"PSCustomObject": {
87
+
"prefix": "PSCustomObject",
88
+
"body": [
89
+
"[PSCustomObject]@{\r",
90
+
"\t${item1} = ${Property1}\r",
91
+
"\t${item2} = ${Property2}\r",
92
+
"\t${item3} = ${Property3}\r",
93
+
"\t${item4} = ${Property4}\r",
94
+
"}"
95
+
],
96
+
"description": "Creates a PSCustomObject"
97
+
}
98
+
```
99
+
61
100
## Contributing
62
101
63
102
If you'd like to add a snippet to this list, [open a pull request](https://opensource.guide/how-to-contribute/#opening-a-pull-request) with the following changes:
@@ -80,7 +119,7 @@ An example looks like this (NOTE: all lowercase link):
0 commit comments