To install the prompt, run the following PowerShell command:
iex (New-Object Net.Webclient).DownloadString('https://gist.github.com/nzbart/5481021/raw/3-Installer.ps1')
That's it.
Add-Type -TypeDefinition @" | |
[System.FlagsAttribute] | |
public enum PipelineStateFlags | |
{ | |
Unknown = 0, | |
BeginRequest = 1, | |
AuthenticateRequest = 2, | |
AuthorizeRequest = 4, | |
ResolveRequestCache = 8, | |
MapRequestHandler = 16, |
function CreateFolderWithPermissions($folder, $aclRules) | |
{ | |
if(-not (test-path $folder)) { | |
Write-Host "Creating $folder..." | |
md $folder | out-null | |
} | |
Write-Host "Setting permissions on $folder..." | |
$domain = [environment]::userdomainname | |
$acl = new-object System.Security.AccessControl.DirectorySecurity |
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Reflection; | |
namespace ConsoleApplication6 | |
{ | |
class Program | |
{ | |
static void Main() |
/* | |
* This code is a workaround for the fact that session state in ASP.NET SqlServer mode is isolated by application. The AppDomain's appId is used to | |
* segregate applications, and there is no official way exposed to modify this behaviour. | |
* | |
* Some workarounds tackle the problem by modifying the ASP.NET state database. This workaround approaches the problem from the application code | |
* and will be appropriate for those who do not want to alter the database. We are using it during a migration process from old to new technology stacks, | |
* where we want the transition between the two sites to be seamless. | |
* | |
* As always, when relying on implementation details, the reflection based approach used here may break in future / past versions of the .NET framework. | |
* Test thoroughly. |
/* | |
* Recommended usage is to pipe in a list of paths : | |
* Git: | |
* git ls-files | FindBinaryFiles.exe | |
* PowerShell: | |
* ls -r | ? PSIsContainer | select -expand FullName | FindBinaryFiles.exe | |
* */ | |
using System; | |
using System.Collections.Generic; |
#include <SDKDDKVer.h> | |
#include <tchar.h> | |
#include <Windows.h> | |
#include <WinCred.h> | |
#include <Userenv.h> | |
#include <atlsecurity.h> | |
#include <Lmcons.h> | |
#include <iostream> |
$ourContent = ls $PSScriptRoot\MyCode -r -fi *.scss | cat | |
$vars = $ourContent | % { | |
if($_ -match '^\s*\$([a-zA-Z_-]+)\s*:') { | |
$Matches[1] | |
} | |
} | select -Unique | |
$allContent = ls $PSScriptRoot -r -fi *.scss | cat | |
$vars | ? { | |
$search = "\`$$_[^:]*$" |
param([string][parameter(mandatory)]$ParentFile, [string][parameter(mandatory)]$RootFile, [int][parameter(mandatory)]$Depth, [string][parameter(mandatory)]$IncludePath, [switch]$RenderDotFormat, [switch]$DoNotRecurse) | |
function RenderImports([string][parameter(mandatory)]$ParentFile, [string][parameter(mandatory)]$RootFile, [int][parameter(mandatory)]$Depth, [string][parameter(mandatory)]$IncludePath, [switch]$RenderDotFormat, [switch]$DoNotRecurse) | |
{ | |
$ErrorActionPreference = 'Stop' | |
function GetRelativePath([string][parameter(mandatory)]$ParentFile, [string][parameter(mandatory)]$RootFile) | |
{ | |
pushd (Split-Path -Parent $ParentFile) | |
try { |
$vhd = ls *.vhd | select -ExpandProperty Name | |
if(!$vhd -or $vhd.GetType().FullName -ne 'System.String') { | |
throw "Expected to find the VHD in the current directory." | |
} | |
$vmName = [System.IO.Path]::GetFileNameWithoutExtension($vhd) | |
Write-Host "Creating VM called $vmName..." | |
$newVm = New-VM -Name $vmName -MemoryStartupBytes 1024MB -SwitchName External -VHDPath (Resolve-Path $vhd) -Path . -Generation 1 -BootDevice IDE | |
$newVm | Set-VMProcessor -Count 2 |