You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
&: 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
The text was updated successfully, but these errors were encountered:
Please see the setting powershell.powerShellAdditionalExePaths to configure additional PowerShell executables to run with the PowerShell extension. Please note our official support statement in the README that the extension is supported only where PowerShell is supported, and that excludes custom builds of PowerShell if you in fact have one. It may work, but we will not take any action to fix it for anything that isn't reproducible on a standard PowerShell build.
As to your initial script, the PowerShell extension code host has its own profile file at $profile.currentusercurrenthost. You may want to consider adding your "init" script to that profile, since that's what the profile is.
I'm new in PowerShell. Adding a profile file in $PSHome/profile.ps1 and using a variable to specify where to load the init file, I resolved the problem.
Uh oh!
There was an error while loading. Please reload this page.
Prerequisites
Summary
I'm using a custom powershell profile:
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 thePowerShell 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 ofPowerShell Extension
?Thanks!
PowerShell Version
Visual Studio Code Version
Extension Version
[email protected]
Steps to Reproduce
Error:
The error occurred because
$asTasks
not found.Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: