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 Get-RoleMemberOf{ | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true, Position=0)] | |
[string]$Identity | |
) | |
$role = Get-Role $Identity | |
return Get-Role -Filter * | Where-Object { $_.IsMember($role,$true,$true) -and $_ -ne $role } | |
} |
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
#https://www.powershellgallery.com/packages/sitecore-automation/1.2.0.0 | |
import-module sitecore-automation | |
$csproj = 'c:\users\documents\visual studio 2017\Projects\My.Sitecore.Solution\My.Web\My.Web.csproj' | |
Clear-CopyLocal -Path $csproj -verbose |
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
$source="C:\inetpub\wwwroot\Sitecore82\Website\bin\*" #path to files | |
Set-ItemProperty -Path $source -Name IsReadOnly -Value $true -Verbose |
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
# Author: Robert Senktas | |
# Description: Export Sitecore dictionary items for selected language. | |
$parentItem = {DC0FC646-AAB3-4D7A-B265-7AC5CDC73905} | |
$dialog = Read-Variable -Parameters ` | |
@{ Name = "language"; Title = "Language"; Source="DataSource=/sitecore/system/Languages" ; Editor="droplist"} ` | |
-Description "This script will export Dictionary data into file." ` | |
-Width 800 -Height 600 ` | |
-Title "Simple Dictionary Export Utility" ` |
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
// 1. Use this code only once to store variables | |
Environment.SetEnvironmentVariable("CognitoPoolId", "<tutaj podaj dane>", EnvironmentVariableTarget.User); | |
Environment.SetEnvironmentVariable("CognitoClientId", "<tutaj podaj dane>", EnvironmentVariableTarget.User); | |
// 2. Next we can read back our settings from environement variables: | |
var poolId = Environment.GetEnvironmentVariable("CognitoPoolId",EnvironmentVariableTarget.User); | |
var clientId = Environment.GetEnvironmentVariable("CognitoClientId", EnvironmentVariableTarget.User); | |
// 3. The final check - HttpStatusCode == "OK" means success :) | |
using (var client = new AmazonCognitoIdentityProviderClient()) |
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
$dialog = Read-Variable -Parameters ` | |
@{ Name = "dictionaryDomain"; Title = "dictionary"; Source="DataSource=/sitecore/content&DatabaseName=master&IncludeTemplatesForDisplay=Dictionary domain" ; Editor="treelist"}, ` | |
@{ Name = "language"; Title = "Language"; Source="DataSource=/sitecore/system/languages" ; Editor="droplist"}, ` | |
@{ Name = "emptyOption"; Value=$true; Title = "Export empty items" ; Editor="bool"} ` | |
-Description "This script will export Dictionary data into file." ` | |
-Width 400 -Height 200 ` | |
-Title "Dictionary Toolbox" ` | |
-OkButtonName "Export" ` | |
-CancelButtonName "Cancel" |
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
# This script will set up (and install if needed) Apache Solr for a Sitecore instance. | |
# This does NOT configure Sitecore to use Solr, | |
# just the Solr server and cores for Sitecore to connect to once it is set up to use Solr. | |
# So, what does it do? | |
# | |
# * Installs SOLR, if needed, from the Bitnami SOLR stack: https://bitnami.com/stack/solr/installer | |
# * Creates a SOLR config set for the cores to share (shared schema) | |
# * Creates SOLR cores for all Sitecore indexes, including secondary cores to support online reindexing (Switch on Rebuild) |
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
# See also: http://lets-share.senktas.net/2017/06/powershell-simple-credentials-store.html | |
# See also: https://www.powershellgallery.com/packages/sitecore-automation/1.3.0.0 | |
# Uncomment two below lines for a first use | |
#Install-Module Sitecore-Automation -Force -Verbose | |
#Import-Module Sitecore-Automation -Force -Verbose | |
# Create a new credentials | |
New-StoredCredential -Key "SMTP-Server" -Username "SMTP-User" -Password ( "password" | ConvertTo-SecureString -AsPlainText -Force) | |
New-StoredCredential -Key "SQL-Server" -Username "SQL-User" -Password ( "password" | ConvertTo-SecureString -AsPlainText -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
# ############################################################################# | |
# Login to Azure | |
# | |
# AUTHOR: Robert Senktas | |
# BLOG: http://lets-share.senktas.net/2017/06/sitecore-on-azure-login.html | |
# | |
# COMMENT: | |
# ############################################################################# | |
#Requires –Modules sitecore-automation |
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
#Requires -Modules Azure | |
# ############################################################################# | |
# Get SAS tokents | |
# | |
# AUTHOR: Robert Senktas | |
# BLOG: http://lets-share.senktas.net/2017/07/sitecore-on-azure-sas-token.html | |
# | |
# COMMENT: | |
# ############################################################################# |