Skip to content

Instantly share code, notes, and snippets.

@davidobrien1985
Created December 2, 2016 01:29
Show Gist options
  • Save davidobrien1985/1d4936bffe3dc85cc7730aab3203689c to your computer and use it in GitHub Desktop.
Save davidobrien1985/1d4936bffe3dc85cc7730aab3203689c to your computer and use it in GitHub Desktop.
$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