Skip to content

Instantly share code, notes, and snippets.

zplume

Block or report user

Report or block zplume

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View DurableOrchestrationContextExtensions.cs
using Microsoft.Azure.WebJobs;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace LS.DurableFunctions.Examples
{
public static class DurableOrchestrationContextExtensions
{
/// <summary>
@zplume
zplume / CsvHelperExample.cs
Last active May 29, 2019
Example of using CsvHelper to write a CSV file (up to 10MB in size) to SharePoint Online
View CsvHelperExample.cs
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using OfficeDevPnP.Core;
using Microsoft.SharePoint.Client;
using System.IO;
using CsvHelper;
using File = Microsoft.SharePoint.Client.File;
using CsvHelper.Configuration.Attributes;
View GetQueryStrings.js
const queryStrings = window.location.search.substring(1).split("&").reduce((output, item, index) => {
if(item === "")
return output;
const keyValue = item.split("=");
output[decodeURIComponent(keyValue[0])] = keyValue[1] !== undefined ?
decodeURIComponent(keyValue[1]) :
true; // return true for query strings with no value
View Create-MailEnabledSecurityGroups.ps1
param(
# Credentials paramter should be a variable containing the result of Get-Credential
[Parameter(Mandatory = $true)]
[pscredential]$Credentials,
[Parameter(Mandatory = $true)]
[string]$ConfigFile
)
$ErrorActionPreference = "Stop"
@zplume
zplume / FunctionAppMap.ps1
Last active Dec 16, 2018
Get-AzureFunctionKeys.ps1 retrieves Azure Function auth. codes for the Functions specified in FunctionAppMap.ps1, using the Azure REST API and user credentials. This script uses Get-AADToken.ps1 (https://gist.github.com/zplume/574e133b43ecf3037473286580ed524e) to retrieve an Azure access token.
View FunctionAppMap.ps1
# Map Function App friendly name to URL
return @{
DEV = @{
"CreateTenderSite" = "https://dev-createtendersite.azurewebsites.net";
"CopyDocuments" = "https://dev-copydocuments.azurewebsites.net";
"Notifications" = "https://dev-notifications.azurewebsites.net";
"PermissionAssignment" = "https://dev-permissions.azurewebsites.net"
};
TEST = @{
View Get-AADToken.ps1
# Original code from https://github.com/slavizh/OMSSearch/blob/master/OMSSearch.psm1
# - Updated/fixed authentication method calls
# - Ensure ADAL DLL is loaded
Function Get-AADToken {
<#
.SYNOPSIS
Get token from Azure AD so you can use the other cmdlets.
.DESCRIPTION
Get token from Azure AD so you can use the other cmdlets.
View Get-PnPListItemRoleAssignmentDefinitionBindings.ps1
param(
[Parameter(Mandatory = $true)]
[string]$ListTitle,
[Parameter(Mandatory = $true)]
[int]$ItemId,
[Parameter(Mandatory = $true)]
[string]$Path
)
@zplume
zplume / Update-Flows.ps1
Last active Oct 25, 2018
PowerShell script to update multiple Flows that have been exported from one environment for deployment to another environment. The script will unzip a set of Flow zip files from a source directory into a temp folder, replace source values with destination values, then save updated zip files into a destination directory.
View Update-Flows.ps1
param(
[Parameter(Mandatory = $true)]
[string]$SourceEnv,
[Parameter(Mandatory = $true)]
[string]$DestinationEnv
)
$ErrorActionPreference = "Stop"
# Note: these values could be loaded from elsewhere, e.g. CSV/XML (or dynamically if you want to get fancy)
View Using the Parse JSON action to set headers for SharePoint Online REST requests in Microsoft Flow.md

Using the Parse JSON action to set headers for SharePoint Online REST requests in Microsoft Flow

About

This is useful in combination with the SharePoint - Send an HTTP request to SharePoint action.

This could be expanded to include other combinations of header values, but this is what I've used so far:

Set Headers

View Retrieving list item changes with the SharePoint Online Folder.GetListItemChanges REST API in Microsoft Flow.md

Retrieving list item changes with the SharePoint Online Folder.GetListItemChanges REST API in Microsoft Flow

About

This post demonstrates how to retrieve SharePoint list item changes in Microsoft Flow using the SharePoint - Send an HTTP request to SharePoint action and the SharePoint Online Folder.GetListItemChanges REST API.

Why

This is something I started looking at after reading this set of tweets by John Liu:

You can’t perform that action at this time.