Skip to content

Instantly share code, notes, and snippets.

View coreyasmith's full-sized avatar
🌏
Where do you want to go today?

Corey Smith coreyasmith

🌏
Where do you want to go today?
View GitHub Profile
@coreyasmith
coreyasmith / Create-JSSContentDeliveryWdp.ps1
Last active November 13, 2019 10:44
PowerShell snippet and ARM templates for deploying Sitecore modules to XP Scaled environments.
# Make sure to import `Sitecore.Cloud.Cmdlets.dll` and not `Sitecore.Cloud.Cmdlets.psm1`
Import-Module C:\Sitecore\sat\tools\Sitecore.Cloud.Cmdlets.dll
$packagePath = "C:\Sitecore\Packages"
Remove-SCDatabaseOperations `
-Path "$packagePath\Sitecore JavaScript Services Tech Preview Server 9.0.1 rev. 180724.scwdp.zip" `
-Destination $packagePath `
-Verbose `
-Force
@coreyasmith
coreyasmith / New-TrustedSelfSignedCertificate.ps1
Last active January 29, 2023 13:31
Create a trusted, self-signed certificate with PowerShell. Inspiration comes from Dominick Baier's (@leastprivilege) "Web API v2 Security" course on Pluralsight: https://www.pluralsight.com/courses/webapi-v2-security.
Param(
[Parameter(Mandatory=$true)]
[string[]]$DnsName,
[DateTime]$CertExpirationDate = (Get-Date).AddYears(5),
[string]$PersonalCertStoreLocation = "Cert:\LocalMachine\My",
[string]$HashAlgorithm = "SHA512",
[string]$RootCertSubject = "CN=DevRoot",
[string]$RootCertStoreLocation = "Cert:\LocalMachine\Root",
[DateTime]$RootCertExpirationDate = (Get-Date).AddYears(20)
)
@coreyasmith
coreyasmith / CreateContributorPrincipal.ps1
Last active March 1, 2020 15:46
PowerShell script to create Service Principal with Contributor role in Azure Active Directory
param
(
[Parameter(Mandatory=$true, HelpMessage="Enter Azure Tenant Domain")]
[string] $tenant,
[Parameter(Mandatory=$true, HelpMessage="Enter Azure Subscription ID")]
[string] $subscriptionId,
[Parameter(Mandatory=$true, HelpMessage="Provide a unique display name for SPN application")]
[string] $appDisplayName,