Skip to content

Instantly share code, notes, and snippets.

@csarron
Created May 31, 2018 07:52
Show Gist options
  • Save csarron/196c52f392bc47a731fc0833fcdb4e73 to your computer and use it in GitHub Desktop.
Save csarron/196c52f392bc47a731fc0833fcdb4e73 to your computer and use it in GitHub Desktop.
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
if (!(Get-Command choco -errorAction SilentlyContinue))
{
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Confirm:$false
"choco not exists or not installed, begin installing chocolatey..."
$script = New-Object Net.WebClient
$script | Get-Member
$script.DownloadString("https://chocolatey.org/install.ps1")
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
}
choco install -y python googlechrome chromedriver
$env:Path += ";C:\Python36"
refreshenv
python -V
python -m pip install --upgrade pip
pip install selenium
$py_script = Join-Path $PSScriptRoot taobao_rename.py
python $py_script
Pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment