Skip to content

Scripts fail to launch if working directory path contains spaces #149

Closed
@rkeithhill

Description

@rkeithhill

Example: D:\powershell code\Get-Something.ps1 will fail to launch with the following error:

d:\powershell : The term 'd:\powershell' 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
•d:\powershell code\Get-OutlookPublicFolders.ps1
•~~~~~~~~~~~~~ ◦CategoryInfo : ObjectNotFound: (d:\powershell:String) [], CommandNotFoundException
◦FullyQualifiedErrorId : CommandNotFoundException

launch.json contains the default settings (as of 0.4.0 release of Powershell extension):

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "PowerShell",
            "type": "PowerShell",
            "request": "launch",
            "program": "${file}",
            "args": [],
            "cwd": "${file}"
        }
    ]
}

I have also tried placing the full path name in the cwd parameter, using escaped double quotes, single quotes, etc.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions