Skip to content

Instantly share code, notes, and snippets.

@achingono
achingono / cloneProdVmToDevSubscription.ps1
Last active January 23, 2024 19:09
Clone production virtual machine to a development subscription
param(
[Parameter(Mandatory = $true)]
[string]$name,
[Parameter(Mandatory = $true)]
[string]$resourceGroup,
[Parameter(Mandatory = $true)]
[string]$subscription,
[Parameter(Mandatory = $true)]
[string]$targetResourceGroup,
[Parameter(Mandatory = $true)]
@achingono
achingono / target.xml
Created November 12, 2018 20:58 — forked from sliekens/target.xml
A list of all <Target /> tags that ship with MSBuild / Visual Studio
C:\Program Files (x86)\MSBuild\12.0\Bin\Microsoft.Common.CurrentVersion.targets
<Target Name="_CheckForInvalidConfigurationAndPlatform"></Target>
<Target Name="Build" Condition=" '$(_InvalidConfigurationWarning)' != 'true' " DependsOnTargets="$(BuildDependsOn)" Returns="$(TargetPath)" />
<Target Name="BeforeBuild" />
<Target Name="AfterBuild" />
<Target Name="CoreBuild" DependsOnTargets="$(CoreBuildDependsOn)"></Target>
<Target Name="Rebuild" Condition=" '$(_InvalidConfigurationWarning)' != 'true' " DependsOnTargets="$(RebuildDependsOn)" Returns="$(TargetPath)" />
<Target Name="BeforeRebuild" />
<Target Name="AfterRebuild" />
<Target Name="BuildGenerateSources" DependsOnTargets="BuildGenerateSourcesTraverse;$(BuildGenerateSourcesAction)" />
@achingono
achingono / UpdateIISBindings.ps1
Last active November 8, 2018 22:48
Update IIS bindings from sitecore SiteDefinitions file using powershell
param(
[Parameter(Position=0,Mandatory=$true)]
[Alias("Site")]
$siteName,
[Parameter(Position=1,Mandatory=$true)]
$domain,
[Parameter(Position=2)]
$configPath = "App_Config\Include\zzz\Project.SiteDefinitions.config"
[Parameter(Position=3)]
$xpath = "/configuration/sitecore/sites/site"
@achingono
achingono / RecursivelyApplyNamespaces.ps1
Last active November 8, 2018 22:48
Apply namespace to multiple C# files and associated aspx files using powershell
param(
[Parameter(Position=0,Mandatory=$true)]
[Alias("Path")]
$rootPath,
[Parameter(Position=1,Mandatory=$true)]
[Alias("Namespace")]
$rootNamespace
)
$namespacePattern = "namespace\s+([^\s]+)"
@achingono
achingono / Dialog.cs
Last active January 4, 2016 17:09
Assert that a Twitter bootstrap dialog is visible after clicking a button
public class Dialog<TModel> : UiComponent<TModel>
where TModel : class, new()
{
private IWebElement Element
{
get
{
return this.Find.Element(By.CssSelector(".dialog.modal"));
}
@achingono
achingono / ToggleCss.html
Created November 26, 2013 16:52
Dynamically Enable/Disable CSS files
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title></title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/Content/Design.css">
<link rel="stylesheet" href="/Content/Print.css" disabled="disabled">
<link rel="stylesheet" href="/Content/Large.css" disabled="disabled">
</head>
@achingono
achingono / DerivingTypes.ps1
Last active December 14, 2015 20:58
T4 Scaffolder using the the module created by @ulfbjo [ http://pastebin.com/rjYdsuD7 ]
[T4Scaffolding.Scaffolder(Description = "Enter a description of Generator here")][CmdletBinding()]
param(
[parameter(Mandatory = $true, Position = 0)][string]$ParentTypeName,
[string]$Project,
[string]$CodeLanguage,
[string[]]$TemplateFolders,
[switch]$Force = $false
)
$parentType = Get-ProjectType $ParentTypeName