This file contains hidden or 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
<# | |
Basic tasks for SharePoint. These wrap many powershell commandlets which littles bits and pieces that actually work. They | |
are particularly designed for reuse with psake scripts. Belows is a sample psake script for deploying a sharepoint. | |
For building and package see: . .\scripts\build-tasks.ps1 # see gist: https://gist.github.com/1108813 | |
$framework = '3.5x64' | |
. .\scripts\sharepoint-tasks.ps1 | |
Properties { |
This file contains hidden or 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
<# | |
Basic migration tasks for SharePoint. | |
$framework = '3.5x64' | |
. .\scripts\migrations-tasks.ps1 | |
Properties { | |
$application = "http://mysites" | |
$migrationsAssembly = "$base_dir\lib\migratordotnet\Infrastructure.dll" | |
$to = -1 |
This file contains hidden or 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
<# | |
Usage for Gallio tests: | |
Task Test-System -Description "Runs the system tests via Gallio" { | |
Test-Gallio $proj $configuration $platform $dll "system" "Test.System" | |
# Test-Gallio ".\src\Test.Unit\Test.Unit.csproj" Release x64 ".\src\Test.Unit\bin\Release\x64\Test.Unit.dll" "unit" | |
} | |
} | |
#> |
This file contains hidden or 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
<# | |
Basic build tasks for SharePoint (or other projects) - using 7zip and GacUtil | |
$framework = '4.0x64' | |
. .\scripts\build-tasks.ps1 | |
properties { | |
$project = "Sites" | |
This file contains hidden or 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
@echo off | |
path = %path%;%WINDIR%\Microsoft.NET\Framework\v4.0.30319\ | |
powershell -ExecutionPolicy Unrestricted -NoExit -Command " &{import-module .\scripts\psake.psm1; Invoke-Psake -docs}" |
This file contains hidden or 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
@echo off | |
echo. | |
echo Running as: | |
whoami | |
echo. | |
set application=%1 | |
if NOT '%application%'=='' GOTO :environmentcheck |
This file contains hidden or 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
Properties { | |
$site_owner = "domain\serviceaccount" | |
$ca_port = 3456 | |
} | |
Task AdminUser-Setup -Depends Solution-Setup -Description "Sets the current user as a farm admin on current computer" { | |
Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction "SilentlyContinue" | |
$whoami = [Security.Principal.WindowsIdentity]::GetCurrent().Name | |
Write-Host "You are logged in as $whoami" | |
This file contains hidden or 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
Task Db-Setup -Description "Adds the current user for access to SharePoint schemas - DEV only" { | |
$userToAdd = Read-Host -Prompt 'User to add to Farm Admin group <DOMAIN>\<USERNAME>' | |
$db_env = Read-Host -Prompt 'Environment suffix of the database to setup' | |
Write-Host "If this script has a problem then you don't have login access - please sort this out first" | |
Write-Host "see http://www.sharepointassist.com/2010/01/29/the-local-farm-is-not-accessible-cmdlets-with-featuredependencyid-are-not-registered/" | |
$whoami = [Environment]::UserName | |
Write-Host "Adding dev user to database: $whoami" | |
Write-Host "Enter the password for the user $site_owner" | |
exec { sqlcmd -i .\dev-powershell-access.sql -U $whoami -v user=$userToAdd -v db_env=$db_env } |
This file contains hidden or 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
Property { | |
$domain = "" | |
} | |
Task Hostfile-Update -Description "Add new sites to the host file" { | |
$host_file = "$env:windir\System32\drivers\etc\hosts" | |
if ((Get-Content $host_file | ForEach-Object{$_ -eq "127.0.0.1 $domain "}) -notcontains "True") | |
{ | |
Add-Content $host_file "`n127.0.0.1 $domain " | |
} |
This file contains hidden or 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
/** | |
* @license Copyright (c) 2012, toddb GoneOpen Limited. | |
* Available via the MIT or new BSD license. | |
* based on https://gist.github.com/966776 (mathieul) and forked to https://gist.github.com/1474205 | |
* jasmine.requirejs() returns a function that will load the file(s) required | |
* and will wait until it's done before proceeding with running specs. | |
* The function returned is intended to be passed to beforeEach() so the file(s) | |
* is(are) loaded before running each spec. | |
* |
OlderNewer