Using the PowerShell MVP module

The renewal season is opened and it’s time to use the PowerShell module designed to interact with the Microsoft MVP website François-Xavier Cat and I released last year when the Microsoft MVP Rest API was made available.

François-Xavier already published some very useful posts and demoed how to use the MVP module for:

This year, I only used the module to insert and review my contributions.
To start using the module, you basically need to install the module, import it and set your subscription key with the Set-MVPConfiguration function. See first the following post from François-Xavier to achieve these steps.

Now I’d like to show you some code snippets I used along this contributions submission process.

First, I needed to find what contribution I submitted last year and filter out what PGI I attended.
To quickly do that I used:

Get-MVPContribution -Limit 100 | 
Where { $_.ContributionType.Name -notmatch 'PGI' } | 
Out-GridView -PassThru 

I first get the out-gridview window where I can list, search and select contribution(s):

If I select a previous one:

After I reviewed my old contribution, I gather updated numbers for the new period and prepare the following to submit an activity:

$splat = @{
 startdate ='2017/07/01'
 Title='Type your title here'
 Description = @'
Enter a full description about this activity
 AnnualReach = '1000'
 Visibility = (
  Get-MVPContributionVisibility | 
  Out-GridView -Title 'Select visibility' -PassThru
 ContributionType = (
  Get-MVPContributionType | 
  Out-GridView -Title 'Select Contribution Type' -PassThru
 ContributionTechnology = (
  Get-MVPContributionArea -All | 
  Out-GridView -Title 'Select Contribution Area' -PassThru

# Review one more time

# Submit activity
New-MVPContribution @splat

Note that a new contribution ID is returned when it’s submitted using the New-MVPContribution function.
I take a note of its ID and use the following to be able to query this activity later on when/if needed.

Get-MVPContribution -ID 547174

After I entered all the activities, I use this code snippet to see what I submitted:

Get-MVPContribution -Limit 100 | 
Where { $_.ContributionType.Name -notin @(
 'Product Group Interaction (PGI)',
 'Forum Participation (Microsoft Forums)') } | 
ForEach-Object {
 $_ | 
 Add-Member -MemberType NoteProperty -Name Date -Value (Get-Date $_.StartDate) -PassThru
} | Where { 
 $_.Date -ge (Get-Date '2017-07-01T00:00:00') 
} | 
Sort -Property Date |