This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Verify | |
{ | |
/// <summary> | |
/// Verifies that the fluent assertions in the <paramref name="action" /> are correct. | |
/// </summary> | |
/// <param name="action">An action with one or more fluent assertions</param> | |
public static T That<T>(Action<T> action) | |
{ | |
return ArgumentMatcher.Enqueue(new AssertionMatcher<T>(action)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run as Administrator | |
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) | |
{ | |
# Load mapped network drives and replace with actual UNC path | |
$MappedDrives = @{}; Get-WmiObject win32_logicaldisk -Filter 'drivetype=4' | Foreach { $MappedDrives.($_.deviceID) = $_.ProviderName } | |
$networkFile = Get-Item $PSCommandPath | Select @{n='UncPath'; e= { $_.FullName.Replace( $_.Directory.Root, $MappedDrives.($_.Directory.Root.ToString().SubString(0,2)) +'\') }} | |
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$($networkFile.UncPath)`"" -Verb RunAs | |
exit | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Glass.Mapper.Sc; | |
using Sitecore.Globalization; | |
namespace TranslatePlusModule.Extensions | |
{ | |
public static class SitecoreServiceExtensions | |
{ | |
/// <summary> | |
/// Returns an item with only the shared fields instead of null if the item does not have a version in the current language. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run as Administrator | |
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit } | |
Set-Location $PSScriptRoot | |
# Load configuration XML file. | |
[xml]$config = Get-Content "DatabasesConfig.xml" | |
#Add-Type -AssemblyName "Microsoft.SqlServer.Smo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" | |
#Add-Type -AssemblyName "Microsoft.SqlServer.Smo, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page Language="C#" %> | |
<%@ Import Namespace="Sitecore.Diagnostics" %> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<% | |
var formTemplateId = Sitecore.Data.ID.Parse("{FFB1DA32-2764-47DB-83B0-95B843546A7E}"); | |
// The root item containing your web forms to be fixed | |
var webformsFolder = Sitecore.Configuration.Factory.GetDatabase("master").GetItem("{F1F7AAB6-C8CE-422F-A214-F610C109FA63}"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#@ assembly name="System.Core" #> | |
<#@ assembly name="System.Xml" #> | |
<#@ import namespace="System.Collections.Generic" #> | |
<#@ import namespace="System.IO" #> | |
<#@ import namespace="System.Linq" #> | |
<#@ import namespace="System.Text" #> | |
<#@ import namespace="System.Text.RegularExpressions" #> | |
<#@ import namespace="System.Xml" #> |