The PSADT way of logging output from a PowerShell handler


Firstly I’d like to thank all the devs who put in the work creating this fantastic toolkit. It has been extremely helpful in the enterprise

What is the PSADT way of capturing output from the Add-WindowsCapability cmdlet and logging it using Write-Log. It’s in an object format. I’m assuming it needs to be converted to a string.

This is the output I’m trying to capture as an example.

You could look here for ideas:
Logging for non-PSADT commands - The Toolkit / Tips & Tricks - PSAppDeployToolkit Community

My guess is:

Get-WindowsCapability -Name *rsat -Online | Add-WindowsCapability -Online | out-string | Write-Log

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.