trying to open some documents, but some of the filenames have spaces in them,
and i'm not able to get invoke-expression to properly read it. I've tried
messing around with quotes, double quotes, parenthesis, etc, but can't seem
to get it to work...invoke expression stops reading the variable where the
first space in the path is...
here's the code snippet...
$files = @(get-childitem $searchpath | ? {$_.extension -match "pdf"})
foreach ($document in $files) {
write-host $document.fullname
invoke-expression $document.fullname
}
i've also just tried using $searchpath\$document instead of
$document.fullname. Neither work.
Thanks for your help!!


