11BeforeAll {
2+ Remove-Module - Name BOSH.Utils - ErrorAction Ignore
23 Import-Module ./ BOSH.Utils.psm1
34
45 # As of now, this function only supports DWords and Strings.
@@ -303,8 +304,7 @@ Describe "BOSH.Utils" {
303304 }
304305 }
305306
306- # TODO resolve
307- Describe " Disable-DCOM" - Tag ' Focused' {
307+ Describe " Disable-DCOM" {
308308 It " Disables the use of DCOM" {
309309 $DCOMPath = ' HKLM:\Software\Microsoft\OLE'
310310 $oldDCOMValue = (Get-ItemProperty - Path $DCOMPath ).' EnableDCOM'
@@ -379,9 +379,7 @@ Describe "BOSH.Utils" {
379379 $ ( $args [0 ] -join " ," ) -eq $ ( $args [1 ] -join " ," )
380380 }
381381
382- Mock Set-ItemProperty {
383- " Property set"
384- } - ModuleName BOSH.Utils
382+ Mock Set-ItemProperty { " Property set" } - ModuleName BOSH.Utils
385383
386384 { Set-ProxySettings " http-proxy" " https-proxy" " bypass-list" } | Should -Not - Throw
387385
@@ -401,10 +399,7 @@ Describe "BOSH.Utils" {
401399 }
402400
403401 It " exits when the registry can't be set or there's an error because the arguments are wrong" {
404- Mock Set-ItemProperty {
405- Write-Error " Property not set"
406- } - ModuleName BOSH.Utils
407-
402+ Mock Set-ItemProperty { Write-Error " Property not set" } - ModuleName BOSH.Utils
408403
409404 { Set-ProxySettings " http-proxy" " https-proxy" " bypass-list" } | Should - Throw " Failed to set proxy settings: Property not set"
410405 }
@@ -417,9 +412,10 @@ Describe "BOSH.Utils" {
417412
418413 It " Should remove proxy settings if they were set" {
419414 $regKeyConnections = " HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
420- Set-ItemProperty - Path $regKeyConnections - Name " DefaultConnectionSettings" - Value " test-value" - ErrorVariable err 2>&1 | Out-Null
415+ Set-ItemProperty - Path $regKeyConnections - Name " DefaultConnectionSettings" - Value " test-value" - ErrorVariable err
416+ $err | Should - Be $null
421417
422- $set_proxy = & cmd.exe / c " netsh winhttp set proxy proxy-server=`" 127.0.0.1`" "
418+ & cmd.exe / c " netsh winhttp set proxy proxy-server=`" 127.0.0.1`" "
423419
424420 Clear-ProxySettings
425421
0 commit comments