question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors that occur when loading profile scripts aren't written to the console

See original GitHub issue

System Details

  • Operating system name and version: Windows 10 Pro
  • VS Code version: 1.11.2
  • PowerShell extension version: 0.12.2
  • Output from $PSVersionTable:
PS C:\GitHub\dbatools> code -v
1.11.2
6eaebe3b9c70406d67c97779468c324a7a95db0e
PS C:\GitHub\dbatools>
PS C:\GitHub\dbatools> $pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
0      12     1      0


PS C:\GitHub\dbatools>
PS C:\GitHub\dbatools> code --list-extensions --show-versions
eamodio.gitlens@3.4.5
gerane.Theme-Blackboard@0.0.2
gerane.Theme-earthsong-light@0.0.2
LaurentTreguier.vscode-simple-icons@1.2.0
michelemelluso.gitignore@1.0.1
ms-mssql.mssql@0.3.0
ms-vscode.PowerShell@0.12.2
ms-vscode.wordcount@0.1.0
RolandGreim.sharecode@0.4.0
sensourceinc.vscode-sql-beautify@0.0.4
Shan.code-settings-sync@2.6.2
swyphcosmo.spellchecker@1.2.13
tinaciousdesign.theme-tinaciousdesign@0.2.4
Tyriar.theme-sapphire@0.1.0
PS C:\GitHub\dbatools>
PS C:\GitHub\dbatools> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.1066
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.1066
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

Running VS Code the initial terminal that is started for PowerShell showing as “1: PowerShell Integrated Console” does not load my user profile. This is with powershell.enableProfileLoading set to true.

Although if I start a new terminal for PowerShell I can see that my profile does get loaded.

Attached Logs

Logs.zip

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:36 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
daviwilcommented, May 17, 2017

Hey Shawn, it turns out that errors that occur while loading your profile script aren’t currently being written to the console. I can confirm that profile.ps1 does get loaded so you’ve probably just got an error in that profile that isn’t showing up in the console. I’m fixing the error writing issue for tomorrow’s update.

0reactions
casstacommented, Jul 7, 2017

@daviwil, I’m sorry, my bad. Not sure why I didn’t realize it earlier, but as I use by default 64-bit version of Powershell I simply missed that VSCode is “just” 32-bit application, therefore working with profiles in SYSWOW64. Once profile was replicated to expected location everything started to work fine. Sorry for any inconvenience caused.

Read more comments on GitHub >

github_iconTop Results From Across the Web

1073741502" Stop error when many PowerShell scripts call ...
This issue is caused by an error in the Microsoft.powershell.consolehost.dll file. When a Windows PowerShell script calls the Console.Write method, or when you ......
Read more >
Fix for PowerShell Script cannot be loaded because running ...
Open PowerShell Console by selecting “Run as Administrator” and get the execution Policy with the command: Get-ExecutionPolicy to get the ...
Read more >
Powershell profile.ps1 cannot be loaded because its ...
File C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1 cannot be loaded because its operation is blocked by software restriction policies. For more ...
Read more >
PowerShell profile does not load - Super User
Solution: change execution policy. Launch PowerShell as administrator; Set-ExecutionPolicy -ExecutionPolicy Unrestricted. The error message ...
Read more >
The associated script cannot be loaded - Unity Forum
There is not any compiling errors in them but i cant even see them ... be loaded, please fix any compile errors and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found