Silent IIS UrlRewrite, ARR and FARM provisioning by #PowerShell

Recently, I had the task to run several fitnesse instances in on the single AWS EC2 instance. The requirement was what each fitnesse instance should be accessible trough port 80 (HTTP). IIS as reverse proxy came to the rescue. But there were one more requirement – IIS Reverse Proxy configuration should be automated.

Here >> konstantinvlasenko/IIS Reverse Proxy << you can find a complete PowerShell script how to install IIS and configure it as reverse proxy.


#PowerShell script to wait while any MSI process is running

   $mutex = [System.Threading.Mutex]::OpenExisting('Global\_MSIExecute')
   $mutex = $null
   Sleep 10
   'MSI running...' | Out-Default
 catch [System.Threading.WaitHandleCannotBeOpenedException]
   # Mutex not found; MSI isn't running

Disable the option to check for server certificate revocation on Internet Explorer

We are doing an extensive acceptance testing against SharePoint Online by using PowerSlim (PowerShell).
Unfortunately sometimes our automated tests are blocked by popup below:
As we truly believe that our DNS is not spoiled an we know exactly what we are looking for (pre-created data) – this verification doesn’t make any sense for us.
So we decided to disable it. I was not able to find the solution how to do this trough Windows Registry. Below is how you can do this trough Internet Explorer:

  1. Open Internet Options
  2. Go to Advanced tab
  3. Scroll down to the Security section
  4. Clear check-box below:
  5. Restart Internet Explorer

Enable SQL protocol by using PowerShell

A stand-alone installation of SharePoint usually utilizes SQL Server Express. The instance name is SHAREPOINT. (This is true for SharePoint 2013). You must enable TCP protocol to access the SharePoint back-end.

PS> function EnableSQLProtocol($instance, $proto)
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | out-null
$smo = 'Microsoft.SqlServer.Management.Smo.'
$wmi = new-object ($smo + 'Wmi.ManagedComputer').
$uri = "ManagedComputer[@Name='$(hostname)']/ServerInstance[@Name='$instance']/ServerProtocol[@Name='$proto']"
$p = $wmi.GetSmoObject($uri)
$p.IsEnabled = $true

PS> 'Tcp','Np' | % {EnableSQLProtocol SHAREPOINT $_}

PowerSlim vs Fitnesse vs SpecFlow

PowerSlim Fitnesse (SLIM) SpecFlow
Web Access GreenCheck_16 GreenCheck_16 Delete_16x16
Test In/Out WYSIWYG WYSIWYG Gherkin scripts are used to generate test fixtures. Actual test results you can view by using Visual Studio Test View interface.
Verification Code Verification done by framework itself. You just need to provide the results. Verification done by framework itself. You just need to provide the results. You need to duplicate your specification statements again for underlying testing framework (MSTest, NUnit)
Built in Fixtures GreenCheck_16 Delete_16x16 Delete_16x16
Visual Studio Integration GreenCheck_16
Force HLT GreenCheck_16 Delete_16x16 Delete_16x16

Test In/Out





Verification Code

SpecFlow – check CompareToInstance or CompareToSet examples.

Fitnesse – check method query(). It just returns the results. There are no comparisons/expectations/asserts. Finesse does it for you because of  In/Out (see above).

Built in Fixtures

  •  Built in possibility to call product through public interface
  •  Built in possibility to see results of such a call

PowerSlim already implemented Fitnesse fixtures (Script, X Query, Scenario, Decision ) for you. So you don’t need to write any test classes to make a glue between your test and production (SUT). All you need is to find a way how to setup testing environment or to call your production through a public interface (command line, PowerShell CMDLets, REST, HTTP).   PowerSlim will send the results back to Fitnesse by using SLIM protocol. And the good things is that Fitnesse by himself is responsible for different type of verifications (see Verification Code above).

Example: get-service is all what you need to put in your test to get the idea about the state of a particular service.

Subset Query:Local get-service
ServiceName Status DisplayName

Visual Studio Integration

I really want to put something for SpecFlow. They did the great job by integrating with Visual Studio 😉


The requirement to test/call your product through a public interface is still the #1, even if I don’t completely agree with myself back to 2010 It is not an Acceptance Tests if you need to mock part of your product. Probably this one is not a bad unit test (Stop Mocking, Start Testing)