Skip to content

Instantly share code, notes, and snippets.

View jcallaghan's full-sized avatar

James Callaghan jcallaghan

View GitHub Profile
type: vertical-stack
cards:
- type: entities
title: Back Garden
show_header_toggle: false
entities:
- entity: binary_sensor.paw_button_1
secondary_info: last-updated
- type: custom:fold-entity-row
head:
@jcallaghan
jcallaghan / automation-remote_on.yaml
Last active March 27, 2021 12:21
Toggle through scenes
alias: 'Remote - Next scene'
id: '6999bb6f-2240-4351-8713-9b5ff51ae34d'
description: ''
initial_state: true
# mode: queued
trigger:
- platform: device
domain: zha
function Get-BaererToken() {
$headers = @{ Authorization=("Bearer " + $token) }
return $headers
}
# Yammer app developer token
$token = "12345678-ABCDEabcdeABCDEabcdeAB"
# Base Yammer API url
$yammerBaseUrl = "https://www.yammer.com/api/v1"
@jcallaghan
jcallaghan / ESPHome - Air Freshener Config - Deep Sleep.yaml
Created March 13, 2020 18:33
This is the ESPHome configuration I've used to enable deep sleep.
# Deep sleep yaml highlights
@jcallaghan
jcallaghan / Create-AADGroupClassification.ps1
Last active October 25, 2020 06:04
Apply configuration for Office3 365 Group Classification
<#
Azure Active Directory cmdlets for configuring group settings
Reference - https://docs.microsoft.com/en-gb/azure/active-directory/users-groups-roles/groups-settings-cmdlets
Note:
Update group classifications (lines 39 and 40)
Set GroupCreationAllowedGroupId to your group if change is required (lines 30 and 31)
#>
Add-PowerAppsAccount
Get-AdminPowerAppEnvironment
#Get-AdminPowerAppConnection | Where-Object {$_.ConnectionName -like "shared-sharepointonl*" -and $_.DisplayName -notlike "*tenantname*" }| format-table ConnectionName, DisplayName
Get-AdminPowerAppConnection| Select-Object * | Where-Object {$_.ConnectionName -like "shared-sharepointonl*" } | Export-Csv .\FlowConnections.csv -NoTypeInformation
Get-AdminPowerAppConnection| Select-Object * | Export-Csv .\FlowConnections.csv -NoTypeInformation
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber
# This call opens prompt to collect credentials (Azure Active Directory account and password) used by the commands
Add-PowerAppsAccount
# Here is how you can pass in credentials (avoiding opening a prompt)
$pass = ConvertTo-SecureString "password" -AsPlainText -Force
Add-PowerAppsAccount -Username foo@bar.com -Password $pass
<#
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant
You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code
form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software
product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the
Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims
or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
Please note: None of the conditions
# Created by SAMCOS @ MSFT, Collaboration with others!
## You must first connect to Microsoft Teams Powershell & Exchange Online Powershell for this to work.
## Links:
## Teams: https://www.powershellgallery.com/packages/MicrosoftTeams/1.0.0
## Exchange: https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps
## Have fun! Let me know if you have any comments or asks!
$AllTeamsInOrg = (Get-Team).GroupID
$TeamList = @()
Write-Output "This may take a little bit of time... Please sit back, relax and enjoy some GIFs inside of Teams!"
Write-Host ""
# Script requires AAD and CredentialManaer modules, AAD B2b user management permissions
Import-Module AzureADPreview
function Remove-PendingGuestInvites{
Param(
[Parameter(Mandatory=$false,
ValueFromPipeline=$true)]
[switch]