Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adoprog/Sitecore-PowerCore
Helper cmdlets which can be used to create simple Sitecore website deployment script in something like 50 lines of code.
https://github.com/adoprog/Sitecore-PowerCore
Last synced: 3 months ago
JSON representation
Helper cmdlets which can be used to create simple Sitecore website deployment script in something like 50 lines of code.
- Host: GitHub
- URL: https://github.com/adoprog/Sitecore-PowerCore
- Owner: adoprog
- License: mit
- Created: 2013-01-03T16:53:34.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-30T08:22:45.000Z (about 9 years ago)
- Last Synced: 2024-01-18T11:00:35.857Z (6 months ago)
- Language: PowerShell
- Homepage: sitecoresnippets.blogspot.com
- Size: 984 KB
- Stars: 52
- Watchers: 9
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Lists
- awesome-sitecore - Sitecore PowerCore - Helper cmdlets which can be used to create simple Sitecore website deployment script in something like 50 lines of code. (Utilities / CDN)
README
Sitecore PowerShell Deployment Framework
==================Helper modules which can be used to create simple Sitecore website deployment script in something like 50 lines of code.
**DBUtils.psm1**
Basic DB operations - backup / restore / execute, etc.
* Create-Database
* Restore-Database
* Backup-Database
* Attach-Database
* Execute-File**FileUtils.psm1**
Used to download / extract / package files, etc.
* Download-File
* Extract-Package
* Set-Permissions
* Unzip-Archive
* Add-HostFileContent**ConfigUtils.psm1**
All about editing .config files - web.config, include files, ConnectionStrings.config
* Uncomment-ConfigSection
* Set-ConnectionString
* Set-SitecoreSetting
* Set-ConfigAttribute
* Set-ExecutionTimeoutand many other cmdlets
**IISUtils.psm1**
Used to create Sites / AppPools in IIS
* Create-AppPool
* Create-Site**SvnUtils.psm1**
Contains single commandlet which will Checkout / Revert / Update folder from specified SVN repository. It can be split into a few different ones, I plan to do it in future.
**WebUtils.psm1**
Includes single commandlet for invoking a web page
**Deployment script example**
```powershell
Clear-Host# Framework initialization
$scriptRoot = Split-Path (Resolve-Path $myInvocation.MyCommand.Path)
$env:PSModulePath = $env:PSModulePath + ";$scriptRoot\Framework"Import-Module WebUtils
Import-Module ConfigUtils
Import-Module DBUtils
Import-Module IISUtils
Import-Module FileUtils# Main variables
$siteName = "PowerCoreSample"
$licensePath = "C:\license.xml"
$sourcePath = "C:\Sitecore 6.5.0 rev. 120706.zip"
$targetFolder = "E:\inetpub\wwwroot"# Additional variables
$packageFileName = [System.IO.Path]::GetFileNameWithoutExtension($sourcePath)
$dataFolder = "$destination\$packageFileName\Data"
$websiteFolder = "$destination\$packageFileName\Website"
$serverName = $env:COMPUTERNAME
$sqlServerName = "$serverName\SQLEXPRESS"# Main Script
Unzip-Archive $sourcePath $targetFolder$server = New-Object ("Microsoft.SqlServer.Management.Smo.Server") $sqlServerName
$databases = "core", "master", "web"
foreach ($db in $databases)
{
Attach-Database $server "$siteName.$db" "$targetFolder\$packageFileName\Databases\Sitecore.$db.mdf" "$destination\$packageFileName\Databases\Sitecore.$db.ldf"
Set-ConnectionString "$websiteFolder\App_Config\ConnectionStrings.config" "$db" "Trusted_Connection=Yes;Data Source=$sqlServerName;Database=$siteName.$db"
}Set-ConfigAttribute "$websiteFolder\web.config" "sitecore/sc.variable[@name='dataFolder']" "value" $dataFolder
Copy-Item $licensePath $dataFolder
Create-AppPool $siteName "v4.0"
Create-Site $siteName "$siteName.local" $targetFolder\$packageFileName
Add-HostFileContent "127.0.0.1" "$siteName.local"```