Skip to content

Instantly share code, notes, and snippets.

View New-AzUpdateDeploymentSchedule.ps1
Function New-AzUpdateDeploymentSchedule {
<#
.SYNOPSIS
Schedule Azure updates
.DESCRIPTION
This cmdlet combines the three cmdlets that are needed to create a update schedule.
New-AzAutomationSchedule
New-AzAutomationUpdateManagementAzureQuery
New-AzAutomationSoftwareUpdateConfiguration
Created for Azure Update Automation.
View Deploy_ARM.yml
# This is a basic workflow to help you get started with Actions
name: Deploy_ARM
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
[push, pull_request]
View azure-pipelines.yml
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- "*"
stages:
- stage: test
@Ba4bes
Ba4bes / DFSR_test_PRTG.ps1
Last active May 31, 2020
Example for https://4bes.nl, not meant for production
View DFSR_test_PRTG.ps1
#######################################
#Monitor DFSR replication
#Created by: Barbara Forbes
#Date: 26-2-2016
####################################
#The account running this script needs to have permissions on the drives that are used for this test.
#Define Paths on both servers, change this to your situation
$DFSpath1 = "c:\test"
@Ba4bes
Ba4bes / azuredeploy.json
Created May 17, 2020
Example ARM template for Storage Account
View azuredeploy.json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountPrefix": {
"type": "string"
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
View Send-LogicAppMail.ps1
$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 Dec 12, 2019
SoThisIsChristmas.md
View 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!

View Update-Modules.ps1
<#
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 Feb 25, 2019
A few functions with minimum characters for Cloud shell on a mobile device
View cs.ps1
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 Feb 8, 2019
Remove expired runbookschedules from an Azure automation account
View Remove-AzurermExpiredSchedules.ps1
<#
.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.
You can’t perform that action at this time.