Is there a way to list permissions for a given module? Using Drush 9, I am trying to automate the creation of a role and I need to assign permissions to it. I see that I can use drush role-add-perm to do the assignment itself, but I can't find a command to actually give me the permissions supplied by the enabled modules. 

It looks like this was doable in older versions of Drush, but I'm not sure Drush 9 has equivalent commands.

Thanks!
You could use drush cim and create a yml for your role like for example

langcode: en
status: true
dependencies: {  }
id: myrole
label: 'My super Role'
weight: 1
is_admin: false
permissions: 
  - 'whatever 1'
  - 'whatever 2'


And if you don't know what perms your module brings, you could use that simple eval code with drush:

drush php-eval '$p = Drupal::service("user.permissions")-&gt;getPermissions(); foreach ($p as $k =&gt; $x) print $k." : ".$x["provider"]."\n";'