Bienvenue à Blogs CodeS-SourceS Identification | Inscription | Aide

Le blog de Patrick [MVP Office 365]

Partage d'informations sur yOS (Yammer, Office 365, SharePoint), Azure et +...

Actualités









  • Mon blog en ANGLAIS - English blog :

    Versions :
    14.0.4730.1010 SharePoint 2010 RC
    14.0.4762.1000 SharePoint 2010 RTM
    14.0.6029.1000 SharePoint 2010 SP1
    ​14.0.7015.1000 SharePoint 2010 SP2

    15.0.4128.1014 SharePoint 2013 Preview
    15.0.4420.1017 SharePoint 2013 RTM
    15.0.4569.1509 SharePoint 2013 SP1

    Les derniers CU pour SharePoint 2010...
    Les N° de version pour SharePoint 2013...


[PowerShell V2] & [Office 2010] How to explore PowerShell V2 commands with Excel 2010 slicers

It’s hard to find the time needed to explore and discover all the PowerShell V2 cmdlets…

So how can we use the Office tools to help in this discovery ?

The first time I used this method was to explore the SharePoint 2010 cmdlets space and was demoed at TechDays 2010 in Paris (cf. here the report in french :  [TechDays 2010] Retour vers le futur, session Administration SharePoint 2010…, the video is available here : Quoi de neuf dans l'administration SharePoint 2010 ? )

But it can also  be very useful to explore the whole set of PowerShell V2 commands. The idea is simple : I created with PowerShell V2 a list of commands that I used a source for an Excel 2010 Pivot Table and then I added the new slicers tool !

The result will look like this :

image_6C263F5C[1]

and it allows to quickly and visually see where commands are situated (here between modules).

We can very easily answer such questions as : “What are all the commands using the verb “Add” ?

image_16B1FA6D[1] 

With the slicers, answer is immediate ! And the associated graphic is automatically updated :

image_47D1350D[1]

Similarly we can answer very easily such questions as : “ Give me all the commands existing to manipulate a given object (noun in fact)”. We have only to click on the word “Computer” in the “Noun” slicer to get the answer :

image_1FBE85EE[2]

In this example, we have six verbs to work with computer : Add, Checkpoint, Remove, Restart, Restore & Stop.

We can even go further and open directly the related documentation pages by going on the source sheet and clicking on the link to the online doc :

image_7DF2AD5C[1]

And we arrive here :

image_1A3FEF7D[1]

__________________________________________________________________________________

Here is the method I followed :

1°) Creating the list of commands with the following PowerShell command :

 

   1:  Get-Command  | 
   2:      select-object -property commandType, name, 
   3:         @{Name="Verb"; Expression =  
   4:              { if ($_.commandType -eq "Cmdlet")
   5:                  { $_.Verb} 
   6:              elseif ($_.commandType -eq "Alias") 
   7:                  { $def = $_.definition; 
   8:                    $def.substring(0,$def.indexof("-")) }
   9:              else { 
  10:                    if (($_.Name).indexof(":") -eq -1) 
  11:                      { $func_verb.($_.Name) } 
  12:                    else {"Set"} } 
  13:             } } ,
  14:         @{Name="Noun"; Expression = 
  15:              { if ($_.commandType -eq "Cmdlet")
  16:                  { $_.Noun} 
  17:              elseif ($_.commandType -eq "Alias")
  18:                  { $def = $_.definition; 
  19:                    $t = $def.indexof("-")+1;
  20:                    $def.substring($t,$def.length- $t) } 
  21:              else { 
  22:                    if (($_.Name).indexof(":") -eq -1) 
  23:                      { $func_noun.($_.Name)}
  24:                    else {"Location"} }
  25:             } } ,
  26:         @{Name="Module"; Expression =
  27:              { if ($_.commandType -eq "Cmdlet")
  28:                  { $_.ModuleName.substring(10,$_.ModuleName.length-10 ) } 
  29:              elseif ($_.commandType -eq "Alias")
  30:                   { $s = (get-command $_.definition).ModuleName; 
  31:                      $s.substring(10,$s.length-10 ) } 
  32:               else { "Function"  }
  33:            } } ,
  34:         helpuri | export-csv "C:\Temp\PSV2_Commands.csv"

2°) Converting the .csv file to .xslx format :

image_13108D38[2]

becomes :

image_6D76EA09[1] 

with the help of the convert button (in the “data” tab) :

image_3600B30E[2]

and with the associated wizard :

image_26E9D434[1]

3°) Creating a pivot table with its associated slicers :

image_5DD09EEF[1]

image_48395403[2]

And here it is !

We can then create very easily custom reports. For example, here we have all the verbs present in PowerShell V2 and their usage frequency :

image_0030F3DF[1]

The files created and used are downloadable and attched to this post.

Ce post vous a plu ? Ajoutez le dans vos favoris pour ne pas perdre de temps à le retrouver le jour où vous en aurez besoin :
Posted: mercredi 31 mars 2010 16:34 par Patrick Guimonet
Classé sous : ,

Attachment(s): ExplorePSV2Commands.zip

Commentaires

Pas de commentaires

Les commentaires anonymes sont désactivés

Les 10 derniers blogs postés

- Merci par Blog de Jérémy Jeanson le 10-01-2019, 20:47

- Office 365: Script PowerShell pour auditer l’usage des Office Groups de votre tenant par Blog Technique de Romelard Fabrice le 04-26-2019, 11:02

- Office 365: Script PowerShell pour auditer l’usage de Microsoft Teams de votre tenant par Blog Technique de Romelard Fabrice le 04-26-2019, 10:39

- Office 365: Script PowerShell pour auditer l’usage de OneDrive for Business de votre tenant par Blog Technique de Romelard Fabrice le 04-25-2019, 15:13

- Office 365: Script PowerShell pour auditer l’usage de SharePoint Online de votre tenant par Blog Technique de Romelard Fabrice le 02-27-2019, 13:39

- Office 365: Script PowerShell pour auditer l’usage d’Exchange Online de votre tenant par Blog Technique de Romelard Fabrice le 02-25-2019, 15:07

- Office 365: Script PowerShell pour auditer le contenu de son Office 365 Stream Portal par Blog Technique de Romelard Fabrice le 02-21-2019, 17:56

- Office 365: Script PowerShell pour auditer le contenu de son Office 365 Video Portal par Blog Technique de Romelard Fabrice le 02-18-2019, 18:56

- Office 365: Script PowerShell pour extraire les Audit Log basés sur des filtres fournis par Blog Technique de Romelard Fabrice le 01-28-2019, 16:13

- SharePoint Online: Script PowerShell pour désactiver l’Option IRM des sites SPO non autorisés par Blog Technique de Romelard Fabrice le 12-14-2018, 13:01