Skip to content

Instantly share code, notes, and snippets.

View garrytrinder's full-sized avatar
👨‍💻
CLI for Microsoft 365

Garry Trinder garrytrinder

👨‍💻
CLI for Microsoft 365
View GitHub Profile
@garrytrinder
garrytrinder / proxy-stats.mjs
Created June 28, 2024 09:01
Gets total number of Dev Proxy downloads
#!/usr/bin/env zx
// suppress printing command names and output
$.verbose = false;
const token = 'github_pat_'
async function getDownloads() {
let numDownloads = 0;
let page = 1;
const perPage = 30;
@garrytrinder
garrytrinder / Publish-DevProxyToWinget.ps1
Last active July 9, 2024 14:15
This script publishes a new release of Dev Proxy to the Windows Package Manager (winget).
<#
.SYNOPSIS
This script publishes a new release of Dev Proxy to the Windows Package Manager (winget).
.DESCRIPTION
This script updates the manifest files for Dev Proxy to create a new release. It copies the old version files to the new version folder, replaces the old version number with the new version number in the files, and updates the installer hash in the Microsoft.DevProxy.installer.yaml file. The script then creates a new branch, commits the changes, and pushes the branch to the remote repository. Finally, the script creates a pull request with the new version information.
.PARAMETER OldVersion
The version number of the current release in semver format.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"position": {
"type": "string"
},
"value": {
{
"playstyles": [
{
"position": "GK",
"value": "Line Keeper",
"modifiers": [
{
"key": "overall",
"value": 3
},
@garrytrinder
garrytrinder / reset-env-values.ps1
Created November 24, 2023 10:08
Reset Teams Toolkit environment files
param (
[Parameter(Mandatory=$true)]
[string]$Path
)
# Define the files to search for
$filesToSearch = ".env.local", ".env.local.user", ".env.dev", ".env.dev.user"
# Define the keys to ignore
$keysToIgnore = "SPO_HOSTNAME", "SPO_SITE_URL", "APP_NAME_SUFFIX"
@garrytrinder
garrytrinder / remove-sideloaded-teams-apps.ps1
Last active November 24, 2023 09:23
Remove sideloaded Teams apps for the current user
# assumes you are logged into tenant using CLI for Microsoft 365 (https://aka.ms/cli-m365)
$apps = m365 teams user app list --userId "@meId" | ConvertFrom-Json
$apps | Where-Object { $_.teamsApp.distributionMethod -eq "sideloaded" } | ForEach-Object { m365 teams user app remove --id $_.id --userId "@meId" --force }
@garrytrinder
garrytrinder / remove-teams-org-apps.ps1
Last active November 24, 2023 09:23
Remove custom apps from the Teams organisation store
# assumes you are logged into tenant using CLI for Microsoft 365 (https://aka.ms/cli-m365)
$apps = m365 teams app list --distributionMethod organization | ConvertFrom-Json
$apps | ForEach-Object { m365 teams app remove --id $_.id --force }
@garrytrinder
garrytrinder / remove-outlook-apps.js
Last active November 24, 2023 09:18
Remove personal apps from Outlook web
(async (window) => {
const ootbApps = [
"Bookings",
"Files",
"Go to Excel",
"Go to OneNote",
"Go to PowerPoint",
"Go to Word",
"SurveyMonkey: Surveys for Feedback",
"Viva Engage"
@garrytrinder
garrytrinder / remove-bf-bots.js
Last active July 4, 2024 09:37
Remove all bots from dev.botframework.com
// Remove all bots from your account
// 1. Go to https://dev.botframework.com/bots
// 2. Open the console (F12)
// 3. Paste the following code and press enter
(async () => {
// select the first bot element
let bot = document.querySelector('.bot-content > a');
while (bot) {
// click the element link
@garrytrinder
garrytrinder / remove-az-resource-groups.ps1
Last active November 24, 2023 09:25
Remove all Azure Resource Groups
# assumes you are logged into azure subscription using Azure CLI (https://aka.ms/azcli)
az group list --query "[].name" -o tsv | ForEach-Object { az group delete --name $_ --yes --no-wait }