Skip to content

Instantly share code, notes, and snippets.

View mortenlerudjordet's full-sized avatar

Morten Lerudjordet mortenlerudjordet

View GitHub Profile
<#
.SYNOPSIS
Removes git extraheader for AzD project from pipeline after terraform has feteched modules from AzD repo
.DESCRIPTION
.PARAMETER AzDteamAccountURL
Azure DevOps account url
https://dev.azure.com/AccountName
.PARAMETER Verbose
@mortenlerudjordet
mortenlerudjordet / Set-GitContext.ps1
Last active January 24, 2020 08:51
Terraform in private repo
<#
.SYNOPSIS
Uses AzD agent Oauth token to set git config extraheader so terraform init can use private AzD git repo as module source
.DESCRIPTION
Section running this task needs to have access to Oauth token. This is configured on the agent step in the pipeline config.
.PARAMETER AzDteamAccountURL
Azure DevOps account url
https://AccountName@dev.azure.com/AccountName
@mortenlerudjordet
mortenlerudjordet / Send-PSWinCSMS.ps1
Created February 12, 2017 12:39
Sends a message via SMS using PSWinCom Gateway
<#
.SYNOPSIS
Sends a message via SMS using PSWinCom Gateway to
recipients defined in the specified System Center Operations Manager subscription.
All activity is logged to the eventlog defined in $EventLog with source name $EventSource.
For logging to work New-EventLog -LogName $EventLog -Source $EventSource must be first
executed on all SCOM MGMT servers the script will run on beforehand.
@mortenlerudjordet
mortenlerudjordet / DisplayPerfValuesInWidget.ps1
Last active January 27, 2017 17:23
SCOM Widget Bluebar
#region Parameters
# Set sample interval Last 3 hours UTC
$aggregationInterval = 3
$TopN = 40
$PerfCounterName = "Send Queue Size"
$RuleDisplayName = "Collect Health Service Management Group\Send Queue Size"
$Class = Get-SCOMClass -Name Microsoft.SystemCenter.Agent
$Agents = Get-SCOMClassInstance -class $Class