我有一个查询,例如当我尝试执行包含带空格的路径的表达式时,出现如下错误。
代码:
$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
Run Code Online (Sandbox Code Playgroud)
你能帮我解决这个问题吗?