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
# Gets the latest 30 log files, filters only solr query lines from them, groups them by query content and orders by most executed, | |
# Letting you find things that are most effective to cache. | |
Set-HostProperty -HostWidth 2000 | |
$logFileFilter = "azure.log.*" | |
$logfileCountToAnalyse = 30 | |
$minQueryOccurence = 20 | |
Get-ChildItem $SitecoreLogFolder -Recurse -Filter $logFileFilter ` |
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
$CurrentState = $null | |
$NewState = $null | |
Write-Host "Monitoring device changes..." -ForegroundColor Green | |
while ($true) { | |
if (-not($CurrentState)) { | |
$CurrentState = Get-PnpDevice -Status OK | |
} | |
else { | |
$NewState = Get-PnpDevice -Status OK | |
$Changes = $null |
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
$datasource = Get-Item . | |
$referrers = $datasource | Get-ItemReferrer | |
$pageOnlyReferrers = $referrers | Where-Object { $_.Name -ne '__Standard Values' } | Sort-Object -Property Name -Unique | |
$pageOnlyReferrers = $pageOnlyReferrers | Where-Object { $_.Paths.Path -like '/sitecore/content/{site-node}' } | |
if ($pageOnlyReferrers.Count -eq 0) { | |
return; | |
} |
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
{{ | |
# Get all pages that are nested under the root | |
# Check if it has a layout (avoids data source object) | |
# Set flag to true. Show everything if no filter is set. | |
# Get page filters. If a section has filters, set taxonomy flag to false. At least one field must match selected filters. Set to true #if we find a matching field. | |
# If the field parsing remains true after checking each field, add the item to an array. | |
# The array takes the item, and the date field parsed to that the date is a single number, year/month/day. | |
# After all field and array parsing is done, sort the array by date. | |
# Loop through the array and render the items. | |
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
docker image ls --format "{{json .Repository}},{{json .Tag}},{{json .ID}}" | | |
ConvertFrom-Csv -Header "Repository","Tag","Id" | | |
Where-Object { $_.Tag -ne "<none>" -and $_.Repository.Contains("/") } | | |
ForEach-Object { docker pull "$($_.Repository):$($_.Tag)"} |
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
Line 1 - Changed the Import-Function Name to Setup-PackageGeneratorAdvanced | |
Line 5 - Removed as the $path variable was not used | |
Lines 20-22 - Updated to always show the Links tab, which is now a radiobox | |
Line 74 - Replaced by the block from lines 75 to 149 | |
Lines 76 to 87 - Replaced by the block from lines 151 to 162 |
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
//Snippet from Program.cs which adds the provider and sets up a Settings class to map the settings | |
using ErikNoren.Configuration; | |
using TestMvcWebApplication; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Configuration.AddSqlDatabase(config => | |
{ | |
//We can get the connection string from previously added ConfigurationProviders to use in setting this up | |
config.ConnectionString = builder.Configuration.GetConnectionString("DemoDatabase"); |
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
$matchedItems = [System.Collections.ArrayList]@() | |
$revisionFilter = @("9323dec0-9b37-4fae-b87c-2dc12cbea0f2") | |
Get-ChildItem -Path "master:\media library" -Recurse | | |
Where-Object { [string]::IsNullOrEmpty($PSItem["__revision"]) -or $revisionFilter -contains $PSItem["__revision"] } | | |
ForEach-Object { $matchedItems.Add([PSCustomObject]@{"ItemId"=$PSItem.ID; "RevisionId"=$PSItem["__revision"]; "ItemPath"=$PSItem.ItemPath}) > $null } | |
$matchedItems | Show-ListView |
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
# This is a super **SIMPLE** example of how to create a very basic powershell webserver | |
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity. | |
# Http Server | |
$http = [System.Net.HttpListener]::new() | |
# Hostname and port to listen on | |
$http.Prefixes.Add("http://localhost:8080/") | |
# Start the Http Server |
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
param( | |
[Parameter()] | |
[switch]$NoBuild, | |
[Parameter()] | |
[switch]$NoSync, | |
[Parameter()] | |
[string]$CmHost="https://habitatstarterkit.local", | |
[Parameter()] | |
[string]$SolutionName="HabitatStarterKit.sln", | |
[Parameter()] |
NewerOlder