Powershell Debugger Not Loading all Modules : Get-StartApps is not recognized as the name of a cmdlet, function, script file, or operable program
See original GitHub issueSystem Details Output
### Operating System:
Windows 10 Home, 64bit, Verson 1809, OSbuild 17763.475
### VSCODE version:
1.33.1
51b0b28134d51361cf996d2f0a1c698247aeabd8
x64
### PSES version: 1.12.1.0
### PowerShell version:
Name Value
---- -----
PSVersion 5.1.17763.316
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.316
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
### VSCode extensions:
Atishay-Jain.All-Autocomplete@0.0.18
christian-kohler.path-intellisense@1.4.2
codezombiech.gitignore@0.6.0
CoenraadS.bracket-pair-colorizer-2@0.0.28
dbaeumer.vscode-eslint@1.8.2
eamodio.gitlens@9.7.3
EditorConfig.EditorConfig@0.13.0
formulahendry.auto-close-tag@0.5.6
formulahendry.auto-rename-tag@0.0.15
formulahendry.code-runner@0.9.9
ghmcadams.lintlens@2.3.0
karigari.chat@0.15.4
max-SS.Cyberpunk@1.2.3
mechatroner.rainbow-csv@1.0.0
ms-vscode.atom-keybindings@3.0.6
ms-vscode.cpptools@0.23.0
ms-vscode.powershell@1.12.1
ms-vscode.vscode-typescript-tslint-plugin@1.0.0
ms-vsliveshare.vsliveshare@1.0.181
ms-vsliveshare.vsliveshare-audio@0.1.50
ms-vsliveshare.vsliveshare-pack@0.2.12
msjsdiag.debugger-for-chrome@4.11.3
Orta.vscode-jest@2.9.2
pflannery.vscode-versionlens@0.23.0
vscode-icons-team.vscode-icons@8.6.0
wix.vscode-import-cost@2.12.0
yahya-gilany.vscode-clock@1.0.1
Issue Description
When running the powershell debugger with this one line script:
Get-StartApps
I get the following error message:
Get-StartApps : The term 'Get-StartApps' 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 C:\Users\clifford\Desktop\powershell-scripts\cato-scripts\test.ps1:1 char:1
+ Get-StartApps
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-StartApps:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
However, when I run Get-StartApps
inside my Powershell GUI (Windows Powershell or Windows Powershell ISE), it works fine.
Interestingly, running Get-StartApps
through the code runner extension works fine, as I’m able to get the result output shown below:
Name AppID
---- -----
Narrator {1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\narrator.exe
Notepad {1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\notepad.exe
ODBC Data Sources (64-bit) {1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\odbcad32.exe
I’m thinking it has to do a difference in environment, since when I run code runner on the file with this, I get back 30 results (which include Get-StartApps
, Also the output of Code runner shows that the file is being run like this powershell -ExecutionPolicy ByPass -File "c:\Users\clifford\Desktop\powershell-scripts\cato-scripts\tempCodeRunnerFile.ps1"
(Get-Command Get-St*).length #30
But when I run the VScode debugger, I get 29 as my result:
(Get-Command Get-St*).length #29 (the collection is missing `Get-StartApps`)
Expected Behaviour
- should load all cmd-lets
- should autocomplete command
Actual Behaviour
VS Code poweshell debugger is not loading all the cmd-lets
VS Code powershell is not autocompleting/loading the cmd-let Get-StartApps
when I start typing it out, despite it showing up as automcompleting in Powershell.ise GUI program.
Attached Logs
1557790997-0da62f65-1607-40b3-af0e-5f62626b25811557790144671.zip
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top GitHub Comments
I notice the second set of modules lists from the
x86
module path. I think you might be running in 32-bit Windows PowerShell in VSCode.You need to use the PowerShell picker in the bottom right to select
x64
PowerShell. If you click on it, a menu will appear at the top of the Window. You then need to selectSwitch to: Windows PowerShell (x64)
ipomo StartLayout
inside Powershell ISE is no output so it works thereipmo StartLayout
inside VScode:SOLUTION:
Poweshell was running in 32bit mode
(x86)
instead of 64bit(x64)
. Once I changed it tox64
everything worked!Thanks!