When I try to run the CLI script I get the following error:
Microsoft Windows [Version 10.0.19041.1237]
(c) Microsoft Corporation. All rights reserved.
C:\windows\system32>powershell -Command “& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString(‘https://platform.activestate.com/dl/cli/pdli01/install-latest.ps1’))) -c’state activate --default bvernham/ActivePython-3.8-2’”
New-Object : Cannot create type. Only core types are supported in this language mode.
At line:1 char:28
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
Don’t run this as Administrator. It does not install the way you’re thinking it will. This install command will give you a virtual runtime, suitable for doing Python coding.
You might want a different installation command, or your use case might require an older version of Python for older versions of Windows.
If you’re on Windows Server 2016, see the forum posts for configuring your version of Powershell to support TLS 1.2, which it will not do out of the box. You may also need to set variable that allow the command line to get out past your firewall or proxy server.
I am doing what is says in the ActiveState website to install ActivePython.
"Install via Command Line
Run the following command in the Command Prompt (cmd.exe)
powershell -Command “& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString(‘https://platform.activestate.com/dl/cli/pdli01/install-latest.ps1’))) -c’state activate --default bvernham/Python-3.9.9-Windows’”
This command installs the State Tool package manager, which then intalls lets you manage your runtime. Find tips on managing your runtime in the CLI with our State Tool Cheat Sheet"
This say it installs the “State Tool” but I can not even to this.
Trying installing just the State Tool. Open a cmd.exe window as your normal userID, and enter this:
powershell -Command “& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString(‘https://platform.activestate.com/dl/cli/install.ps1’)))”
FullyQualifiedErrorId : CannotCreateTypeConstrainedLanguage,Microsoft.PowerShell.Commands.NewObjectCommand
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
That at least isolates the problem a bit more. It looks like you have GPO set which is forcing Powershell into Constrained Language Mode. Can you find that and turn it off? Or find a way to start it in full language mode?