This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[Parameter(Mandatory = $true)] | |
[string]$websiteName, | |
[Parameter(Mandatory = $true)] | |
[string]$resourceGroupName, | |
[Parameter(Mandatory = $true)] | |
[string]$sourceDir, | |
[string]$destinationPath = "/site/wwwroot" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Describe 'Domain Controllers' { | |
Context 'Replication Link Status' { | |
$results = repadmin /showrepl * /csv | ConvertFrom-Csv # Get the results of all replications between all DCs | |
$groups = $results | Group-Object -Property 'Source DSA' # Group the results by the source DC | |
foreach ($sourcedsa in $groups) { | |
# Create a context for each source DC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
1. Logged on as a Global Administrator, create a new "App-registration" in Azure AD. | |
2. Add a Redirect URI. This can point to any web location you like as it isn't used. | |
2. Add "API permissions" for "Microsoft Graph" to the app for "Presence.Read" and "Presence.Read.All" (Must be delegated). | |
3. Grant admin consent for the organisation (click the button) | |
3. Add a new "Secret" to the app which can be used to retrieve a token for the app. Remember to copy the secret! | |
#> | |
$clientID = '8806ac69-edde-4069-8128-c01c3aa84eda' # This is the "Application (client) ID" of the application which is granted permission to read presence. | |
$tenantName = "mytenant.onmicrosoft.com" # This is the name of the tenant for Azure AD. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$TodayDate = Get-Date -Format "yyyy-MM-dd" | |
$PreviousReading = Read-Host -Prompt 'Enter the date of the previous reading in dd/mm/yyyy format' | |
$PreviousReadingDate = Get-Date $PreviousReading -Format "yyyy-MM-dd" | |
$Soap = @" | |
<?xml version="1.0" encoding="utf-8"?> | |
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> | |
<soap12:Body> | |
<GetPublicationDataWM xmlns="http://www.NationalGrid.com/MIPI/"> | |
<reqObject> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## configuration.yaml | |
automation: !include automation.yaml | |
switch: !include switches.yaml | |
binary_sensor: !include binary_sensors.yaml | |
sensor: !include sensors.yaml | |
## automation.yaml | |
- id: shellies_get_status | |
alias: Shellies Get Status | |
description: '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sensor: | |
# These should be used in the energy dashboard. | |
- platform: integration | |
source: sensor.shp_circuit_1_power | |
name: SHP Circuit 1 Consumed Energy | |
unit_prefix: k | |
round: 3 | |
- platform: integration | |
source: sensor.shp_circuit_2_power | |
name: SHP Circuit 2 Consumed Energy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
views: | |
- theme: Backend-selected | |
title: Smart Home Panel | |
path: smart-home-panel | |
icon: mdi:monitor-dashboard | |
badges: [] | |
cards: | |
- title: Smart Home Panel | |
square: false | |
columns: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration | |
$ACCESS_KEY = "your access key from Ecoflow Dev portal" | |
$SECRET_KEY = "your secret key from Ecoflow Dev portal" | |
$endpoint = "https://api-e.ecoflow.com" # May be different! Check the Ecoflow Dev Portal for yours. | |
function Get-Timestamp { | |
return [int64](([datetime]::UtcNow - [datetime]'1970-01-01').TotalMilliseconds) | |
} | |
function Get-Nonce { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get a timestamp that's in a format suitable for the Ecoflow HTTP API. | |
function Get-Timestamp { | |
return [int64](([datetime]::UtcNow - [datetime]'1970-01-01').TotalMilliseconds) | |
} | |
# Get a nonce (random variable) that's in a format suitable for the Ecoflow HTTP API. | |
function Get-Nonce { | |
return (Get-Random -Minimum 100000 -Maximum 999999).ToString() | |
} |