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.