Examples/Demo2.ps1
cls configuration Demo2 { Import-DscResource -module xjea xJeaToolKit SMBGetToolkit { Name = 'SMBGetToolkit' CommandSpecs = @" Module,Name,Parameter,ValidateSet,ValidatePattern SMBShare,get-* "@ } xJeaEndPoint Demo2EP { Name = 'Demo2EP' Toolkit = 'SMBGetToolkit' DependsOn = '[xJeaToolKit]SMBGetToolkit' } } 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 Remove-PSSession $s #EOF |