Skip to content

The extension conflicts with my custom PowerShell profile #5146

Closed
@ylazy

Description

@ylazy

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

I'm using a custom powershell profile:

"terminal.integrated.profiles.windows":
{
    "ActionScript Debug Terminal":
    {
        "overrideName":true,
        "icon": "terminal-powershell",
        "color": "terminal.ansiMagenta",
        "path": "Y:/Development/ActionScript/SDK/Ylazy/Application/NativeProcess/PowerShell/bin/Windows/pwsh.exe",
        "args":
        [
            "-NoProfile",
            "-NoLogo",
            "-NoExit",
            "-ExecutionPolicy",
            "ByPass",
            "-Command",
            ". \"${execPath}${/}..${/}..${/}Data${/}Tasks${/}ActionScript${/}init.ps1\""
        ],
        
    }
}
"terminal.integrated.defaultProfile.windows": "ActionScript Debug Terminal",

The init.ps1 does some tasks and create some initial variables for using in sub scripts.

Whenever I run a shell script via the Command Runner, the script file no longer runs on my powershell profile. Instead, it runs on the PowerShell Extension profile. Thus, these initial variables are not available, so the extension show me errors.

How to config your extension to use my custom profile ActionScript Debug Terminal instead of PowerShell Extension?

Thanks!

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
GitCommitId                    7.5.0
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Name             : Visual Studio Code Host
Version          : 2025.0.0
InstanceId       : fb59126e-695b-4889-9b61-0fea15ff61b4
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.97.2
e54c774e0add60467559eb0d1e229c6452cf8447
x64

Extension Version

Steps to Reproduce

 & "$asTasks/reveal-workspace-folder.ps1"

Error:

&: The term '/reveal-workspace-folder.ps1' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

The error occurred because $asTasks not found.

Visuals

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions