Skip to content

"Unexpected Token" errors importing PowerShellNotebook (version 2.9.3) #57

@jrobiii-trs

Description

@jrobiii-trs

I was installing PowerShellNotebook from PSGallery without MinVersion/MaxVersion and recieved version 2.9.3

Get-Module PowerShellNotebook -ListAvailable


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.9.3      PowerShellNotebook                  {Add-NotebookCode, Add-NotebookMarkdown, Convert-MarkdownT...

When I tried to import the module I recieved the following:

> Install-Module PowerShellNotebook -Scope AllUsers -Repository PSGallery

> Import-Module PowerShellNotebook
At C:\Program Files\WindowsPowerShell\Modules\PowerShellNotebook\2.9.3\New-InteractiveNotebook.ps1:14 char:102
+ ... ls.dotnet-interactive-vscode/newNotebook?as={0}" -f ($AsDib ? 'dib':' ...
+                                                                 ~
Unexpected token '?' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellNotebook\2.9.3\New-InteractiveNotebook.ps1:14 char:101
+ ... ools.dotnet-interactive-vscode/newNotebook?as={0}" -f ($AsDib ? 'dib' ...
+                                                                  ~
Missing closing ')' in expression.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellNotebook\2.9.3\New-InteractiveNotebook.ps1:1 char:34
+ function New-InteractiveNotebook {
+                                  ~
Missing closing '}' in statement block or type definition.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellNotebook\2.9.3\New-InteractiveNotebook.ps1:14 char:117
+ ... t-interactive-vscode/newNotebook?as={0}" -f ($AsDib ? 'dib':'ipynb'))
+                                                                        ~
Unexpected token ')' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellNotebook\2.9.3\New-InteractiveNotebook.ps1:14 char:118
+ ... t-interactive-vscode/newNotebook?as={0}" -f ($AsDib ? 'dib':'ipynb'))
+                                                                         ~
Unexpected token ')' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellNotebook\2.9.3\New-InteractiveNotebook.ps1:15 char:1
+ }
+ ~
Unexpected token '}' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken

This was with Windows PowerShell 5.1

I've reverted to version 2.9.1 and was able to import PowerShellNotebook successfully.

Please let me know if I can provide any further information.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions