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
<# | |
SYNOPSIS | |
Does a simple count of all items in the specified templates | |
INSTRUCTIONS | |
After Get-Item -Path, type the path of the parent you want to start with. | |
EX: master:\sitecore\content\sites\example | |
Put the same path after Get-ChildItem, which will crawl through and find all child pages. | |
It'll display the number |
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
<# | |
SYNOPSIS | |
Does a simple count of all items in the specified templates | |
INSTRUCTIONS | |
After Get-Item -Path, type the path of the parent you want to start with. | |
EX: master:\sitecore\content\sites\example | |
Put the same path after Get-ChildItem, which will crawl through and find all child pages. | |
#> |
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
gci C:\inetpub\wwwroot\RCN\Data\logs -Recurse -Filter *.txt | where{-not $_.PsIsContainer}| sort CreationTime -desc| select -Skip 0 | Remove-Item -Force |
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
{ | |
"Id": "ActionTemplates-3", | |
"Name": "HTTP - Test URL", | |
"Description": "Makes a GET request to a HTTP(S) end point and verifies that a particular status code is returned within a specified period of time", | |
"ActionType": "Octopus.Script", | |
"Version": 1, | |
"Properties": { | |
"Octopus.Action.Script.ScriptBody": "$uri = $OctopusParameters['Uri']\n$expectedCode = [int] $OctopusParameters['ExpectedCode']\n$timeoutSeconds = [int] $OctopusParameters['TimeoutSeconds']\n$Username = $OctopusParameters['AuthUsername']\n$Password = $OctopusParameters['AuthPassword']\n$UseWindowsAuth = $OctopusParameters['UseWindowsAuth']\n\nWrite-Host \"Starting verification request to $uri\"\nWrite-Host \"Expecting response code $expectedCode.\"\n\n$timer = [System.Diagnostics.Stopwatch]::StartNew()\n$success = $false\ndo\n{\n try\n {\n if ($Username -and $Password -and $UseWindowsAuth)\n\t\t\t{\n\t\t\t Write-Host \"Making request to $uri using windows authentication for user $Username\"\n\t\t\t $request = [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
$SourceDirectoryName = $OctopusParameters['SourceDirectoryName'] | |
$DestinationArchiveFileName = $OctopusParameters['DestinationArchiveFileName'] | |
$CompressionLevel = $OctopusParameters['CompressionLevel'] | |
$IncludeBaseDirectory = $OctopusParameters['IncludeBaseDirectory'] | |
$OverwriteDestination = $OctopusParameters['OverwriteDestination'] | |
if (!$SourceDirectoryName) | |
{ | |
Write-Error "No Source Directory name was specified. Please specify the name of the directory to that will be zipped." | |
exit -2 |
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
$_BaseTitleTemplate = Get-Item 'master:/sitecore/templates/User Defined/RCN/Base/_Base Title' | |
New-UsingBlock (New-Object Sitecore.Data.BulkUpdateContext) { | |
foreach($item in Get-ChildItem -Path "master:\content\" -recurse) { | |
if (![string]::ISNullOrEmpty($item."Title")) | |
{ | |
$itemTemplate = Get-ItemTemplate -Item $item | |
foreach($baseTemplate in $itemTemplate.BaseTemplates) { | |
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
Write-Host "Stopping AppPool" | |
Stop-WebAppPool -Name AppPool | |
Write-Host "Starting AppPool" | |
Start-WebAppPool -Name AppPool |
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
/****** History ******/ | |
delete FROM [YOURDATABASE_Core].[dbo].[History] where Created < DATEADD(HOUR, -12, GETDATE()) | |
delete FROM [YOURDATABASE_Master].[dbo].[History] where Created < DATEADD(HOUR, -12, GETDATE()) | |
delete FROM [YOURDATABASE_Web].[dbo].[History] where Created < DATEADD(HOUR, -12, GETDATE()) | |
/****** Publishqueue ******/ | |
delete FROM [YOURDATABASE_Core].[dbo].[PublishQueue] where Date < DATEADD(HOUR, -12, GETDATE()); | |
delete FROM [YOURDATABASE_Master].[dbo].[PublishQueue] where Date < DATEADD(HOUR, -12, GETDATE()); | |
delete FROM [YOURDATABASE_Web].[dbo].[PublishQueue] where Date < DATEADD(HOUR, -12, GETDATE()); | |
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
{ | |
"Id": "ActionTemplates-23", | |
"Name": "Move Unicorn files out of webroot", | |
"Description": "Moves Unicorn yml files from Website folder to Data folder after nuget deploy", | |
"ActionType": "Octopus.Script", | |
"Version": 21, | |
"Properties": { | |
"Octopus.Action.Package.NuGetFeedId": "feeds-builtin", | |
"Octopus.Action.Script.Syntax": "PowerShell", | |
"Octopus.Action.Script.ScriptSource": "Inline", |
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
{ | |
"Id": "ActionTemplates-22", | |
"Name": "Unicorn Sync over https", | |
"Description": "Calls the unicorn sync over https using TLS1.2", | |
"ActionType": "Octopus.Script", | |
"Version": 8, | |
"Properties": { | |
"Octopus.Action.Script.Syntax": "PowerShell", | |
"Octopus.Action.Script.ScriptBody": "$ErrorActionPreference = 'Stop'\r\n\r\nAdd-Type -Path \"${MicroChap}\\MicroCHAP.dll\"\r\n\r\n\r\nAdd-Type @\"\r\n using System.Net;\r\n using System.Security.Cryptography.X509Certificates;\r\n public class TrustAllCertsPolicy : ICertificatePolicy {\r\n public bool CheckValidationResult(\r\n ServicePoint srvPoint, X509Certificate certificate,\r\n WebRequest request, int certificateProblem) {\r\n return true;\r\n }\r\n }\r\n\"@\r\n[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy\r\n\r\nFunction Sync-Unicorn {\r\n\tParam(\r\n\t\t[Parameter(Mandatory=$True)]\r\n\t\t[string]$ControlPanelUrl,\r\n\r\n\t\t[Parameter(Mandatory=$True)]\ |