Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Use 2016 specific CF Features installation
Browse files Browse the repository at this point in the history
- Won't trigger a restart, allowing automation code to manage it's own lifecycle

[#161069056]
  • Loading branch information
bot committed Dec 14, 2018
1 parent 1d05abc commit dd58aa5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions AutomationHelpers.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ Describe "CopyPSModules" {
}

Describe "InstallCFFeatures" {
It "executes the Install-CFFeatures powershell cmdlet" {
Mock Install-CFFeatures { }
It "executes the Install-CFFeatures2016 powershell cmdlet" {
Mock Install-CFFeatures2016 { }
Mock Write-Log { }
Mock Restart-Computer { }

{ InstallCFFeatures } | Should -Not -Throw

Assert-MockCalled Install-CFFeatures -Times 1 -Scope It
Assert-MockCalled Install-CFFeatures2016 -Times 1 -Scope It
Assert-MockCalled Write-Log -Times 1 -Scope It -ParameterFilter { $Message -eq "Successfully installed CF features" }
Assert-MockCalled Restart-Computer -Times 1 -Scope It
}

It "fails gracefully when installing CF Features" {
Mock Install-CFFeatures { throw "Something terrible happened while attempting to install a CF feature" }
Mock Install-CFFeatures2016 { throw "Something terrible happened while attempting to install a CF feature" }
Mock Write-Log { }
Mock Restart-Computer { }

Expand Down
2 changes: 1 addition & 1 deletion AutomationHelpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function InstallCFFeatures
{
try
{
Install-CFFeatures
Install-CFFeatures2016
Write-Log "Successfully installed CF features"
Restart-Computer
}
Expand Down

0 comments on commit dd58aa5

Please sign in to comment.