Can someone explain why there are different outputs here? I'm trying to simply concat a path with a filename. For some reason, this works fine on the cmd line, but things are out of order in the FN.
function testConcat ($path, $fileName) {
$testConat2 = "$path\$fileName.txt"
write-host $testConat2
}
cd c:\temp
$pathParam = get-location
$fileNameParam = "test"
$testConat1 = "$pathParam\$fileNameParam.txt"
write-host $testConat1 #outputs C:\temp\test.txt
testConcat ($pathParam, $fileNameParam) #outputs C:\temp test\.txt