This file contains 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 SQL | |
{ | |
Import-DscResource -ModuleName xSQLServer,xDisk | |
node sql01 | |
{ | |
xWaitForDisk SMAInstallDisk | |
{ | |
DiskNumber = 2 | |
RetryIntervalSec = 60 | |
RetryCount = 60 |
This file contains 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
enum Ensure | |
{ | |
Absent | |
Present | |
} | |
enum List | |
{ | |
First = 1 | |
Second = 2 |
This file contains 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
#ChildRunbook to stop lingering sessions which is called inline | |
workflow Stop-LingeringSession { | |
param ( | |
[Parameter(Mandatory)] | |
[Int] $ProcessId, | |
[Parameter(Mandatory)] | |
[String] $Server, | |
[Parameter(Mandatory)] |
This file contains 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
function Get-CorpSysInfo { | |
[cmdletbinding()] | |
param ( | |
[Parameter(ValueFromPipeline, | |
ValueFromPipelineByPropertyName)] | |
[ValidateNotNullOrEmpty()] | |
[String[]] $ComputerName = $env:COMPUTERNAME, | |
[ValidateSet('dcom','Wsman')] | |
[String] $Protocol = 'Wsman' |
This file contains 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
$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' |
This file contains 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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"vmName": { | |
"type": "string", | |
"metadata": { | |
"description": "Name of the existing VM to onboard into Azure Automation DSC" | |
} | |
}, |
This file contains 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
function Get-OSInfo { | |
[cmdletbinding(DefaultParameterSetName='Brief')] | |
param ( | |
[Parameter(ParameterSetName='Full')] | |
[Switch] $Full | |
) | |
process { | |
$osInfoFull = (Get-Content -Path /etc/os-release).Replace('"','') | ConvertFrom-StringData | |
if ($PSCmdlet.ParameterSetName -eq 'Brief') { | |
$osInfoFull.PRETTY_NAME |
This file contains 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
#requires -Version 3 | |
function Get-PowerPlan { | |
<# | |
.SYNOPSIS | |
Display PowerPlans on requested machines. | |
.DESCRIPTION | |
Display PowerPlans on requested machines using CIM. | |
.PARAMETER ComputerName | |
ComputerNames to query for PowerPlans. | |
Default value is the local computername through $env:COMPUTERNAME |
This file contains 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
function Test-ClassResource | |
{ | |
param( | |
[Parameter(ValueFromPipeline=$True,Mandatory=$True)] | |
[string]$fileName | |
) | |
$ast = [System.Management.Automation.Language.Parser]::ParseFile($fileName, [ref]$null, [ref]$null) | |
$result = foreach ($item in $ast.FindAll({$args[0] -is [System.Management.Automation.Language.AttributeAst]}, $false)) | |
{ |
This file contains 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
Install-Module -Name xPSDesiredStateConfiguration -Force | |
[DscLocalConfigurationManager()] | |
configuration LCM { | |
Settings { | |
RebootNodeIfNeeded = $true | |
ActionAfterReboot = 'ContinueConfiguration' | |
} | |
} |
OlderNewer