Closed
Description
The integrated scripting environment will not run any function block code.
This started as of the last few VScode and OS updates.
Complete uninstall, reinstalls done, multiple times, using ia32 and x64 versions after manual registry cleanup of all VScode, Visual Studio Code keys and data.
Sample quick function
function new-test ($name)
{
$name
}
new-test -name 'tester'
(Get-CimInstance -ClassName CIM_OperatingSystem).Caption
$Host
code -v
$pseditor.EditorServicesVersion
code --list-extensions --show-versions
$PSVersionTable
### Issue Description
PowerShell Integrated Console
(Get-CimInstance -ClassName CIM_OperatingSystem).Caption
Microsoft Windows 10 Pro
PS C:\Users\postanote> $Host
Name : Visual Studio Code Host
Version : 1.5.1
InstanceId : 22c91ac4-8014-466f-afeb-fbd147dea1e2
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData :
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
PS C:\Users\postanote> code -v
1.19.3
7c4205b5c6e52a53b81c69d2b2dc8a627abaa0ba
ia32
PS C:\Users\postanote> $pseditor.EditorServicesVersion
Major Minor Build Revision
----- ----- ----- --------
1 5 1 0
PS C:\Users\postanote> code --list-extensions --show-versions
abusaidm.html-snippets@0.2.1
alefragnani.Bookmarks@0.18.1
alefragnani.project-manager@0.24.0
AndersEAndersen.html-class-suggestions@1.0.7
bitzl.vscode-puppet@0.4.5
Borke.puppet@0.3.2
bradgashler.htmltagwrap@0.0.7
capaj.vscode-exports-autocomplete@0.5.4
christian-kohler.path-intellisense@1.4.2
DavidAnson.vscode-markdownlint@0.13.0
dbaeumer.vscode-eslint@1.4.5
DotJoshJohnson.xml@1.9.2
DougFinke.vscode-PSStackoverflow@0.0.2
eamodio.gitlens@7.5.10
ecmel.vscode-html-css@0.2.0
formulahendry.code-runner@0.8.7
HookyQR.beautify@1.3.0
ms-mssql.mssql@1.3.0
ms-python.python@2018.1.0
ms-vscode.cpptools@0.14.6
ms-vscode.csharp@1.13.1
ms-vscode.PowerShell@1.5.1
msjsdiag.debugger-for-chrome@4.1.0
msjsdiag.debugger-for-edge@0.4.1
Pendrica.chef@0.6.4
pranaygp.vscode-css-peek@2.1.0
qinjia.view-in-browser@0.0.5
robertohuertasm.vscode-icons@7.19.0
sidthesloth.html5-boilerplate@1.0.1
tht13.python@0.2.3
Tyriar.theme-sapphire@0.2.1
waderyan.gitblame@2.2.0
PS C:\Users\postanote> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.16299.98
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.98
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Simple function shows these errors.
PS C:\Users\postanote> function new-test ($name)
Missing function body in function declaration.
At line:0 char:0
PS C:\Users\postanote> {
Missing closing '}' in statement block or type definition.
At line:0 char:0
PS C:\Users\postanote> $name
PS C:\Users\postanote> }
At line:1 char:1
+ }
+ ~
Unexpected token '}' in expression or statement.
PS C:\Users\postanote> new-test -name 'tester'
new-test : The term 'new-test' 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
+ new-test -name 'tester'
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (new-test:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
### Attached Logs
Follow the instructions in the [README](https://github.com/PowerShell/vscode-powershell#reporting-problems)
about capturing and sending logs.
Metadata
Metadata
Assignees
Labels
No labels