Recently started trying to use Jupyter notebooks in VScode and writing PowerShell scripts. If I try something as simple as Import-module ‘modulename’ and then try to click the run arrow, I get syntaxError: invalid syntax and its highlighting the name of the module. But if I highlight the line manually and right click and say Run Selection it processes the line correctly and no errors show up. Again, new to this software any help is greatly apricated.
Jupyter notebooks in VScode
These are not maintained by Jupyter community, so you may find more luck asking someone from Microsoft for help. That said, it looks like it is interpreting your code as Python rather than PowerShell. Maybe you need to change kernel to one supporting PowerShell?
1 Like