Created
December 2, 2016 01:29
-
-
Save davidobrien1985/1d4936bffe3dc85cc7730aab3203689c to your computer and use it in GitHub Desktop.
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
$ErrorActionPreference = 'Stop' | |
$VerbosePreference = 'Continue' | |
$deployPath = 'C:\Program Files\RDS_Core\WebAccess' | |
# Set up the DSC folder structure | |
$dscPath = Join-Path $deployPath 'DSC' | |
New-Item -Path $dscPath -ItemType Directory -Force | |
# Install RDS connection broker components | |
Configuration rds_components { | |
Import-DscResource -ModuleName 'PSDesiredStateConfiguration' | |
Node localhost { | |
File FileDemo { | |
Type = 'Directory' | |
DestinationPath = 'C:\Test' | |
Ensure = "Present" | |
} | |
} | |
} | |
Try { | |
rds_components -OutputPath "$dscPath" | |
Start-DscConfiguration -Path "$dscPath" -Wait | |
} | |
Catch { | |
$errorDetail = $Error[0] | |
Write-Error -Message $errorDetail | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment