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
$oldSuffix = "old-domain.com" | |
$newSuffix = "new-domain.com" | |
Get-MsolUser | | |
Where-Object { $_.UserPrincipalName.EndsWith($oldSuffix) } | | |
ForEach-Object { | |
Set-MsolUserPrincipalName -ObjectId $_.ObjectID -NewUserPrincipalName ($_.UserPrincipalName.Replace($oldSuffix, $newSuffix)) | |
} |
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
import { ContactsListComponent } from './contacts-list.component'; | |
import { ContactsDetailComponent } from './contacts-detail.component'; | |
import { WelcomeComponent } from './welcome.component'; | |
export const AppRoutes = [ | |
{ | |
name: "Welcome", | |
description: "Welcome to the Contacts Application.", | |
path: '', | |
showInNav: true, |
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
function Start-ElevatedUACSession { | |
$outputFiles = @{ | |
Standard = [System.IO.Path]::GetTempFileName(); | |
Error = [System.IO.Path]::GetTempFileName(); | |
} | |
$cmd = [string]::Join(" ", $args) | |
Write-Host "Executing Elevated: $cmd" | |
Start-Process powershell -Verb "runAs" -WindowStyle Hidden -Wait -ArgumentList "/Command ""& { $cmd > '$($outputFiles.Standard)' }""" | |
Get-Content $outputFiles.Standard | |
$outputFiles.Values | Remove-Item |
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
copy ..\packages\EntityFramework.6.1.0\tools\migrate.exe .\bin\ | |
cd .\bin | |
migrate {assembly} /startUpConfigurationFile=..\web.config |
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
function prompt() { | |
$prompts = @{ | |
$HOME = "~"; | |
"$HOME\Documents\GitHub" = "~\[github]"; | |
$env:windir = "windir"; | |
} | |
$loc = (Get-Location | Select -ExpandProperty Path) | |
$prompts.GetEnumerator() | ForEach-Object { $loc = $loc.Replace($_.Name, $_.Value) } |
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
$wspFile = "solution.wsp" | |
$outDir = "c:\temp" | |
$farm = Get-SPFarm | |
$wsp = $farm.Solutions.Item($wspFile).SolutionFile | |
$outFile = Join-Path -Path $outDir -ChildPath $wspFile | |
$wsp.SaveAs($outFile) |
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
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) | |
choco install ruby -y | |
choco install ruby2.devkit -y | |
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") | |
$env:Path += ";$env:ChocolateyBinRoot\ruby23\bin" | |
cd "$($env:ChocolateyInstall)\helpers\functions" |
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
<script type="text/javascript"> | |
var clicky_site_ids = clicky_site_ids || []; | |
clicky_site_ids.push({{ include.trackingid }}); | |
(function() { | |
var s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
s.async = true; | |
s.src = '//static.getclicky.com/js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(s); | |
})(); |
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
$outDir = "." | |
@( | |
"http://domain/images/image1.jpg", | |
"http://domain/images/image2.jpg", | |
"http://domain/images/image3.jpg", | |
"http://domain/images/image4.jpg", | |
"http://domain/images/image5.jpg", | |
"http://domain/images/image6.jpg", |
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
$folders = @("_drafts", "_includes", "_layouts", "_posts", "_data") | |
$folders | %{ New-Item -Name $_ -ItemType Directory } | |
$files = @("_config.yml") | |
$files | %{ New-Item -Name $_ -ItemType File } |
NewerOlder