Spaces cause split in path with PowerShell

前端 未结 12 863
广开言路
广开言路 2020-12-02 15:24

I\'m having an issue with powershell when invoking an exe at a path containing spaces.

PS C:\\Windows Services> invoke-expression \"C:\\Windows Services\\My

12条回答
  •  悲&欢浪女
    2020-12-02 15:46

    For any file path with space, simply put them in double quotations will work in Windows Powershell. For example, if you want to go to Program Files directory, instead of use

    PS C:\> cd Program Files
    

    which will induce error, simply use the following will solve the problem:

    PS C:\> cd "Program Files"
    

提交回复
热议问题