Skip to content

Instantly share code, notes, and snippets.

Josh Duffney Duffney

Block or report user

Report or block Duffney

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Duffney
Duffney / TeamCityAgentDSC.Build.ps1
Created Sep 19, 2017
TeamCityAgentDSC build script as of 9-19-2017
View TeamCityAgentDSC.Build.ps1
task . InstallDependencies, Analyze, Test, UpdateVersion, Clean, Archive
task InstallDependencies {
Install-Module Pester -Force
Install-Module PSScriptAnalyzer -Force
}
task Analyze {
$scriptAnalyzerParams = @{
Path = "$BuildRoot\DSCClassResources\TeamCityAgent\"
@Duffney
Duffney / Enable-IISRemoteManagement.ps1
Created Sep 6, 2017
Enable-IISRemoteManagement.ps1
View Enable-IISRemoteManagement.ps1
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
}})]
View Add-AclAccessRule.Tests.ps1
$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'
View Add-AclAccessRule.ps1
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'
@Duffney
Duffney / LCMPull.ps1
Last active May 4, 2017
LCM configuration to connect the pull server to the client node
View LCMPull.ps1
[DSCLocalConfigurationManager()]
Configuration LCM_Pull {
Node Pull {
Settings {
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Pull'
}
@Duffney
Duffney / WebServer.ps1
Created Mar 6, 2017
Simple Web Server DSC Configuration for a DSC Pull Server
View WebServer.ps1
Configuration WebServer {
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
Import-DscResource -ModuleName "xWebAdministration"
Node WebServerConfig {
WindowsFeature WindowsServer {
Name = 'Web-Server'
}
@Duffney
Duffney / DscPullServer.ps1
Last active May 4, 2017
DSC config for v2 of the pull server
View DscPullServer.ps1
configuration DscPullServer
{
param
(
[string[]]$NodeName = 'localhost',
[ValidateNotNullOrEmpty()]
[string] $certificateThumbPrint,
[Parameter(Mandatory)]
View New-DomainSignedCertificate.ps1
function New-DomainSignedCertificate {
[CmdletBinding()]
param(
[parameter(Mandatory=$true)]
[string]
$Hostname,
[parameter(Mandatory=$true)]
[string]
$Organization,
@Duffney
Duffney / DSCPullServerLab.psd1
Last active Nov 27, 2017
Configuration data for DSC pull server lab environment provisioning with Lability.
View DSCPullServerLab.psd1
@{
AllNodes = @(
@{
NodeName = '*'
Lability_SwitchName = 'External'
DomainName = 'globomantics.com'
Lability_StartupMemory = 2GB;
PSDscAllowPlainTextPassword = $true;
}
@Duffney
Duffney / DSCPullServerLab.ps1
Last active Nov 28, 2017
Pull server lab DSC config for lability sets up AD domain and ADCS.
View DSCPullServerLab.ps1
Configuration Pull {
param (
[Parameter()] [ValidateNotNull()] [PSCredential] $Credential = (Get-Credential -Credential 'Administrator')
)
Import-DscResource -Module PSDesiredStateConfiguration
Import-DscResource -Module xActiveDirectory
Import-DscResource -Module xPSDesiredStateConfiguration
Import-DscResource -Module xAdcsDeployment
You can’t perform that action at this time.