-
Notifications
You must be signed in to change notification settings - Fork 513
Suppress platform-specific parse errors #301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Have the same issue ;( |
Me too |
Hi @JasonMorgan, @mrvladis, @mmclane would you be able to provide an example of:
The difficulty I see here is that not only will a workflow not run in PowerShell Core 6, but it won't even parse (i.e. PowerShell Core 6 itself will refuse to parse any input with a workflow in it). Since the extension relies on PowerShell to parse and provide completions for scripts, enabling workflows may involve disabling a good deal of extension functionality. |
I haven't done a lot with workflows but in working with Azure Automation I find myself needing to work with them. Not that I will be running them on my local machine. Instead I am writing a template that terraform renders into a working script. I change the langues from Plain Text to Powershell so that I can get the syntax highlighting and what not, but its all marked as red because of the workflow statements. It doesn't matter what the script is, as soon as I wrap it in a workflow statement I get a problem and everything in that statement is marked as red. What would be better is if it marked the workflow statement as red but not everything inside it. What would be better still is if I could mark that problem to be ignored. What I could live with is knowing how to disable [PowerShell] problems from being evaluated on that file. Make sense? |
I am using Code version 1.25.1 Name Value PSVersion 6.0.2 |
You can switch to a "Windows PowerShell" session if you're on Windows or disable code analysis since it is PSScriptAnalyzer that generates that (parse) error e.g.:
Open up your user or workspace settings and add this setting:
Short of disabling script analysis, there is nothing this extension can do. There is not even a PSSA rule we can ignore since it is a "parse" error. I suggest filing an issue with PSSA https://github.com/powershell/scriptanalyzer. |
Ah cool! Yeah, I saw you're on macOS, and it does make sense that you might want to develop for scenarios off-platform. Like @rkeithhill says, disabling analysis is the best workaround for now. Another thing worth noting is that there is an (old) issue open for turning parse errors into something more ignorable: PowerShell/PSScriptAnalyzer#264. I know I've discussed this with @JamesWTruher as well. |
Is there a workaround this yet? |
Please fill in these details so that we can help you!
System Details
$PSVersionTable
:Issue Description
workflow statements present an error and I can't seem to suppress it. I understand workflow won't run but I want to author them without an error. It'd be nice if I had the option to suppress or ignore it.
The text was updated successfully, but these errors were encountered: