File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -35,4 +35,4 @@ pub struct DefaultShell {
35
35
pub cmd_option : Option < String > ,
36
36
pub escape_arguments : Option < bool > ,
37
37
pub shell_arguments : Option < Vec < String > > ,
38
- }
38
+ }
Original file line number Diff line number Diff line change @@ -182,4 +182,19 @@ Describe 'Default Shell Configuration Tests' -Skip:(!$IsWindows) {
182
182
$retrievedConfig.shell_arguments | Should - Be $originalConfig.shell_arguments
183
183
}
184
184
}
185
+
186
+ Context ' Set default shell with null value' {
187
+ It ' Should clear existing default shell when set to null' {
188
+ $testShell = " C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
189
+ New-ItemProperty - Path $RegistryPath - Name " DefaultShell" - Value $testShell
190
+
191
+ $inputConfig = @ { shell = $null } | ConvertTo-Json
192
+
193
+ sshdconfig set -- input $inputConfig
194
+ $LASTEXITCODE | Should - Be 0
195
+
196
+ $result = Get-ItemProperty - Path $RegistryPath - Name " DefaultShell" - ErrorAction SilentlyContinue
197
+ $result | Should - BeNullOrEmpty
198
+ }
199
+ }
185
200
}
You can’t perform that action at this time.
0 commit comments