Skip to content

Instantly share code, notes, and snippets.

View zmilleson's full-sized avatar

Zachary Milleson zmilleson

View GitHub Profile
@PokerGuy
PokerGuy / gist:5cdfc4ef146ce6b535bfd8e13469a2ab
Last active May 13, 2024 15:03
Push a file to SharePoint
const push = async (file, fileName) => {
const client = new aws.SecretsManager();
const spURL = `https://<your site>.sharepoint.com/sites/<your specific subsite>/_api/web/GetFolderByServerRelativeUrl('Documents')/Files/Add(url='${fileName}', overwrite=true)`;
try {
const data = await client.getSecretValue({ SecretId: '<whatever you called your secret>' }).promise();
const secret = JSON.parse(data.SecretString).<whatever you called your secret>;
const getToken = await axios.post('https://accounts.accesscontrol.windows.net/<sharepoint resource id>/tokens/OAuth/2',
querystring.stringify({
grant_type: 'client_credentials',
client_id: '<ask your sharepoint person for this it's a something@tenant id>',
@cmatskas
cmatskas / enforceTLS.json
Last active January 29, 2021 15:28
Azure Policy Enforce TLS 1.2
{
"properties": {
"mode": "all",
"parameters": {
},
"displayName": "SSL WebSites",
"description": "This policy enables you to restrict websites to only accept TLS traffic with minimum version 1.2",
"policyRule": {
"if": {
"anyOf": [