anchor.diff:  @@if defined POWERSHELL_BAT_ARGS set POWERSHELL_BAT_ARGS=%POWERSHELL_BAT_ARGS:"=\"%
   @@powershell.exe -Command Invoke-Expression $('$args=@(^&{$args} %POWERSHELL_BAT_ARGS%);'+[String]::Join([char]10, $((Get-Content '%~f0') -notmatch '^^@@'))) & goto :EOF
   
  +
  +$ProjectConsole = 1;
  +$ProjectLibrary = 2;
  +$ProjectUnitTest = 3;
  +
   Function Main($rootPath, $name)
   {
       $fullPath = "$rootPath\$name";
  
positive.code: 
  "@;
      $projectsText = "";
      $globalSectionText = @"
  Global
  	GlobalSection(SolutionConfigurationPlatforms) = preSolution
  		Debug|Any CPU = Debug|Any CPU
  
negative.code:             $parentDir.Create();
          }
  
          GetProjectText $solutionName $project | Out-File $file.FullName -Encoding "UTF8";
      }
  }
  
  Function GetProjectText($solutionName, $project)
  {
      $id = $project.Id;
      $name = $project.Name;
      $afterHeaderText = "";
      $fileToInclude = $project.FileToInclude;
      $filesText = "";
      if ($project.ProjectType -eq $ProjectConsole)
      {
          $outputType = "Exe";
          $rootNamespace = $solutionName;
          $afterHeaderText +=
  @'
      <PlatformTarget>AnyCPU</PlatformTarget>
      <Prefer32Bit>false</Prefer32Bit>
  
  '@;
      }
      elseif ($project.ProjectType -eq $ProjectLibrary)
      {
          $outputType = "Library";
          $rootNamespace = $solutionName;
      }
      else
      {
          $outputType = "Library";
          $rootNamespace = "$solutionName.Test.Unit";
      }
  
      $headerText =
  @'
  <?xml version="1.0" encoding="utf-8"?>
  <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
    <PropertyGroup>
      <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
      <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
  '@;
      $headerText +=
  @"
      <ProjectGuid>$id</ProjectGuid>
      <OutputType>$outputType</OutputType>
      <RootNamespace>$rootNamespace</RootNamespace>
      <AssemblyName>$name</AssemblyName>
  
  "@;
  
      $headerText +=
  @'
      <AppDesignerFolder>Properties</AppDesignerFolder>
      <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
      <FileAlignment>512</FileAlignment>
      <OutputPath>..\..\bin\$(Configuration)\</OutputPath>
      <ErrorReport>prompt</ErrorReport>
      <WarningLevel>4</WarningLevel>
      <StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
  
  '@;
  
      $afterHeaderText +=
  @'
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
      <DebugSymbols>true</DebugSymbols>
      <DebugType>full</DebugType>
      <Optimize>false</Optimize>
      <DefineConstants>DEBUG;TRACE</DefineConstants>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
      <DebugType>pdbonly</DebugType>
      <Optimize>true</Optimize>
      <DefineConstants>TRACE</DefineConstants>
    </PropertyGroup>
    <ItemGroup>
      <Reference Include="System" />
      <Reference Include="System.Core" />
    </ItemGroup>
    <ItemGroup>
      <Compile Include="Properties\AssemblyInfo.cs" />
  
  '@;
  
      $filesText =
  @"
      <Compile Include="$fileToInclude" />
    </ItemGroup>
  
  "@;
  
      $projectReferencesText = "";
      if ($project.ProjectReferences.Length -gt 0)
      {
          $projectReferencesText += @'
    <ItemGroup>
  
  '@;
          foreach ($refProject in $project.ProjectReferences)
          {
              $includePath = GetIncludePath $project.Path $refProject.Path;
              $refName = $refProject.Name;
              $refId = $refProject.Id;
              $projectReferencesText +=
  @"
      <ProjectReference Include="$includePath">
        <Project>$refId</Project>
        <Name>$refName</Name>
      </ProjectReference>
  
  "@;
          }
  
          $projectReferencesText += @'
    </ItemGroup>
  
  '@;
      }
  
      $footerText =
  @'
    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    <Import Project="$(MSBuildExtensionsPath)\StyleCop\v4.7\StyleCop.Targets" />
  </Project>
  '@;
  
      $text = $headerText + $afterHeaderText + $filesText + $projectReferencesText + $footerText;
      $text = $text -Replace "`n", "`r`n";
      return $text;
  }
  
  Function GetIncludePath($source, $dest)
  {
      $tree = @{};
      $current = $tree;
      $depth = 0;
      foreach ($part in $source.Split('\'))
      {
          $current[$part] = @{};
          $current = $current[$part];
          ++$depth;
      }
  
      $current = $tree;
      $includePathParts = @();
      $stillMatches = $true;
      foreach ($part in $dest.Split('\'))
      {
          if ($stillMatches)
          {
              if ($current.ContainsKey($part))
              {
                  --$depth;
                  $current = $current[$part];
              }
              else
              {
                  $stillMatches = $false;
                  for ($i = 1; $i -lt $depth; ++$i)
                  {
                      $includePathParts += "..";
                  }
              }
          }
  
          if (!$stillMatches)
          {
              $includePathParts += $part;
          }
      }
  
      return [string]::Join('\', $includePathParts);
  }
  
  Function WriteSolutionFile($fullPath, [psobject[]]$projects)
  {
      Write-Host "Writing solution file '$fullPath'...";
      $headerText =
  @"
  
  Microsoft Visual Studio Solution File, Format Version 12.00
  # Visual Studio Express 2013 for Windows Desktop
  