Skip to content

Instantly share code, notes, and snippets.

@devkabir
Forked from czerspalace/InstallWpCli.ps1
Created September 28, 2023 05:22
Show Gist options
  • Select an option

  • Save devkabir/28d5322790525ef3dbd792814e3cbdf2 to your computer and use it in GitHub Desktop.

Select an option

Save devkabir/28d5322790525ef3dbd792814e3cbdf2 to your computer and use it in GitHub Desktop.
Use Powershell to install wp-cli
$cliDir = "c:\wp-cli\"
mkdir $cliDir
$cliFilePath = $cliDir + "wp-cli.phar";
(New-Object System.Net.WebClient).DownloadFile("https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar", $cliFilePath)
$batchFile = $cliDir + "wp.bat";
Set-Content $batchFile "@ECHO OFF","php `"c:/wp-cli/wp-cli.phar`" %*"
#Need to set path here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment