Latest Windows Install instructions do not work - gives Powershell errror

Install instructions through this following error, on Windows 2021 r2. What can I do?

C:\Users\Administrator>powershell -Command “& $([scriptblock]::Create((New-Objec
t Net.WebClient).DownloadString(‘https://platform.activestate.com/dl/cli/install
.ps1’))) -activate-default ActiveState/Perl-5.32”

Exception calling “DownloadString” with “1” argument(s): “The underlying
connection was closed: An unexpected error occurred on a send.”
At line:1 char:5

  • & $([scriptblock]::Create((New-Object Net.WebClient).DownloadString(’ …
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:slight_smile: , MethodInvocationException
    • FullyQualifiedErrorId : WebException

The expression after ‘&’ in a pipeline element produced an object that was not
valid. It must result in a command name, a script block, or a CommandInfo
object.
At line:1 char:3

  • & $([scriptblock]::Create((New-Object Net.WebClient).DownloadString(’ …
  • + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : BadExpression
    
    

Has anyone else had this problem?

Hi beladinsec,

I assume this was Windows Server 2012 r2. I have passed it along to the team to see if there are any compatibility issues with this version.

Cheers,

-JR

Your server is using an old version of Powershell and TLS support is not enabled by default.

You can enable it with an additional command.

1 Like

That error still occurs on Windows 11 using Powershell 7

PS C:\Program Files\PowerShell\7> powershell -Command “& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString(‘https://platform.activestate.com/dl/cli/671895999.1648669923_pdli01/install-latest.ps1’))) -c’state activate --default mikes-xxxxx/Python-3.9.10-Windows’”
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: (:slight_smile: , ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingExpression

Hey @mikes-bluef – it looks like you’re running the script from within the PowerShell shell, can you try pasting the command into just a regular cmd.exe prompt? Because it calls out to Powershell, it’s designed to be run from a Command Prompt rather than directly within Powershell.