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 System.IO; | |
using System.Text; | |
public static class StreamExtensions | |
{ | |
public static string ToEncodedString(this Stream stream, Encoding enc = null) | |
{ | |
enc = enc ?? Encoding.UTF8; | |
byte[] bytes = new byte[stream.Length]; |
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
$imagePath = "$home\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\*" | |
$destinationPath = "$home\OneDrive\Pictures\Lock screen" | |
Add-Type -AssemblyName System.Drawing | |
# get images from lock screen folder | |
$items = Get-ChildItem -Path $imagePath | |
foreach($item in $items) { | |
$fileName = $item.Name |
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 objectToQueryString(paramsObject) { | |
return Object.keys(paramsObject).reduce((accumulator, currentKey) => { | |
const prefix = accumulator === "" ? "?" : "&"; | |
return `${accumulator}${prefix}${currentKey}=${encodeURIComponent(paramsObject[currentKey])}`; | |
}, ""); | |
} |
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.Azure.WebJobs; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace LS.DurableFunctions.Examples | |
{ | |
public static class DurableOrchestrationContextExtensions | |
{ | |
/// <summary> |
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 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; |
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
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 | |
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( | |
# Credentials paramter should be a variable containing the result of Get-Credential | |
[Parameter(Mandatory = $true)] | |
[pscredential]$Credentials, | |
[Parameter(Mandatory = $true)] | |
[string]$ConfigFile | |
) | |
$ErrorActionPreference = "Stop" |
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
# 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 = @{ |
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
# 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. |
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)] | |
[string]$ListTitle, | |
[Parameter(Mandatory = $true)] | |
[int]$ItemId, | |
[Parameter(Mandatory = $true)] | |
[string]$Path | |
) |
NewerOlder