I am running a script which has $FileName variable containing the absolute path with spaces. Due to the space within the directory name and file name, the script fails to ex
fastest solution (but a bit ugly) to add quotes around any string:
$dir = "c:\temp" $file = "myfile" $filepath = [string]::Join("", """", $dir,"\", $file, ".txt", """")