Skip to content

Instantly share code, notes, and snippets.

🧐

Wictor Wilén wictorwilen

🧐
View GitHub Profile
@wictorwilen
wictorwilen / teamsemail.ps1
Created Feb 11, 2020
List all Microsoft Teams members e-mail
View teamsemail.ps1
Install-Module -Name MicrosoftTeams -Force
Connect-MicrosoftTeams
Get-Team -User <username>
Get-TeamUser -GroupId <id> | ft User
View add-custom-action-issue.js
var url = "https://contoso.sharepoint.com/sites/classic/SiteAssets/test"
var context = SP.ClientContext.get_current()
var site = context.get_site()
var actions = site.get_userCustomActions();
context.load(site)
context.load(actions)
context.executeQueryAsync(
function () {
var newAction = actions.add();
newAction.set_description('abc123')
@wictorwilen
wictorwilen / flow-bot-azure-function.js
Last active Jan 5, 2020
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
wictorwilen / .env
Created Oct 15, 2018
Import and env files
View .env
DATA=From env file
@wictorwilen
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
wictorwilen / powerline_prompt_ww.lua
Created Feb 28, 2018
cmder custom prompt with git and npm support
View powerline_prompt_ww.lua
-- Source: https://github.com/AmrEldib/cmder-powerline-prompt
--- 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
wictorwilen / manifest.json
Last active Apr 29, 2020
Homeassistant Sector Alarm integration
View manifest.json
{
"domain": "sector_alarm",
"name": "Sector Alarm",
"documentation": "https://void.null",
"dependencies": [],
"codeowners": [],
"requirements": []
}
@wictorwilen
wictorwilen / azureiot.md
Last active May 9, 2019
Azure IoT integration for Home Assistant
View azureiot.md

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
wictorwilen / wutrouble.ps1
Created Aug 27, 2017
Windows Update troubleshooter
View wutrouble.ps1
## https://support.microsoft.com/en-us/help/971058/how-do-i-reset-windows-update-components
cleanmgr /sageset
cleanmgr /sagerun
$path = "c:\windows\SoftwareDistribution"
@wictorwilen
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();
}
You can’t perform that action at this time.