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 Microsoft.SharePoint.Client; | |
using Microsoft.SharePoint.Client.Utilities; | |
using System.Collections.Generic; | |
public static class Email | |
{ | |
public static void Send(ClientContext ctx, string[] to, string subject, string body, bool html = false) | |
{ | |
var properties = new EmailProperties(); | |
properties.To = to; |
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
Array.prototype.slice.call(document.querySelectorAll("#onetidMngCytpeRptrTable a")).forEach(function(a) { a.setAttribute("href", "\u002fsites\u002fcontentTypeHub/_layouts/15/ManageContentType.aspx?ctype=" + a.getAttribute("id").replace("LinkEditType", "")); }); |
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
(async function() { | |
let userIds = [239, 405]; | |
// computed property name: [prop]: | |
// rest parameters: ...props | |
// stolen from: https://stackoverflow.com/a/25554551 | |
function pick(o, ...props) { | |
return Object.assign({}, ...props.map(prop => ({[prop]: o[prop]}))); | |
} |
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
Param( | |
[Parameter(Mandatory=$True)] | |
$AppPrincipalId, | |
[Parameter(Mandatory=$True)] | |
$TenantId, | |
[string]$ClientSecret | |
) |
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 getQueryStringParam(searchKey) { | |
// get URI object | |
var uri = new URI(location.href); | |
// get query params | |
var queryParams = uri.getQueryAsObject(); | |
// get queryParam keys | |
var queryParamKeys = Object.keys(queryParams); | |
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
export default class Log { | |
private prefix: string; | |
private logSource: object; | |
private parseArgument(arg: any): string { | |
return typeof(arg) === "string" ? arg : JSON.stringify(arg); | |
} | |
private getMethodName(callingFunction: Function): string { | |
const methodNames = Object.getOwnPropertyNames(Object.getPrototypeOf(this.logSource)); |
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 Microsoft.SharePoint.Client; | |
using System; | |
using System.Net; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using static Microsoft.SharePoint.Client.ClientContextExtensions; | |
public static class ClientContextExtensions | |
{ | |
public static async Task ExecuteQueryRetryAsync(this ClientContext clientContext, |
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
public static class AuthCheck | |
{ | |
// This Function will return OK if the user is authenticated | |
[FunctionName("AuthCheck")] | |
public static HttpResponseMessage Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")]HttpRequestMessage request, TraceWriter log) | |
{ | |
var response = request.CreateResponse(HttpStatusCode.OK); | |
Cors.Enable(request, response); |
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
Remove-Item d:\home\site\wwwroot\* -recurse |
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
$tenantUrl = "https://yourtenant.sharepoint.com" | |
$credentials = Get-Credential | |
Connect-PnPOnline -Url $tenantUrl -Credentials $credentials | |
$sites = Get-PnPSiteSearchQueryResults -All | |
Disconnect-PnPOnline | |
$script:wfStatuses = @() | |
function Get-WebWorkflowData($web) { |