Skip to content

Instantly share code, notes, and snippets.

View jcallaghan's full-sized avatar

James Callaghan jcallaghan

View GitHub Profile
@jcallaghan
jcallaghan / Export-PowerBIWorkspaceMembers.ps1
Last active March 5, 2024 12:30
Power BI Workspace Members Report
# Install the PowerBI module
# Install-Module -Name MicrosoftPowerBIMgmt
# Import the PowerBI module
Import-Module MicrosoftPowerBIMgmt
# Login to Power BI
Login-PowerBI
# Connect to Power BI (Optional -UserName "yourusername@yourdomain.com")
@jcallaghan
jcallaghan / Automation.yaml
Last active May 17, 2022 20:05
Example #HomeAssistant automation for tracking my medicine to remind me to order more when low.
alias: 'Family - James - Track Medicine'
id: '4df574c4-bb48-4108-b679-76a47966af92'
description: 'Track medicine and order more when low.'
initial_state: true
mode: 'single'
max_exceeded: silent
trigger:
# Let's keep this simple and assume the medicine was taken each day.
alias: 'Paw Button 1'
id: '5c631613-1253-4b21-a342-ddea791e0000'
initial_state: true
mode: single
trigger:
- platform: state
entity_id: binary_sensor.paw_button_1
to: 'on'
input_number:
paw_button_1_wait:
name: "#1 Wait"
min: 0
max: 300
step: 1
mode: box
unit_of_measurement: "mins"
icon: mdi:timer
input_text:
paw_button_1_tts:
name: "#1 Announcement"
icon: mdi:bullhorn
max: 255
paw_button_1_notification:
name: "#1 Notification"
icon: mdi:bullhorn
template:
- trigger:
- platform: event
event_type: zha_event
event_data:
device_id: 8f7901e0614a3cdc7eeb864e896efa87
binary_sensor:
- name: "Paw Button #1"
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
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