Skip to content

Instantly share code, notes, and snippets.

@websterian
websterian / RunSellableItemIntervalStrategy.ps1
Last active January 6, 2020 15:54
Runs the Sellable item Interval Asynchronous Strategy
#Change these for your environment...
$pathToKernel = 'C:\inetpub\wwwroot\XP0.sc\bin\Sitecore.Kernel.dll'
$indexName = "sitecore_master_index"
$strategyName = "sellableItemsIntervalAsynchronousStrategyMaster"
#Loads the kernel...
try
{
Add-Type -Path $pathToKernel
}
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"AzureWebJobsDashboard": "",
"shopsServiceUrl": "https://localhost:5000/api/",
"commerceOpsServiceUrl": "https://localhost:5000/commerceops/",
"defaultEnvironment": "HabitatAuthoring",
"defaultShopName": "storefront",
"defaultShopCurrency": "USD",
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Azure.WebJobs.Host;
using Sitecore.Commerce.ServiceProxy;
using System;
using Sitecore.Commerce.Engine;
{
"info": {
"_postman_id": "4ea2f3c9-d8e0-4ca0-95c2-acf232ee5ef2",
"name": "Examples",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "InventoryUpdate",
"request": {
{
"products" :
[
{
"productid": "Product1",
"listprice": "10.99",
"description": "Product 1 is the best!!!",
"variants" :
[
{
using Sitecore.Services.Examples.Catalog.Pipelines;
using Sitecore.Services.Examples.Catalog.Pipelines.Blocks;
namespace Sitecore.Services.Examples.Catalog
{
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Commerce.Core;
using Framework.Configuration;
using Sitecore.Framework.Pipelines.Definitions.Extensions;
using Sitecore.Commerce.Core.Commands;
using Sitecore.Commerce.Plugin.Catalog;
namespace Sitecore.Services.Examples.Catalog
{
using System.Threading.Tasks;
using Microsoft.AspNetCore.OData.Builder;
using Commerce.Core;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Web.Http.OData;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using Sitecore.Commerce.Core;
using Sitecore.Services.Examples.Catalog.Commands;
using Sitecore.Services.Examples.Catalog.Pipelines.Arguments;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Sitecore.Commerce.Core;
using Sitecore.Commerce.Core.Commands;
using Sitecore.Services.Examples.Catalog.Pipelines;
using Sitecore.Services.Examples.Catalog.Pipelines.Arguments;
namespace Sitecore.Services.Examples.Catalog.Commands
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Sitecore.Commerce.Core;
using Sitecore.Commerce.Plugin.Catalog;
using Sitecore.Commerce.Plugin.Pricing;
using Sitecore.Framework.Conditions;
using Sitecore.Framework.Pipelines;
using Sitecore.Services.Examples.Catalog.Pipelines.Arguments;