The issue I'm facing is logging the output of a function being called inside the powershell workflow into a logfile.
Tried using Out-File but it is not supposed to be used for logging a specific function call.
Any help on this would be great. Thanks in advance.
Attached is the sample script regarding the issue:
function test1{
param (
[String] $FileName)
Write-Host "$FileName test1"
}
WorkFlow Sample {
$Files = Get-ChildItem 'C:\Users\Downloads\testDir'
Foreach -parallel ( $File in $Files ) {
test1($File) #This function output should be logged
}
}
Sample