I am trying to capture the output from the Start-DscConfiguration command.
It sounds like you are hoping to redirect the verbose stream? If so, using "4>" will be effective. Example:
Start-DSCConfiguration -Path .\ -Wait -Verbose 4> .\log.txt
thank you for the reply.
I just found a post on here this morning that used a similar process and i updated my script with the below as i really needed it in a variable.
$scriptBlock = [scriptblock]::Create("Start-DscConfiguration -Path $MOFFile -Verbose -Wait -Force 4>&1") $scriptBlock $result.Message = Invoke-Command -ScriptBlock $scriptBlock
You must be logged in to reply to this topic.