Publish nodes with drush? I'm faced with the situation of needing to be able to publish content with Drush.  Is there a way to use Drush to publish nodes?  If there is, how can it be done?
I am not sure if that is available by default (found no result on searching), but one thing that you can do is declaring your own Drush command in 3 easy steps:


Creating the Command File:


  ( Give the right name to the command file and place it into a folder that Drush will look, That name must end with .drush.inc (in our case it will be publish.drush.inc) and must be placed either in the folder of a custom module on your site (will work for that site if the module is enabled) or in the .drush folder in your server’s root directory).

Declaring the Command Function: To declare a new Drush command you have to invoke hook_drush_command() in the file you created above and below the php opening tag. Example as below:



  function publish_drush_command() {
    $items = array();
    $items['publish-content'] = array(
      'description' => 'Publish content',
      'aliases' => array('pc'),
      'arguments' => array(
        'type' => 'Nodes of this type will be published',
      ),
    );
    return $items;
  }  


Note: This command is declared in a file that has been placed in the .drush folder that resides in the VPS’s root folder.

Here we have declared a new command called publish-content (a new key in the $items array). The description and what’s included in the arguments key is what you will see when you run the drush help publish-content command. What’s actually helpful here is that you can also specify an alias (or shortcut) that can be run instead of the longer publish-content version. In this case, drush publish-content will equal drush pc.
3. Declare the Command Callback Function: Now you need to write the code that you want Drupal to perform when you run the custom command. The name of the function needs to be in the format: drush_command_name. (Note: dash in the command name becomes an underscore in the function name).

function drush_publish_content($type) {
  $nodes = node_load_multiple(array(), array('type' =&gt; $type));
  $count = 0;
  foreach ($nodes as $node) {
    if($node-&gt;status == 0) {
      $count++;
      $node-&gt;status = 1;
      node_save($node);
    }  
  }
  if($count &gt; 0) {
    drush_print($count . " nodes of the " . $type . " content type have been successfully published.");
  }

  else {
    drush_print("No nodes of the " . $type . " content type were published.");
  }
}


This callback function takes as argument the machine name of the content type of all the nodes we want published. This gets passed as a command argument like so (Example: pulish the contents of blog content-type):


  drush publish-content blogs


Drush will then print out how many nodes have been published (displaying only the number of nodes that have been in fact affected by the command).

References:
https://www.digitalocean.com/community/articles/how-to-declare-your-own-drush-commands-with-your-vps
https://github.com/edvillan15/node-tools/blob/master/node_tools.drush.inc