Commit 1baa2f0
authored
🪲 [Fix]: Add
## Description
This pull request introduces a new `-PassThru` parameter to the
`Set-Context` and `Set-ContextVault` functions, allowing users to pass
objects through the pipeline. Corresponding updates have been made to
the logic and tests to support this functionality.
### Enhancements to `Set-Context` and `Set-ContextVault` functions:
* **Added `-PassThru` parameter to `Set-Context`:** This optional
parameter enables the function to return the context object through the
pipeline if specified. (`src/functions/public/Set-Context.ps1`,
[[1]](diffhunk://#diff-d12895be2e58b33d275f1d10ec54bd8ee0b555bef81f53d6e39ca1722ea58f44L70-R74)
[[2]](diffhunk://#diff-d12895be2e58b33d275f1d10ec54bd8ee0b555bef81f53d6e39ca1722ea58f44R126-R129)
* **Modified `Set-ContextVault` calls within `Set-Context`:** Updated to
include the `-PassThru` parameter when invoking `Set-ContextVault`,
ensuring consistent behavior. (`src/functions/public/Set-Context.ps1`,
[src/functions/public/Set-Context.ps1L79-R83](diffhunk://#diff-d12895be2e58b33d275f1d10ec54bd8ee0b555bef81f53d6e39ca1722ea58f44L79-R83))
### Enhancements to `Set-ContextVault` function:
* **Added `-PassThru` parameter to `Set-ContextVault`:** This optional
parameter allows the function to return the created or updated vault
object through the pipeline if specified.
(`src/functions/public/Vault/Set-ContextVault.ps1`,
[[1]](diffhunk://#diff-c61e62f0db098ac07ec081939fe582f191491d491337e1829c95e64ec28e6e8bL28-R32)
[[2]](diffhunk://#diff-c61e62f0db098ac07ec081939fe582f191491d491337e1829c95e64ec28e6e8bR59-R63)
### Test updates:
* **Updated tests for `Set-ContextVault`:** Modified test cases to
include the `-PassThru` parameter, ensuring the returned objects meet
the expected type and content. (`tests/ContextVaults.Tests.ps1`,
[tests/ContextVaults.Tests.ps1L41-R57](diffhunk://#diff-0894d6e7273e8c5b7b17bea72b02ec2ce764fbe3478fd1a83e09b3f4ea3dd636L41-R57))
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] đź“– [Docs]
- [x] 🪲 [Fix]
- [ ] 🩹 [Patch]
- [ ] -PassThru parameter to Set-Context and Set-ContextVault functions for pipeline support (#93)1 parent 818b0e8 commit 1baa2f0
File tree
6 files changed
+34
-14
lines changed- src/functions
- private
- public
- Vault
- tests
6 files changed
+34
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
84 | | - | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| |||
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | | - | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
122 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
48 | | - | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| |||
0 commit comments