I want to run a PowerShell command from cmd, because I need to install the Chocolatey package manager from my Python script. Like this:
import subprocess as sp
choco = sp.Popen(['powershell', 'Start-Process -verb runas powershell',
'"-noexit -command Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString(`https://chocolatey.org/install.ps1`)"'])
The problem is the URL must be in quotes and if I use URL '
or "
this will unquote the URL.
I want to run the Chocolatey install command. I don’t want run a PowerShell script. I just want to run install Chocolatey and then I want to install some Chocolatey packages.