I am trying to test my PowerShell code using Pester. I want to mock out-file for the following line:

$interactiveContent | Out-File -Append -FilePath (Join-Path $destDir $interactiveOutputFile)

But I want to give my own file path while testing.

I have tried the following:

Mock Out-File { $destDir = 'c:\snmp_poc_powershell\' $interactiveOutputFile = 'abc.csv' }

but it is not working.