Concatenating Variables within Powershell

You can use Join-Path and it will put in the directory slash for you.

$objWorkbook = $objExcel.Workbooks.Open (Join-Path $Log_path $Log_name)

It handles the logic if $Log_Path parent already has or doesn't have the slash.

>join-path c:\temp test.txt
c:\temp\test.txt

>join-path c:\temp\ text.txt
c:\temp\test.txt

$path = "C:\folder"
$name = "file.exe"
$fullname = $path + "\" + $name
$fullname

(or)

$fullname = "$path\$name"

but not

$fullname = '$path\$name'

Output

C:\folder\file.exe