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
################################################################################ | |
################## Compile the DSC Configuration & Generate the MOF file | |
################################################################################ | |
$ComputerName = $env:COMPUTERNAME | |
Main -nodeName $env:COMPUTERNAME -OutputPath "$env:USERPROFILE\Desktop" | |
################################################################################ | |
################## Apply the MOF file to the local computer | |
################################################################################ | |
# DSC - Watch as it applies the MOF | |
Start-DscConfiguration -Path "$env:USERPROFILE\Desktop" -ComputerName $ComputerName -Wait -Verbose -Force | |
# LCM - Apply | |
<# | |
LCM stands for: (Local Configuration Manager) this congured the local machine for DSC, | |
You could probably skip the LCM part in testing | |
#> | |
Set-DscLocalConfigurationManager -Path "$env:USERPROFILE\Desktop" -ComputerName $ComputerName -Verbose -Force | |
# LCM - Check | |
Get-DscLocalConfigurationManager | |
################################################################################ | |
################## Troubleshooting DSC Application | |
################################################################################ | |
Get-Job | fl * | |
# Last DSC events, newest to oldest | |
Get-WinEvent -LogName "Microsoft-Windows-Dsc/Operational" | select -first 20 | fl Message, time* | |
################################################################################ | |
################## Troubleshooting DSC Modules | |
################################################################################ | |
Find-Module -Filter 'xRemoteFile' | fl * | |
Install-Module -Name 'xRemoteFile' | |
Get-DscResource -Name 'Registry' -syntax |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment