Examples/Demo2.ps1
cls configuration Demo2 { Import-DscResource -module xjea xJeaToolKit Demo2Toolkit { Name = 'Demo2Toolkit' CommandSpecs = @" Module,Name,Parameter,ValidateSet,ValidatePattern SMBShare,get-* "@ } xJeaEndPoint Demo2EP { Name = 'Demo2EP' Toolkit = 'Demo2Toolkit' DependsOn = '[xJeaToolKit]Demo2Toolkit' } } Demo2 -OutputPath C:\DSCDemo Start-DscConfiguration -Path C:\DSCDemo -ComputerName localhost -Verbose -wait start-sleep -Seconds 30 #Wait for WINRM to restart $s = New-PSSession -cn . -ConfigurationName Demo2EP Invoke-command $s {get-command} |out-string enter-pssession $s |