I have a query like when I try to execute the expression which contains a path with space, I am getting an error as below.
Code:
$path="E:\Test\My space\Log"
Invoke-Expression $path
E:\Test\My: The term 'E:\test\My' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ E:\Test\My space\Log
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (E:\Test\My :String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Could you please help me to fix this issue.?