| | | 1 | | <# |
| | | 2 | | .SYNOPSIS |
| | | 3 | | Clears any Kestrun environment override for the current PowerShell session. |
| | | 4 | | .DESCRIPTION |
| | | 5 | | Clears any Kestrun environment override for the current PowerShell session. |
| | | 6 | | This reverts Kestrun to use the default environment, which is 'Production' unless |
| | | 7 | | changed by the KESTRUN_ENVIRONMENT environment variable. |
| | | 8 | | .PARAMETER WhatIf |
| | | 9 | | Shows what would happen if the cmdlet runs. The cmdlet is not run. |
| | | 10 | | .PARAMETER Confirm |
| | | 11 | | Prompts you for confirmation before running the cmdlet. |
| | | 12 | | .EXAMPLE |
| | | 13 | | Clear-KrEnvironmentOverride |
| | | 14 | | Clears any Kestrun environment override, reverting to the default environment. |
| | | 15 | | This is useful for resetting the environment after running tests or examples. |
| | | 16 | | #> |
| | | 17 | | function Clear-KrEnvironmentOverride { |
| | | 18 | | [KestrunRuntimeApi('Everywhere')] |
| | | 19 | | [CmdletBinding(SupportsShouldProcess)] |
| | | 20 | | param() |
| | 0 | 21 | | if ($PSCmdlet.ShouldProcess('Kestrun Environment', 'Clear override')) { |
| | 0 | 22 | | [Kestrun.Runtime.EnvironmentHelper]::ClearOverride() |
| | 0 | 23 | | [Kestrun.Runtime.EnvironmentHelper]::Name |
| | | 24 | | } |
| | | 25 | | } |