Examples/Demo1.ps1
cls configuration Demo1 { Import-DscResource -module xjea xJeaToolKit Demo1Toolkit { Name = 'Demo1Toolkit' CommandSpecs = @" name,Parameter,ValidateSet,ValidatePattern Get-Process Get-Service stop-process,name,calc;notepad restart-service,name,,^A "@ } xJeaEndPoint Demo1EP { Name = 'Demo1EP' Toolkit = 'Demo1Toolkit' DependsOn = '[xJeaToolKit]Demo1Toolkit' } } Demo1 -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 Demo1EP Invoke-command $s {get-command} |out-string Invoke-Command $s {get-command stop-process -Syntax} enter-pssession $s |