Skip to content

Instantly share code, notes, and snippets.

Wictor Wilén wictorwilen

Block or report user

Report or block wictorwilen

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 add-custom-action-issue.js
var url = ""
var context = SP.ClientContext.get_current()
var site = context.get_site()
var actions = site.get_userCustomActions();
function () {
var newAction = actions.add();
wictorwilen / flow-bot-azure-function.js
Last active Sep 3, 2019
Microsoft Teams Outgoing Webhook Proxy for Microsoft Flow
View flow-bot-azure-function.js
const crypto = require('crypto');
const request = require('request');
const bufSecret = Buffer('OUTGOING-WEBHOOK-SECRET', "base64");
const flowWebhook = 'MICROSOFT-FLOW-URL';
module.exports = function (context, req) {
var auth = req.headers['authorization'];
// HMAC security validation
wictorwilen / .env
Created Oct 15, 2018
Import and env files
View .env
DATA=From env file
wictorwilen / get-site-info.js
Last active Oct 16, 2018
Client side updates of SharePoint stuff
View get-site-info.js
fetch('/_api/site', {headers:{accept:'application/json'}}).then( x => x.json().then( y => console.log(y)))
wictorwilen / powerline_prompt_ww.lua
Created Feb 28, 2018
cmder custom prompt with git and npm support
View powerline_prompt_ww.lua
-- Source:
--- promptValue is whether the displayed prompt is the full path or only the folder name
-- Use:
-- "full" for full path like C:\Windows\System32
local promptValueFull = "full"
-- "folder" for folder name only like System32
local promptValueFolder = "folder"
-- default is promptValueFull
local promptValue = promptValueFull
wictorwilen /
Created Nov 16, 2017
Homeassistant Sector Alarm integration

layout: page title: "Sector Alarm" description: "Offers support for Sector Alarm (Sweden) integration with Homeassistant." date: 2017-11-16 08:00 sidebar: true comments: false sharing: true footer: true logo: home-assistant.png

wictorwilen /
Last active May 9, 2019
Azure IoT integration for Home Assistant

layout: page title: "Azure IoT" description: "Offers support for Azure IoT integration with Homeassistant." date: 2017-10-22 14:18 sidebar: true comments: false sharing: true footer: true logo: home-assistant.png

wictorwilen / wutrouble.ps1
Created Aug 27, 2017
Windows Update troubleshooter
View wutrouble.ps1
cleanmgr /sageset
cleanmgr /sagerun
$path = "c:\windows\SoftwareDistribution"
wictorwilen / extractTextFromMessage.ts
Created Jun 5, 2017
Scrub @ mentions in Microsoft Teams
View extractTextFromMessage.ts
private static extractTextFromMessage(message: builder.IMessage): string {
var s = (message.text) ? message.text : '';
if (message.entities) {
message.entities.forEach((ent: any) => {
s = s.replace(ent.text, '');
return s.trim();
wictorwilen / office365groupscreation.ps1
Last active Jan 26, 2017
Office 365 Groups Creation
View office365groupscreation.ps1
# For more information see:
# Store the credentials in a variable
$creds = Get-Credential
# Connect to the Microsoft Online services
Connect-MsolService -Credential $creds
# Get tenant setting (misspelled)
Get-MsolCompanyInformation | Format-List UsersPermissionToCreateGroupsEnabled
You can’t perform that action at this time.