Perl Script Errors

Just installed the new powershell:

Name Value


PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Microsoft Windows 10.0.19042
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0At line:1 char:1

But still get this error installing PERL with the posted script:

  • & # Copyright 2019-2021 ActiveState Software Inc. All rights reserved …
  • ~
    Missing expression after ‘&’ in pipeline element.
    At line:1 char:71
  • … # Copyright 2019-2021 ActiveState Software Inc. All rights reserved.
  •                                                                      ~
    

Unexpected token ’
’ in expression or statement.
At line:18 char:41

  • $script:SESSION_TOKEN_VERIFY = -join ({, TOKEN, })
  •                                     ~
    

Missing expression after unary operator ‘,’.
At line:18 char:42

  • $script:SESSION_TOKEN_VERIFY = -join ({, TOKEN, })
  •                                      ~~~~~
    

Unexpected token ‘TOKEN’ in expression or statement.
At line:18 char:47

  • $script:SESSION_TOKEN_VERIFY = -join ({, TOKEN, })
  •                                           ~
    

Missing argument in parameter list.
At line:20 char:31

  • $script:SESSION_TOKEN_VALUE = "
  •                           ~
    

The string is missing the terminator: ".
+ CategoryInfo : ParserError: (:slight_smile: , ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingExpression


Hi @KMSmith222 - can you share which script you are running, or maybe the link to the project where you got the script? In the meantime, I’ll share this post with the CLI team in case they can tell what’s wrong.

Cheers.

You should probably stick to Powershell 5.1.x.
Version 5.1.19041.1320 is what we’re using as the current baseline. Powershell 6 and 7 have cross-platform features, but are not universally compatible with the back catalog of Powershell 5 commandlets.

I think my problem is the same as the OP’s. I’m trying to install ActivePerl-5.28 on Windows .
I’ve copied - from ActiveState - the command:

powershell -Command "& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://platform.activestate.com/dl/cli/pdli01/install-latest.ps1'))) -c'state activate --default PixJohn/ActivePerl-5.28'"

The error I get is as follows:

At line:1 char:1
\+ & # Copyright 2019-2021 ActiveState Software Inc. All rights reserved ...
\+ ~
Missing expression after '&' in pipeline element.
At line:1 char:71
\+ ...  # Copyright 2019-2021 ActiveState Software Inc. All rights reserved.
\+                                                                          ~
Unexpected token '
' in expression or statement.
At line:18 char:41
\+ $script:SESSION_TOKEN_VERIFY = -join ({, TOKEN, })
\+                                         ~
Missing expression after unary operator ','.
At line:18 char:42
\+ $script:SESSION_TOKEN_VERIFY = -join ({, TOKEN, })
\+                                          ~~~~~
Unexpected token 'TOKEN' in expression or statement.
At line:18 char:47
\+ $script:SESSION_TOKEN_VERIFY = -join ({, TOKEN, })
\+                                               ~
Missing argument in parameter list.
At line:20 char:31
\+ $script:SESSION_TOKEN_VALUE = "
\+                               ~
The string is missing the terminator: ".
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingExpression

My Powershell version is 5.1 Build 19041 Rev 1320

I have the exact same problem. My powershell version is the requested 5.1.19041.1320.

Is your network set up to allow the commandline to get out?

Are you on Windows 2016?