This file contains hidden or 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
Resources: | |
Ec2Instance: | |
Type: AWS::EC2::Instance | |
Properties: | |
ImageId: ami-0a9ca0496f746e6e0 | |
InstanceType: t2.micro | |
Tags: | |
- Key: Name | |
Value: "WinTest01" | |
- Key: NameOfService |
This file contains hidden or 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
task . InstallDependencies, Analyze, Test, UpdateVersion, Clean, Archive | |
task InstallDependencies { | |
Install-Module Pester -Force | |
Install-Module PSScriptAnalyzer -Force | |
} | |
task Analyze { | |
$scriptAnalyzerParams = @{ | |
Path = "$BuildRoot\DSCClassResources\TeamCityAgent\" |
This file contains hidden or 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 Enable-IISRemoteManagement { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory)] | |
[ValidateScript({ | |
if (-not (Test-Connection -ComputerName $_ -Quiet -Count 1)) { | |
throw "The computer [$_] could not be reached." | |
} else { | |
$true | |
}})] |
This file contains hidden or 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
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' | |
. "$here\$sut" | |
Describe "Add-ACLAccessRule Tests" { | |
New-Item -Name Logs -Path 'TestDrive:' -ItemType Directory | |
$application = 'DevOpsTest' |
This file contains hidden or 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 Add-AclAccessRule { | |
<# | |
.SYNOPSIS | |
Adds an access rule to an existing ACL on a folder or file. | |
.DESCRIPTION | |
Use .net methods to get the current ACL of the file or folder then generates a new rule | |
to which is added to the ACL of the file system object | |
.EXAMPLE | |
$splat = @{ | |
Path = 'C:\Logs' |
This file contains hidden or 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
[DSCLocalConfigurationManager()] | |
Configuration LCM_Pull { | |
Node Pull { | |
Settings { | |
ConfigurationMode = 'ApplyAndAutoCorrect' | |
RefreshMode = 'Pull' | |
} |
This file contains hidden or 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 WebServer { | |
Import-DscResource -ModuleName 'PSDesiredStateConfiguration' | |
Import-DscResource -ModuleName "xWebAdministration" | |
Node WebServerConfig { | |
WindowsFeature WindowsServer { | |
Name = 'Web-Server' | |
} |
This file contains hidden or 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 DscPullServer | |
{ | |
param | |
( | |
[string[]]$NodeName = 'localhost', | |
[ValidateNotNullOrEmpty()] | |
[string] $certificateThumbPrint, | |
[Parameter(Mandatory)] |
This file contains hidden or 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 New-DomainSignedCertificate { | |
[CmdletBinding()] | |
param( | |
[parameter(Mandatory=$true)] | |
[string] | |
$Hostname, | |
[parameter(Mandatory=$true)] | |
[string] | |
$Organization, |
This file contains hidden or 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
@{ | |
AllNodes = @( | |
@{ | |
NodeName = '*' | |
Lability_SwitchName = 'External' | |
DomainName = 'globomantics.com' | |
Lability_StartupMemory = 2GB; | |
PSDscAllowPlainTextPassword = $true; | |
} | |