Skip to content

Instantly share code, notes, and snippets.

View bgelens's full-sized avatar

Ben Gelens bgelens

View GitHub Profile
$adal = "${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\Microsoft.IdentityModel.Clients.ActiveDirectory.dll"
$adalforms = "${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll"
[System.Reflection.Assembly]::LoadFrom($adal)
[System.Reflection.Assembly]::LoadFrom($adalforms)
$adTenant = 'bla.onmicrosoft.com'
$subscriptionid = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
$jobname = 'MyJob'
$collection = 'MyCollection'
$location = 'westeurope'
$clientId = '1950a258-227b-4e31-a9cf-717495945fc2'
function Test-NetPort {
[CmdletBinding()]
[OutputType([Boolean])]
param (
[Parameter(Mandatory,
ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[String] $ComputerName,
[Parameter(Mandatory,
function Get-CorpSysInfo {
[cmdletbinding()]
param (
[Parameter(ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
[String[]] $ComputerName = $env:COMPUTERNAME,
[ValidateSet('dcom','Wsman')]
[String] $Protocol = 'Wsman'
@bgelens
bgelens / gist:eaf45d229876279e9da8
Last active August 29, 2015 14:21
SMA Killing lingering sessions
#ChildRunbook to stop lingering sessions which is called inline
workflow Stop-LingeringSession {
param (
[Parameter(Mandatory)]
[Int] $ProcessId,
[Parameter(Mandatory)]
[String] $Server,
[Parameter(Mandatory)]
@bgelens
bgelens / DSCClassResourceTemplate.psm1
Last active August 29, 2015 14:18
DSC Class Resource Template.
enum Ensure
{
Absent
Present
}
enum List
{
First = 1
Second = 2
configuration SQL
{
Import-DscResource -ModuleName xSQLServer,xDisk
node sql01
{
xWaitForDisk SMAInstallDisk
{
DiskNumber = 2
RetryIntervalSec = 60
RetryCount = 60