Skip to content

Instantly share code, notes, and snippets.

$URL = "Paste the Logic App URL here"
$Body = [PSCustomObject]@{
To = "Ex@mp.le"
Subject = "Subject of the mail"
Body = "Body (you can use HTML here if you like)"
}
# Create a line that creates a JSON from this object
$JSONBody = $Body | ConvertTo-Json
@Ba4bes
Ba4bes / SoThisIsChristmas.md
Last active December 12, 2019 22:04
SoThisIsChristmas.md

It's the most wonderful time of the year

Happy Holidays
Happy Newyear
Almost 2019
*** ***

This is an exampleGist for 25DaysOfServerless. Join the challenge!

<#
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
Adaption of https://github.com/Microsoft/AzureAutomation-Account-Modules-Update
by Barbara Forbes, 4bes.nl
#>
<#
.SYNOPSIS
Update all PowerShell modules in an Azure Automation account.
@Ba4bes
Ba4bes / cs.ps1
Created February 25, 2019 17:23
A few functions with minimum characters for Cloud shell on a mobile device
function gar {
param(
[Parameter(Mandatory = $false)]
[String]$Name
)
if ($Name) {
get-azresource -Name $Name | Select-Object Name, Type
}
Else {
get-azresource | Select-Object Name, Type
@Ba4bes
Ba4bes / Remove-AzurermExpiredSchedules.ps1
Created February 8, 2019 09:10
Remove expired runbookschedules from an Azure automation account
<#
.SYNOPSIS
This script removes expired schedules from a runbookaccount.
.DESCRIPTION
The script finds schedules that were scheduled onetime and don't have a next runtime.
All schedules that meet the criteria will be removed.
.EXAMPLE
.\Remove-OldSchedules.ps1 -AutomationAccountName "OGD-EUW-AUT-OPL-AUTOMATION-01"
.NOTES
Script was created to be used as a scheduled runbook.
@Ba4bes
Ba4bes / New-AzureRmAutomationRunbookschedule.ps1
Created February 8, 2019 09:08
Create and link a runbookschedule
function New-AzureRmAutomationRunbookschedule {
<#
.SYNOPSIS
This function creates a onetime runbookschedule and registers it to a runbook.
.DESCRIPTION
A unique name is created with a parameter and a number.
This name is used for a new schedule.
The schedule will be registered to a runbook.
.PARAMETER AutomationAccount
The name of the Automation Account where the runbook is and the schedule will be.
#Function is called at bottom of the script for the scheduled task.
Function Get-PwshUpdates {
param (
[Parameter()]
[Switch]$Preview
)
$PwshName = "PowerShell 6-x"
$Metadata = Invoke-RestMethod https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json
$PwshRelease = $Metadata.ReleaseTag -replace '^v'
if ($Preview) {