<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Driss</title>
    <description>The latest articles on Forem by Driss (@drissboumlik).</description>
    <link>https://forem.com/drissboumlik</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F135280%2F35d38cc0-921a-4ce1-bcbd-7d515ea43907.jpeg</url>
      <title>Forem: Driss</title>
      <link>https://forem.com/drissboumlik</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/drissboumlik"/>
    <language>en</language>
    <item>
      <title>PVM - PHP Version Manager for Windows</title>
      <dc:creator>Driss</dc:creator>
      <pubDate>Mon, 19 Jan 2026 00:25:21 +0000</pubDate>
      <link>https://forem.com/drissboumlik/pvm-php-version-manager-for-windows-4gnk</link>
      <guid>https://forem.com/drissboumlik/pvm-php-version-manager-for-windows-4gnk</guid>
      <description>&lt;p&gt;Original link to the article : &lt;a href="https://drissboumlik.com/blog/pvm-php-version-manager-for-windows?ref=dev.to"&gt;Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Managing multiple PHP versions on Windows has traditionally been a challenging task for developers. Enter PVM (PHP Version Manager), a command-line tool specifically designed to simplify PHP version management on Windows systems. This comprehensive guide will walk you through everything you need to know about PVM, from installation to advanced usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is PVM ?
&lt;/h2&gt;

&lt;p&gt;PVM is a powerful, command-line PHP version manager built specifically for Windows environments, it addresses the unique challenges Windows developers face when working with multiple PHP versions. What sets PVM apart is its comprehensive approach - it doesn't just manage PHP versions, but also handles extensions, php.ini configurations, and environment variables seamlessly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Project Structure Overview
&lt;/h3&gt;

&lt;p&gt;PVM follows a well-organized structure that separates concerns and maintains clean code architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm/
├── pvm.bat                 &lt;span class="c"&gt;# Main executable entry point&lt;/span&gt;
├── src/
│   ├── actions/            &lt;span class="c"&gt;# Core functionality modules&lt;/span&gt;
│   │   ├── setup.ps1       &lt;span class="c"&gt;# Installation and setup logic&lt;/span&gt;
│   │   ├── install.ps1     &lt;span class="c"&gt;# PHP version installation&lt;/span&gt;
│   │   ├── use.ps1         &lt;span class="c"&gt;# Version switching logic&lt;/span&gt;
│   │   ├── ini.ps1         &lt;span class="c"&gt;# PHP configuration management&lt;/span&gt;
│   │   └── ...             &lt;span class="c"&gt;# Other action modules&lt;/span&gt;
│   ├── core/               &lt;span class="c"&gt;# Core system components&lt;/span&gt;
│   │   ├── config.ps1      &lt;span class="c"&gt;# Configuration management&lt;/span&gt;
│   │   └── router.ps1      &lt;span class="c"&gt;# Command routing logic&lt;/span&gt;
│   ├── functions/          &lt;span class="c"&gt;# Utility functions&lt;/span&gt;
│   └── pvm.ps1             &lt;span class="c"&gt;# Main PowerShell entry point&lt;/span&gt;
└── tests/                  &lt;span class="c"&gt;# Test suite directory (Pester tests)&lt;/span&gt;
└── storage/                &lt;span class="c"&gt;# Data and logging directory&lt;/span&gt;
    ├── data/               &lt;span class="c"&gt;# Cached data and configurations&lt;/span&gt;
    ├── logs/               &lt;span class="c"&gt;# Error logs and backups&lt;/span&gt;
    └── php/                &lt;span class="c"&gt;# PHP installations directory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Automated Setup Process&lt;/strong&gt;: PVM now includes an intelligent setup command that handles PATH variable configuration automatically, eliminating manual environment setup.&lt;br&gt;
&lt;strong&gt;Seamless Version Switching&lt;/strong&gt;: Switch between PHP versions with a single command, making it easy to test applications across different PHP environments.&lt;br&gt;
&lt;strong&gt;Extension Management&lt;/strong&gt;: Built-in support for popular extensions like Xdebug and OPcache, with the ability to enable or disable them per installation.&lt;br&gt;
&lt;strong&gt;Direct php.ini Management&lt;/strong&gt;: Modify PHP settings and manage extensions directly from the command line without manually editing configuration files.&lt;br&gt;
&lt;strong&gt;Custom Installation Directories&lt;/strong&gt;: Install PHP versions in custom locations to suit your specific development setup.&lt;br&gt;
Online Version Discovery: Fetch available PHP versions directly from online sources, ensuring you always have access to the latest releases.&lt;br&gt;
&lt;strong&gt;Configuration Backup and Restore&lt;/strong&gt;: Automatic backup of PATH variables and php.ini settings with easy restoration options.&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Windows 10/11&lt;/li&gt;
&lt;li&gt;PowerShell 5.1 or later&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Installation &amp;amp; Setup
&lt;/h2&gt;

&lt;p&gt;Getting started with PVM has been significantly simplified with the new automated setup process:&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 1: Clone the Repository
&lt;/h3&gt;

&lt;p&gt;First, clone the PVM repository to your local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/drissboumlik/pvm
&lt;span class="nb"&gt;cd &lt;/span&gt;pvm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Automated Setup
&lt;/h3&gt;

&lt;p&gt;Run the setup command to automatically configure PVM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The setup process automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configures necessary environment variables&lt;/li&gt;
&lt;li&gt;Adds PVM to your system PATH&lt;/li&gt;
&lt;li&gt;Creates backup of your current PATH configuration&lt;/li&gt;
&lt;li&gt;Sets up the PHP version switching mechanism&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Command Reference
&lt;/h2&gt;

&lt;p&gt;PVM provides a comprehensive set of commands for managing your PHP installations and configurations:&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting Help
&lt;/h3&gt;

&lt;p&gt;Display all available commands and their descriptions, serving as your quick reference guide.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm &lt;span class="nb"&gt;help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Display help for a specific command with description, usage and examples&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm &lt;span class="nb"&gt;help&lt;/span&gt; &amp;lt;&lt;span class="nb"&gt;command&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="c"&gt;# Example : pvm help use&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Display information about the environment
&lt;/h3&gt;

&lt;p&gt;Display information about the current PHP (version, path, extensions, settings)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm info
pvm ini info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Display information about the current PHP extensions&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm info extensions &lt;span class="c"&gt;# pvm ini info extensions&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Display information about the current PHP settings&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm info settings &lt;span class="c"&gt;# pvm ini info settings&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Display information about the current PHP (version, path, extensions, settings) with specific &lt;code&gt;&amp;lt;term&amp;gt;&lt;/code&gt; in their name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm info &lt;span class="nt"&gt;--search&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;term&amp;gt; &lt;span class="c"&gt;# pvm ini info --search=&amp;lt;term&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;# Example : pvm info --search=cache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Checking Current Version
&lt;/h3&gt;

&lt;p&gt;Shows which PHP version is currently active on your system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm current
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Listing PHP Versions
&lt;/h3&gt;

&lt;p&gt;Display all PHP versions currently installed on your system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm list &lt;span class="c"&gt;# pvm ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List installed versions with specific version in the name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm list &lt;span class="nt"&gt;--search&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;version&amp;gt;
&lt;span class="c"&gt;# Example: pvm list --search=8.2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List installed versions matching x86 and nts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm list &lt;span class="o"&gt;[&lt;/span&gt;x86|x64] &lt;span class="o"&gt;[&lt;/span&gt;ts|nts] 
&lt;span class="c"&gt;# Example: pvm list x86 nts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;View all PHP versions available for installation from your configured sources.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm list available &lt;span class="c"&gt;# pvm ls available&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List installable PHP versions from remote source matching x86 and nts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm list available &lt;span class="o"&gt;[&lt;/span&gt;x86|x64] &lt;span class="o"&gt;[&lt;/span&gt;ts|nts] 
&lt;span class="c"&gt;# Example: pvm list available x86 nts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List available versions with specific version in the name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm list available &lt;span class="nt"&gt;--search&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;version&amp;gt;
&lt;span class="c"&gt;# Example: pvm list available --search=8.2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Installing PHP Versions
&lt;/h3&gt;

&lt;p&gt;Basic Installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm &lt;span class="nb"&gt;install&lt;/span&gt; &amp;lt;version&amp;gt; &lt;span class="c"&gt;# pvm i &amp;lt;version&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;# Example: pvm install 8.4 / pvm i 8.4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install a specific version for a specific arch &amp;amp; build type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm &lt;span class="nb"&gt;install&lt;/span&gt; &amp;lt;version&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt;x86|x64] &lt;span class="o"&gt;[&lt;/span&gt;ts|nts]
&lt;span class="c"&gt;# Example: pvm install 8.4 x64 nts # pvm i 8.4 x64 nts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install a specific PHP version. Replace &lt;code&gt;&amp;lt;version&amp;gt;&lt;/code&gt; with the desired version number (e.g., &lt;code&gt;7.4.33&lt;/code&gt; or &lt;code&gt;8.2.0&lt;/code&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm &lt;span class="nb"&gt;install &lt;/span&gt;auto &lt;span class="c"&gt;# pvm i auto&lt;/span&gt;
&lt;span class="c"&gt;# Install the php version specified on your project.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Uninstalling PHP Versions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm uninstall &amp;lt;version&amp;gt; &lt;span class="c"&gt;# pvm rm &amp;lt;version&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;# Example: pvm uninstall 8.4 # pvm rm 8.4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove a specific PHP version from your system cleanly, including all associated files and configurations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Switching Between Versions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm use &amp;lt;version&amp;gt; &lt;span class="c"&gt;# Example: pvm use 8.4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switch your active PHP version to the specified version, updating all necessary environment variables automatically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm use auto
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When run inside a PHP project, this command checks for a .php-version file and composer.json, then switches to the PHP version specified in either file.&lt;/p&gt;

&lt;h2&gt;
  
  
  PHP Configuration Management
&lt;/h2&gt;

&lt;p&gt;One of PVM's most powerful features is its ability to manage PHP configurations and extensions directly from the command line:&lt;/p&gt;

&lt;h3&gt;
  
  
  Extension Management
&lt;/h3&gt;

&lt;p&gt;Check extensions status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm ini status &amp;lt;extension&amp;gt; &lt;span class="c"&gt;# Example: pvm ini status xdebug opcache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable Extensions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm ini &lt;span class="nb"&gt;enable &lt;/span&gt;xdebug opcache &lt;span class="c"&gt;# Example: pvm ini enable xdebug opcache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Disable Extensions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm ini disable xdebug opcache &lt;span class="c"&gt;# Example: pvm ini disable xdebug opcache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  PHP Settings Management
&lt;/h3&gt;

&lt;p&gt;Set Configuration Values and change the status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm ini &lt;span class="nb"&gt;set&lt;/span&gt; &amp;lt;setting&amp;gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;value&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;--disable&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="c"&gt;# Default is enabling the setting&lt;/span&gt;
&lt;span class="c"&gt;# Example: pvm ini set memory_limit=512M max_file_uploads=20&lt;/span&gt;
&lt;span class="c"&gt;# Example: pvm ini set max_input_time=60 --disable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Get Configuration Values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm ini get &amp;lt;setting&amp;gt;
&lt;span class="c"&gt;# Example: pvm ini get memory_limit max_file_uploads&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install extensions from remote source&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm ini &lt;span class="nb"&gt;install&lt;/span&gt; &amp;lt;extension&amp;gt;
&lt;span class="c"&gt;# Example: pvm ini install opcache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List installed extensions&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm ini list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List available extensions from remote source&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm ini list available
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List installed extensions with 'zip' in their name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm ini list &lt;span class="nt"&gt;--search&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;extension&amp;gt;
&lt;span class="c"&gt;# Example: pvm ini list --search=zip&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List available extensions with 'zip' in their name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm ini list available &lt;span class="nt"&gt;--search&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;extension&amp;gt;
&lt;span class="c"&gt;# Example: pvm ini list available --search=zip&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restore Configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm ini restore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restore php.ini settings from backup, useful when you need to revert changes or start fresh.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check Logs:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm log &lt;span class="nt"&gt;--pageSize&lt;/span&gt;&lt;span class="o"&gt;=[&lt;/span&gt;number] &lt;span class="c"&gt;# Default value is 5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This one will help you check the log file in a readable way, with pagination.&lt;/p&gt;

&lt;h2&gt;
  
  
  Manage PHP Configuration Profiles
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Save current PHP configuration to a profile
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm profile save &amp;lt;name&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt;description]
&lt;span class="c"&gt;# Example: pvm profile save development&lt;/span&gt;
&lt;span class="c"&gt;# Example: pvm profile save production "Production configuration"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Load and apply a saved profile
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm profile load &amp;lt;name&amp;gt; &lt;span class="c"&gt;# Example: pvm profile load development&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  List all available profiles
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm profile list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Show detailed profile contents
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm profile show &amp;lt;name&amp;gt; &lt;span class="c"&gt;# Example: pvm profile show development&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Delete a profile
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm profile delete &amp;lt;name&amp;gt; &lt;span class="c"&gt;# Example: pvm profile delete old-profile&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Export profile to a JSON file
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm profile &lt;span class="nb"&gt;export&lt;/span&gt; &amp;lt;name&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt;path]
&lt;span class="c"&gt;# Example: pvm profile export development&lt;/span&gt;
&lt;span class="c"&gt;# Example: pvm profile export dev ./backup.json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Import profile from a JSON file
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm profile import &amp;lt;path&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt;name]
&lt;span class="c"&gt;# Example: pvm profile import ./my-profile.json&lt;/span&gt;
&lt;span class="c"&gt;# Example: pvm profile import ./profile.json custom-name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Profile Structure&lt;/strong&gt;: Profiles are stored as JSON files in &lt;code&gt;storage/data/profiles/&lt;/code&gt; and contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Popular/common PHP settings (key-value pairs with enabled/disabled state)&lt;/li&gt;
&lt;li&gt;Popular/common extensions (enabled/disabled state and type)&lt;/li&gt;
&lt;li&gt;Metadata (name, description, creation date, PHP version)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Only popular/common settings and extensions are saved in profiles. This keeps profiles focused and manageable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Tests
&lt;/h2&gt;

&lt;p&gt;Run tests against the PowerShell scripts in the repo — especially useful for contributors verifying changes before submitting a pull request:&lt;/p&gt;

&lt;h3&gt;
  
  
  Requirements
&lt;/h3&gt;

&lt;p&gt;To run tests with, you need to have the Pester testing framework installed. Pester is a testing framework for PowerShell.&lt;/p&gt;

&lt;p&gt;Open PowerShell as Administrator and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Install-Module&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Pester&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Force&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-SkipPublisherCheck&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 If prompted to trust the repository, type Y and press Enter.&lt;/p&gt;

&lt;p&gt;You can verify the installation with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Get-Module&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-ListAvailable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Pester&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Run the tests
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;files &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;files inside the tests/ directory&lt;span class="o"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;--coverage&lt;/span&gt;&lt;span class="o"&gt;[=&lt;/span&gt;&amp;lt;number&amp;gt;]] &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;--verbosity&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;None|Normal|Detailed|Diagnostic&lt;span class="o"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;--tag&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;tag&amp;gt;] &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;--sort&lt;/span&gt;&lt;span class="o"&gt;=[&lt;/span&gt;coverage|duration|file]]

&lt;span class="c"&gt;# Examples:&lt;/span&gt;
pvm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="c"&gt;# .......................... Runs all tests with Normal (default) verbosity.&lt;/span&gt;
pvm &lt;span class="nb"&gt;test &lt;/span&gt;use &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="c"&gt;# .............. Runs only 'use.tests.ps1' and 'install.tests.ps1' files with Normal verbosity.&lt;/span&gt;
pvm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--verbosity&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Detailed &lt;span class="c"&gt;# ..... Runs all tests with Detailed verbosity.&lt;/span&gt;
pvm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--coverage&lt;/span&gt; &lt;span class="c"&gt;# ............... Runs all tests and generates coverage report (target: 75%)&lt;/span&gt;
pvm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--coverage&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;80.5 &lt;span class="c"&gt;# .......... Runs all tests and generates coverage report (target: 80.5%)&lt;/span&gt;
pvm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--sort&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;duration &lt;span class="c"&gt;# .......... Runs all tests and sort results by duration&lt;/span&gt;
pvm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--tag&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;myTag &lt;span class="c"&gt;#............... Runs helpers.tests.ps1 and list.tests.ps1 with Diagnostic verbosity and only runs tests with tag "myTag".&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Logging and Storage System
&lt;/h2&gt;

&lt;p&gt;PVM maintains essential files for troubleshooting and performance:&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Files
&lt;/h3&gt;

&lt;p&gt;Error Logging: &lt;code&gt;storage/logs/error.log&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Contains detailed error information when commands fail&lt;/li&gt;
&lt;li&gt;Check this file first when troubleshooting installation or configuration issues&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;PATH Backup&lt;/strong&gt;: &lt;code&gt;storage/logs/path.bak.log&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatic backup of your system's PATH variable created during setup&lt;/li&gt;
&lt;li&gt;Used for system recovery if environment &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;variables need restoration&lt;br&gt;
Available Versions Cache for faster performance&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cached list of available PHP versions &lt;code&gt;storage/data/available_versions.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Cached list of available PHP extensions &lt;code&gt;storage/data/available_extensions.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;PVM dramatically simplifies PHP version management on Windows, offering a seamless and developer-friendly experience that was long missing from the ecosystem. With its powerful command-line tools, automated setup, and deep integration with extensions and configuration files, PVM empowers developers to focus more on building applications.&lt;/p&gt;

&lt;p&gt;What's Next?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explore the full command list using &lt;code&gt;pvm help&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Install your first PHP version with &lt;code&gt;pvm install &amp;lt;version&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Contribute or report issues on &lt;a href="https://github.com/drissboumlik/pvm" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Share your feedback and suggest features&lt;/li&gt;
&lt;li&gt;👉 If you find PVM helpful, consider giving it a star ⭐ on GitHub, an upvote PVM on ProductHunt &lt;a href="https://www.producthunt.com/products/pvm" rel="noopener noreferrer"&gt;here&lt;/a&gt; or leave a review &lt;a href="https://www.producthunt.com/products/pvm/reviews/new" rel="noopener noreferrer"&gt;here&lt;/a&gt;) — it really helps others discover the project and keeps development going.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>php</category>
      <category>windows</category>
      <category>terminal</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Switch php version on windows with one command</title>
      <dc:creator>Driss</dc:creator>
      <pubDate>Mon, 25 Nov 2024 14:06:46 +0000</pubDate>
      <link>https://forem.com/drissboumlik/switch-php-version-on-windows-with-one-command-56fn</link>
      <guid>https://forem.com/drissboumlik/switch-php-version-on-windows-with-one-command-56fn</guid>
      <description>&lt;p&gt;In this article I will be showing you how to switch between your PHP versions from your terminal without reopening it or using the "view advanced system settings". &lt;/p&gt;

&lt;h2&gt;
  
  
  1. Download &amp;amp; Install cmder
&lt;/h2&gt;

&lt;p&gt;Go to &lt;a href="https://cmder.app" rel="noopener noreferrer"&gt;https://cmder.app&lt;/a&gt;, download and extract the cmder zip where ever suits you, next checkout this posts &lt;a href="https://drissboumlik.com/blog/how-cmder-made-my-life-easier-part-1" rel="noopener noreferrer"&gt;How cmder made my life easier - part I&lt;/a&gt; and &lt;a href="https://drissboumlik.com/blog/how-cmder-made-my-life-easier-part-2" rel="noopener noreferrer"&gt;part II&lt;/a&gt; where you can find details on how to install cmder and configure your own aliases.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Prepare your php archive:
&lt;/h2&gt;

&lt;p&gt;We will need for demo purposes to download different versions of php and to do that head to the &lt;a href="https://windows.php.net/downloads/releases/archives/" rel="noopener noreferrer"&gt;PHP archive&lt;/a&gt;, and download the versions you want, after that extract them in a specific folder ("C:\php-archive" for example).&lt;/p&gt;

&lt;p&gt;Once you're done open the "view advanced system settings" and create new variables for your different PHP versions (see image below).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrissboumlik.com%2Fstorage%2Fblog%2Fposts%2Fswitch-php-version-on-windows-with-one-command%2Fassets%2Fpost_asset_0.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrissboumlik.com%2Fstorage%2Fblog%2Fposts%2Fswitch-php-version-on-windows-with-one-command%2Fassets%2Fpost_asset_0.webp" alt="php environment variables" width="701" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you will add one more variable which you will have the name "current_php" for example, this variable will hold your current php version any time you change it, then reference it inside the path variable (see image below).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrissboumlik.com%2Fstorage%2Fblog%2Fposts%2Fswitch-php-version-on-windows-with-one-command%2Fassets%2Fpost_asset_1.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrissboumlik.com%2Fstorage%2Fblog%2Fposts%2Fswitch-php-version-on-windows-with-one-command%2Fassets%2Fpost_asset_1.webp" alt="current php version inside path" width="595" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Install chocolatey
&lt;/h2&gt;

&lt;p&gt;Now that we have everything inside the advanced system settings set up, we will go to &lt;a href="https://chocolatey.org/install" rel="noopener noreferrer"&gt;chocolatey.org&lt;/a&gt; and install chocolatey, which will allow you to &lt;a href="https://docs.chocolatey.org/en-us/create/functions/update-sessionenvironment" rel="noopener noreferrer"&gt;update the environment variables&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Open Powershell with admin rights and just follow the instructions to install it the right way, when you're done type &lt;code&gt;choco&lt;/code&gt; or &lt;code&gt;choco -v&lt;/code&gt; in the terminal to see if you installed it successfully and which version you have.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Switch php version from terminal
&lt;/h2&gt;

&lt;p&gt;First, start you terminal with admin rights ( otherwise the next steps won't work !! ), to switch your php version you need to type &lt;code&gt;setx current_php [your_target_php_location] /m&lt;/code&gt; where [your_target_php_location] is the absolute path to the php version you want or use one of your php versions your defined here like this &lt;code&gt;setx current_php %php7% /m&lt;/code&gt;, now you have switched php to version 7.0 in the path environment, but your terminal doesn't know that, to reload the updates, you need another command which is &lt;code&gt;RefreshEnv.cmd&lt;/code&gt;, alias &lt;code&gt;refreshenv&lt;/code&gt;, this one comes with chocolatey, chekout this &lt;a href="https://docs.chocolatey.org/en-us/create/functions/update-sessionenvironment" rel="noopener noreferrer"&gt;Update-SessionEnvironment&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The one command I promised you
&lt;/h2&gt;

&lt;p&gt;Last step is to make a helpful alias to make the process even easier, create an alias like this: &lt;code&gt;setphp=setx current_php %$1% /m $t refreshenv&lt;/code&gt; now we can take the previous example ( &lt;code&gt;setx current_php %php7% /m&lt;/code&gt; ) and do this &lt;code&gt;setphp php7&lt;/code&gt;, php7 will replace the $1 variable inside using the alias which will be equivalent to &lt;code&gt;setx current_php %php7% /m $t refreshenv&lt;/code&gt;, then check with &lt;code&gt;php --version&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In the 4th step we talked about starting your terminal with admin rights, but of course you won't remember to do that each time, so to resolve this issue, we will need something extra.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Parameters:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="kr"&gt;param&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$variableName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$variableValue&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c"&gt;# Check if running as administrator&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="kr"&gt;If&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;Security.Principal.WindowsPrincipal&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Security.Principal.WindowsIdentity&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;GetCurrent&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IsInRole&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;Security.Principal.WindowsBuiltInRole&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Administrator"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="c"&gt;# Relaunch as administrator with hidden window&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nv"&gt;$arguments&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"-ExecutionPolicy Bypass -File &lt;/span&gt;&lt;span class="se"&gt;`"&lt;/span&gt;&lt;span class="bp"&gt;$PSCommandPath&lt;/span&gt;&lt;span class="se"&gt;`"&lt;/span&gt;&lt;span class="s2"&gt; -variableName &lt;/span&gt;&lt;span class="se"&gt;`"&lt;/span&gt;&lt;span class="nv"&gt;$variableName&lt;/span&gt;&lt;span class="se"&gt;`"&lt;/span&gt;&lt;span class="s2"&gt; -variableValue &lt;/span&gt;&lt;span class="se"&gt;`"&lt;/span&gt;&lt;span class="nv"&gt;$variableValue&lt;/span&gt;&lt;span class="se"&gt;`"&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;Start-Process&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;powershell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-ArgumentList&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$arguments&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Verb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;RunAs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-WindowStyle&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Hidden&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="kr"&gt;exit&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="kr"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$variableName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$variableValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nv"&gt;$variableValueContent&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.Environment&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;GetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$variableValue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.EnvironmentVariableTarget&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;Machine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="kr"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$variableValueContent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.Environment&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$variableName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$variableValueContent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.EnvironmentVariableTarget&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;Machine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;else&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.Environment&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$variableName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$variableValue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.EnvironmentVariableTarget&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;Machine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;Write-Host&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Environment variable '&lt;/span&gt;&lt;span class="nv"&gt;$variableName&lt;/span&gt;&lt;span class="s2"&gt;' set to '&lt;/span&gt;&lt;span class="nv"&gt;$variableValue&lt;/span&gt;&lt;span class="s2"&gt;' at the system level."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;else&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;Write-Host&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Please provide both a variable name and value."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save this powershell script somewhere under the name set-env.ps1 and head to your cmder terminal, create an alias like this &lt;code&gt;setvar=powershell -ExecutionPolicy Bypass -File "/your/path/to/set-env.ps1" $1 $2 &amp;amp;&amp;amp; refreshenv&lt;/code&gt;, this alias will get 2 parameters and pass them to the powershell script, the paramtere $1 will hold the environment variable name, and $2 will hold the environment variable value, followed by the chocolatey command to refresh everything for your terminal, the script then checks for "administrative privileges" to run the &lt;code&gt;setx&lt;/code&gt; command with admin rights.&lt;/p&gt;

&lt;p&gt;Since we previously talked about a "current_php" variable, we will be using it for the example, to use our new alias &lt;code&gt;setvar&lt;/code&gt; to change the php version even if we didn't start cmder with admin rights, we type &lt;code&gt;setvar current_php php7&lt;/code&gt;, or if you like to use the absolute path type &lt;code&gt;setvar current_php your/target/php/location&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Issues you might encounter
&lt;/h2&gt;

&lt;p&gt;The issues I found after switching php version, is that the alias keyword and all the supported linux commands no longer works on cmder, and the solution I found for that so far is to add "C:\Cmder\vendor\git-for-windows\usr\bin" and "C:\Cmder\vendor\bin" to the path environment variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Of course you can do something like this, create an alias &lt;code&gt;php8&lt;/code&gt; for &lt;code&gt;/your/path/to/php8/php.exe&lt;/code&gt; and run your php code just by typing &lt;code&gt;php8 my-script.php&lt;/code&gt; but when it comes to something like composer or anything that relies on your path variable, then you will need something more persistante, hence this article.&lt;/p&gt;

&lt;p&gt;One more thing, as you have probably concluded, you can use &lt;code&gt;setx&lt;/code&gt; command and chocolatey to update any environment variable you like.&lt;/p&gt;

</description>
      <category>tricks</category>
      <category>terminal</category>
      <category>windows</category>
      <category>php</category>
    </item>
    <item>
      <title>How cmder made my life easier</title>
      <dc:creator>Driss</dc:creator>
      <pubDate>Mon, 04 May 2020 01:02:31 +0000</pubDate>
      <link>https://forem.com/drissboumlik/cmder-made-my-life-easier-3p9a</link>
      <guid>https://forem.com/drissboumlik/cmder-made-my-life-easier-3p9a</guid>
      <description>&lt;p&gt;As developer I always look for ways to automate and/or shortcut my day to day tasks, Today I would love to share with you my favorite command line tool and show you how you can benefit from it’s features.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Get Cmder&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;First things first, this is for windows users and here is the link to download cmder &lt;a href="https://cmder.net/"&gt;https://cmder.net/&lt;/a&gt;&lt;br&gt;
scroll down to download section.&lt;br&gt;
Personnaly I take the Full version (Both of them are Portable versions)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hyVYGk_J--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/8n3v0gedznyc86o2uur3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hyVYGk_J--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/8n3v0gedznyc86o2uur3.png" alt="Alt Text" width="800" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then you can head to the shortcut section (very useful)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zfIWGrss--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/r3z9iyl93eq1xchgm135.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zfIWGrss--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/r3z9iyl93eq1xchgm135.png" alt="Alt Text" width="800" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bonus
&lt;/h3&gt;

&lt;p&gt;Here is a bonus&lt;br&gt;
Personnaly I extract cmder inside C:/cmder directory then I add the cmder path like this&lt;br&gt;
1- Open the 'Advanced system settings'&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--maq_5cOX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/zv22dswi8vdocc4dwgsi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--maq_5cOX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/zv22dswi8vdocc4dwgsi.png" alt="Alt Text" width="800" height="834"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2- Got to 'Environment Variables..'&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lZLctqlq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/yigknlsic5yz8d2t8o8y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lZLctqlq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/yigknlsic5yz8d2t8o8y.png" alt="Alt Text" width="553" height="582"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3- Select 'Path' then click on 'Edit...'&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qOAki2nx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/mbqvq2yl5wtq1bmbopaq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qOAki2nx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/mbqvq2yl5wtq1bmbopaq.png" alt="Alt Text" width="710" height="786"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4- Click 'New' and add the cmder path&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uB4TL7EF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/88nxjfol1qq1wmquhzns.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uB4TL7EF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/88nxjfol1qq1wmquhzns.png" alt="Alt Text" width="711" height="787"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that ,you can type the cmder on the directory path field&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uaaei56O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/43nivfh1jp6qadnnuny4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uaaei56O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/43nivfh1jp6qadnnuny4.png" alt="Alt Text" width="637" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and this will open cmder pointing to that directory&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zOHw-dPB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/ynqihq4vcj5f770jks31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zOHw-dPB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/ynqihq4vcj5f770jks31.png" alt="Alt Text" width="408" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wouff, finally lets get down to business&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Visual Part&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Note :
&lt;/h3&gt;

&lt;p&gt;Before we start, you need to know that cmder supports linux commands such as touch file, nano file .. etc, which is amazing already 🥳.&lt;/p&gt;

&lt;p&gt;I always hated 😣 to write commands on the same line on the default command tool windows, which is not the case with cmder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K_TQ8cg1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/7j4d40s37czs6pdzrnbt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K_TQ8cg1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/7j4d40s37czs6pdzrnbt.png" alt="Alt Text" width="800" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Tabs, Tabs, Tabs
&lt;/h3&gt;

&lt;p&gt;Cmder allows to create tabs which is very useful when you are running multiple stuff like angular, node, laravel artisan, ...etc and this prevents from being overwhelmed with lot of opened command windows - One window, Multiple tabs 😎&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hFvpfKAB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/7fu9eyh22xtpjf93yfl7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hFvpfKAB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/7fu9eyh22xtpjf93yfl7.png" alt="Alt Text" width="708" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another thing about tabs is that (I love this 🤭) you can split into two (or more) sections&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pajWe_3E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/dhhkpn4a04di0k49gkdf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pajWe_3E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/dhhkpn4a04di0k49gkdf.png" alt="Alt Text" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To make this happen you (images below)&lt;br&gt;
1- Got to tasks section&lt;br&gt;
2- Click the + button to add new task&lt;br&gt;
3- Give it a name&lt;br&gt;
4- Add this code to the snippet section&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;-cur_console:s50H:d: -cur_console:C:C:\cmder\icons\cmder.ico cmd /k ""%ConEmuDir%..\init.bat" "&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;5- Add a Hotkey if you like&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wdCA7dg2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/9t9buexmzara1jw45cjk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wdCA7dg2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/9t9buexmzara1jw45cjk.png" alt="Alt Text" width="687" height="365"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rZFSSqQS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/yv0czhetvmxwgwl0taru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rZFSSqQS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/yv0czhetvmxwgwl0taru.png" alt="Alt Text" width="800" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Searching...
&lt;/h3&gt;

&lt;p&gt;Let's say you type a command and you get an output and (may be you're overwhelmed  😱 by how large 😵 the output is), and you want to search for a text, you can use (image below)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q2_GxqW7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/w9k6iofxiudk5vjsa29b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q2_GxqW7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/w9k6iofxiudk5vjsa29b.png" alt="Alt Text" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And just like bash, you can search for previous typed commands via this shortcut 'Ctrl + R', (1) is what I'm typing and (2) is what matches my search&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--urV4gND---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/f11l93nrj8xwz836jpg6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--urV4gND---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/f11l93nrj8xwz836jpg6.png" alt="Alt Text" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Tech Part&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Simple alias
&lt;/h3&gt;

&lt;p&gt;Now I will tell you about one of my favorite things about cmder "ALIASES" 🤩🤩.&lt;br&gt;
As a developer I type lot of command lines but there are certain commands that we type more than others : (example for (git : git status, git commit -m "message") or (angular : ng g c myComponent) or (laravel : php artisan make:migration myMigration) or ..... etc)&lt;br&gt;
so to create an alias you just have to type &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;alias 'the alias you like'='the command you hate to write every time'&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;example here : replacing git status with gs&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;alias gs=git status&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D6uiD4qX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/l5f5w0jhtolzgtkgb7cr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D6uiD4qX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/l5f5w0jhtolzgtkgb7cr.png" alt="Alt Text" width="685" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Alias with parameters
&lt;/h3&gt;

&lt;p&gt;Q: But wait what if I want to have parameters in my commands&lt;br&gt;
A: I didn't create cmder 🤣 ... just kidding, of course you can add parameters, here is an example of replacing git add file/directory&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;alias ga=git add $*&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;the $* means what ever comes after your alias (your parameter)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UDtLQK8X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/3jr7w6hfxbrdk9t224yd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UDtLQK8X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/3jr7w6hfxbrdk9t224yd.png" alt="Alt Text" width="728" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Q: What if I want to have a parameter in the middle of my command&lt;br&gt;
A: Again, I didn't ... 🤣🤣, of course you can&lt;br&gt;
Here is how you can do and use it (example : creating laravel controller)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;alias pamkc=php artisan make:controller $*Controller&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;pamkc =&amp;gt; initials of 'php artisan make:controller&lt;br&gt;
to use this alias :&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;pamkc Post&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;this will create a PostController.php file&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--11RuAdf1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/1c5pgb4l0s5ri9z1tkp5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--11RuAdf1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/1c5pgb4l0s5ri9z1tkp5.png" alt="Alt Text" width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Q: What if I want to have more than one parameter in my command&lt;br&gt;
A: Again, of course you can&lt;br&gt;
You can do something like (example : serve a laravel app on different host and port)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;alias pashp=php artisan serve --host $1 --port $2&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;to use this alias :&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;pashp 0.0.0.0 8888&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Be careful about the order of your parameters ($1 = 0.0.0.0 and $2 = 8888) 😬&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iQxCNoQ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/f8vmplbx1kbuf64lt8wh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iQxCNoQ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/f8vmplbx1kbuf64lt8wh.png" alt="Alt Text" width="800" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before you ask ✋ any other question, here is how you can use the same parameter in more than one place (example : creating a laravel factory for a specific model)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;alias pamkf = php artisan make:factory $1Factory --model=$1&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;to use this alias :&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;pamkf Post&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The result will be &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;php artisan make:factory PostFactory --model=Post&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CUsajiKM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/bla6z95zpqy6mu0y5xuc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CUsajiKM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/bla6z95zpqy6mu0y5xuc.png" alt="Alt Text" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  One alias, multiple commands
&lt;/h3&gt;

&lt;p&gt;Now let's see how to chain more than one command in one alias.&lt;br&gt;
Example: Sometimes you want to switch to another partition, so you are in C:, and you want to switch to E:\MyDirectory, you type 'cd E:\MyDirectory' but you see nothing until you type 'E:', then your switch is done and you're now in 'E:\MyDirectory', this brings me to another thing I like which is creating aliases for directories.&lt;br&gt;
Example :&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;alias desktop=cd C:\Users\UserName\Desktop\ $t C:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;which will take me to my desktop then ($t) execute second command 'C:' to force it into the 'C:' partition (just in case I'm in a different partition)&lt;/p&gt;

&lt;p&gt;You can also make alias for files / programs&lt;br&gt;
Example :&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;alias npp="C:\Program Files\Notepad++\notepad++.exe" $*&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here I'm running notepad++ editor with parameter $* which is the file i want to open.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Final Thoughts&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Personally I'm currently satisfied with cmder, but I can't say if it's the best, may be other tools exists out there way better than cmder, but the idea is about "Always look for ways to get things done better, faster, cleaner".&lt;br&gt;
Thanks for reading&lt;/p&gt;

&lt;p&gt;Before you close this window I would like to share my list of aliases I use&lt;/p&gt;

&lt;p&gt;For Explorer &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;e.=explorer .&lt;br&gt;
exp=explorer $*  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For Git: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;ga.=git add .&lt;br&gt;&lt;br&gt;
ga=git add $*&lt;br&gt;&lt;br&gt;
gaa=git add .&lt;br&gt;&lt;br&gt;
gs=git status $*&lt;br&gt;&lt;br&gt;
gb=git branch $*&lt;br&gt;&lt;br&gt;
gc=git commit&lt;br&gt;&lt;br&gt;
gck=git checkout $*&lt;br&gt;&lt;br&gt;
gcl=git clone $*&lt;br&gt;&lt;br&gt;
gcm=git commit -m "$*"&lt;br&gt;&lt;br&gt;
gd=git diff $*&lt;br&gt;&lt;br&gt;
gi=git init&lt;br&gt;&lt;br&gt;
gl=git log&lt;br&gt;&lt;br&gt;
gm=git merge&lt;br&gt;&lt;br&gt;
gpl=git pull $*&lt;br&gt;&lt;br&gt;
gplbit=git pull bitbucket master $*&lt;br&gt;&lt;br&gt;
gplgit=git pull github master&lt;br&gt;&lt;br&gt;
gplo=git pull origin $*&lt;br&gt;&lt;br&gt;
gplom=git pull origin master $*&lt;br&gt;&lt;br&gt;
gps=git push $*&lt;br&gt;&lt;br&gt;
gpsbit=git push bitbucket master&lt;br&gt;&lt;br&gt;
gpsgit=git push github master&lt;br&gt;&lt;br&gt;
gpso=git push origin $*&lt;br&gt;&lt;br&gt;
gpsom=git push origin master $*&lt;br&gt;&lt;br&gt;
gr=git reset $*&lt;br&gt;&lt;br&gt;
grfl=git reflog $*&lt;br&gt;&lt;br&gt;
grh=git reset --hard $*&lt;br&gt;&lt;br&gt;
grhh=git reset --hard HEAD&lt;br&gt;&lt;br&gt;
grs=git reset --soft $*&lt;br&gt;&lt;br&gt;
grm=git rm $*&lt;br&gt;&lt;br&gt;
grv=git remote -v  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For NPM&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;ni=npm install $*&lt;br&gt;&lt;br&gt;
nu=npm update&lt;br&gt;&lt;br&gt;
nrb=npm run build&lt;br&gt;&lt;br&gt;
nrd=npm run dev&lt;br&gt;&lt;br&gt;
nrs=npm run serve&lt;br&gt;&lt;br&gt;
nrw=npm run watch  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For Composer&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;ci=composer install&lt;br&gt;&lt;br&gt;
cu=composer update&lt;br&gt;&lt;br&gt;
cmpref=composer dump-autoload  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For Angular&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;nggc=ng generate component --skipTests $*&lt;br&gt;&lt;br&gt;
nggcs=ng generate component $*&lt;br&gt;&lt;br&gt;
nggd=ng generate directive --spec=false $*&lt;br&gt;&lt;br&gt;
nggds=ng generate directive $*&lt;br&gt;&lt;br&gt;
nggs=ng generate service --spec=false $*&lt;br&gt;&lt;br&gt;
ngs=ng serve&lt;br&gt;&lt;br&gt;
ngsa=ng serve --aot  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For Laravel&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;pa=php artisan $*&lt;br&gt;&lt;br&gt;
padbs=php artisan db:seed $*&lt;br&gt;&lt;br&gt;
pakg=php artisan key:generate&lt;br&gt;&lt;br&gt;
pam=php artisan migrate&lt;br&gt;&lt;br&gt;
pamf=php artisan migrate:fresh&lt;br&gt;&lt;br&gt;
pamfs=php artisan migrate:fresh --seed&lt;br&gt;&lt;br&gt;
pamk=php artisan make:$*&lt;br&gt;&lt;br&gt;
pamkall=php artisan make:model $1 -m -c -f $t php artisan make:seeder $1sTableSeeder&lt;br&gt;&lt;br&gt;
pamkc=php artisan make:controller $*Controller&lt;br&gt;&lt;br&gt;
pamkcmp=php artisan make:component $*&lt;br&gt;&lt;br&gt;
pamkcr=php artisan make:controller $*Controller -r&lt;br&gt;&lt;br&gt;
pamkf=php artisan make:factory $1Factory --model=$1&lt;br&gt;&lt;br&gt;
pamkfm=php artisan make:factory $1Factory --model=$2&lt;br&gt;&lt;br&gt;
pamkmdl=php artisan make:model $*&lt;br&gt;&lt;br&gt;
pamkmg=php artisan make:migration create_$*_table&lt;br&gt;&lt;br&gt;
pamkmm=php artisan make:model $1 -m&lt;br&gt;&lt;br&gt;
pamkmmc=php artisan make:model $1 -m -c&lt;br&gt;&lt;br&gt;
pamkmmcr=php artisan make:model $1 -m -c -r&lt;br&gt;&lt;br&gt;
pamkr=php artisan make:resource $*Resource&lt;br&gt;&lt;br&gt;
pamkrc=php artisan make:resource $*Collection&lt;br&gt;&lt;br&gt;
pamks=php artisan make:seeder $1sTableSeeder&lt;br&gt;&lt;br&gt;
pams=php artisan migrate --seed&lt;br&gt;&lt;br&gt;
parl=php artisan route:list&lt;br&gt;&lt;br&gt;
pas=php artisan serve&lt;br&gt;&lt;br&gt;
pash=php artisan serve --host $*&lt;br&gt;&lt;br&gt;
pashp=php artisan serve --host $1 --port $2&lt;br&gt;&lt;br&gt;
pasp=php artisan serve --port $*&lt;br&gt;&lt;br&gt;
pasph=php artisan serve --port $1 --host $2&lt;br&gt;&lt;br&gt;
pat=php artisan tinker&lt;br&gt;&lt;br&gt;
pav=php artisan --version&lt;br&gt;&lt;br&gt;
rfl=composer dumpautoload $t php artisan optimize $t php artisan cache:clear $t php artisan view:clear  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For Docker&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;dc=docker-compose $*&lt;br&gt;&lt;br&gt;
dcx=docker-compose exec $*&lt;br&gt;&lt;br&gt;
dk=docker $*&lt;br&gt;&lt;br&gt;
dkim=docker image $*&lt;br&gt;&lt;br&gt;
dkimls=docker image ls $*&lt;br&gt;&lt;br&gt;
dkims=docker images $*&lt;br&gt;&lt;br&gt;
dkimsa=docker images -a $*&lt;br&gt;&lt;br&gt;
dkll=docker kill $*&lt;br&gt;&lt;br&gt;
dksp=docker system prune $*&lt;br&gt;&lt;br&gt;
dkspa=docker system prune -a $*&lt;br&gt;&lt;br&gt;
dps=docker ps $*&lt;br&gt;&lt;br&gt;
dpsa=docker ps -a $*&lt;br&gt;&lt;br&gt;
rmcn=docker container rm $*&lt;br&gt;&lt;br&gt;
rmim=docker image rm $*  &lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>tools</category>
      <category>cmder</category>
      <category>productivity</category>
      <category>terminal</category>
    </item>
  </channel>
</rss>
