I defined a function to append a title to an output file.
function appendTitle($filePath, [string]$title){
Add-Content -Path $filePath -Value "+------------------------+"
Add-Content -Path $filePath -Value $title
Add-Content -Path $filePath -Value "+------------------------+"
}
The issue is that if I run it as such:
appendTitle($filePath, "Net Accounts")
But in the output file it doesn't include the $title variable but just displays:
+------------------------+
+------------------------+
So where did my variable go that I wanted to append?