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
private void ReadCSVFile(string fileName) | |
{ | |
try | |
{ | |
//file location, better to get it from configuration | |
string fileName = "C:\\temp\\MyProducts.csv"; | |
//create a CSV engine using FileHelpers for your CSV file | |
var engine = new FileHelperEngine(typeof(MyProduct)); | |
//read the CSV file into your object Arrary | |
var products = (MyProduct[])engine.ReadFile(fileName); |
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
private static int CalculateAge(DateTime dateOfBirth) | |
{ | |
int age = 0; | |
age = DateTime.Now.Year - dateOfBirth.Year; | |
if (DateTime.Now.DayOfYear < dateOfBirth.DayOfYear) | |
age = age - 1; | |
return age; | |
} |
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
using (new SecurityDisabler()) | |
{ | |
bool flag; | |
DiffInstaller installer = new DiffInstaller(installationInfo.Action); | |
entries = installer.InstallPackage(installationInfo.Path, installationInfo.Mode, logger, new List<ContingencyEntry>(), "rollbackPackage.rlb", out flag, ref historyPath); | |
} |
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
[WebDeploy]:[Path] C:\Program Files\iis\Microsoft Web Deploy V3\msdeploy.exe | |
Error Code: ERROR_SCRIPTDOM_NEEDED_FOR_SQL_PROVIDER | |
More Information: The SQL provider cannot run because of a missing dependency. Please make sure that Microsoft SQL Server Transact-SQL ScriptDom is installed. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_SCRIPTDOM_NEEDED_FOR_SQL_PROVIDER. | |
********************** | |
Command start time: 20171023170201 | |
********************** | |
PS>TerminatingError(Invoke-CommandTask): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Command C:\Program Files\iis\Microsoft Web Deploy V3\msdeploy.exe returned a non-zero exit code - (-1)" | |
>> TerminatingError(Invoke-CommandTask): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Command C:\Program Files\iis\Microsoft Web Deploy V3\msdeploy.exe returned a non-zero exit code - (-1)" | |
>> TerminatingError(I |
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
#define parameters | |
$prefix = "xp0" | |
$PSScriptRoot = "C:\Resources" | |
$XConnectCollectionService = "$prefix.xconnect" | |
$sitecoreSiteName = "$prefix.sc" | |
$SolrUrl = "https://localhost:8989/solr" | |
$SolrRoot = "C:\data\Solr-6.6.1" | |
$SolrService = "Solr-6.6.1" | |
$SqlServer = "MYCOMPUTERNAME\SQLEXPRESS2016" | |
$SqlAdminUser = "sitecoreUser" |
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
#generate certificate | |
$thumbprint = (New-SelfSignedCertificate ` | |
-Subject "CN=$env:COMPUTERNAME @ Sitecore, Inc." ` | |
-Type SSLServerAuthentication ` | |
-FriendlyName "$env:USERNAME Certificate").Thumbprint | |
#export certificate with password | |
$certificateFilePath = "C:\Temp\$thumbprint.pfx" | |
Export-PfxCertificate ` | |
-cert cert:\LocalMachine\MY\$thumbprint ` | |
-FilePath "$certificateFilePath" ` |
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
New-AzureRmResourceGroupDeployment : 2:34:31 PM - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'The template resource 'templateLinkBase' at line '28' and column '30' is not valid: The language expression property 'templateLink' doesn't | |
exist, available properties are 'template, parameters, mode, provisioningState'.. Please see https://aka.ms/arm-template-expressions for usage details.'. | |
At C:\azure\sitecore-azure-2.0\tools\Sitecore.Cloud.Cmdlets.psm1:112 char:35 | |
+ ... eployment = New-AzureRmResourceGroupDeployment -Name $Name -ResourceG ... | |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
+ CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception | |
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet | |
New-AzureRmResourceGroupDeployment : The deployment validation failed | |
At C:\azure\sitecore-azure-2.0\tools\Sitecore.Cloud.Cmdlets.psm1:112 ch |
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
New-AzureRmResourceGroupDeployment : 6:18:47 PM - Resource Microsoft.Web/certificates 'sitecore-9cloud-auth' failed | |
with message '{ | |
"Code": "NotFound", | |
"Message": "Cannot find Certificate with name sitecore-9cloud-auth.", | |
"Target": null, | |
"Details": [ | |
{ | |
"Message": "Cannot find Certificate with name sitecore-9cloud-auth." | |
}, | |
{ |
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
$licenseFile = "C:\azure\sitecore-azure-2.0\license.xml" | |
$ArmTemplateUrl = "https://raw.githubusercontent.com/Sitecore/Sitecore-Azure-Quickstart-Templates/master/Sitecore 9.0.0/XP/azuredeploy.json"; | |
$ArmParametersPath = "C:\azure\sitecore-azure-2.0\xp\azuredeploy.parameters.json"; | |
$RGName = "SitecoreXP1"; | |
$DeploymentID = "SitecoreXP1" | |
$location = "East US"; | |
Start-SitecoreAzureDeployment -location $location -Name $RGName -ArmTemplateUrl $ArmTemplateUrl -ArmParametersPath $ArmParametersPath -LicenseXmlPath $licenseFile |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"deploymentId": { | |
"value": "SitecoreXP1" | |
}, | |
"location": { | |
"value": "East US" | |
}, |