One of the reports the SharePoint Modernization Scanner makes is ModernizationWorkflowScanResults.csv and that’s the one I’m going to use. Since it’s a pretty well formed CSV file we can import it into an object without much fuss:
$results = Import-Csv .\ModernizationWorkflowScanResults.csv
As a gut check we can see how many rows we brought in:
$results.Count
You can also type $results[0] to see the first row, since it’s just an object. And since it’s an object, it has Members that we can exploit. What are those Members? I’m glad you asked:
$results | Get-Member
My eagle-eyed readers will notice that the NoteProperties are the column headers in the CSV file. To get my feet below me I did a simple Select to get a few properties:
$results | select "Definition Name",Version
You can add any of the columns you want. Remember to put quotes around the columns with spaces in the name.
$results | select "Definition Name","Subscription Name","List Title",Version,enabled
Depending on how your PowerShell host is configured that might be wide enough that might switch from table to list. To get it back to table pipe it through Format-Table:
$results | Select-Object "Definition Name","Subscription Name","List Title",Version,enabled,"Flow upgradability" | Format-Table –AutoSize
This report has both SharePoint 2010 and SharePoint 2013 workflows in it. The current fire is around SharePoint 2010 workflows, so let’s just look at those:
$results | Where-Object -Property version -EQ -Value "2010" | Select-Object "Definition Name","Subscription Name","List Title",Version,enabled,"Flow upgradability" | Format-Table -AutoSize
That should give you a better picture of the Herculean task in front of you. There’s one final piece I want to show you, and that’s how to see which sites have the most workflows:
$results | Where-Object -Property version -EQ -Value "2010" | Select-Object "Definition Name","List Title",enabled,"Site Url" | Group-Object -Property "Site Url" | Format-Table –AutoSize
This will help you figure out where to focus your efforts between now and November 1st.
Like I said at the beginning of this post, all of this and more is available in Excel and most of it has been done for you already in the Office 365 Classic workflow inventory.xlsx report that the SharePoint Modernization Scanner creates. But it’s a fun PowerShell exercise just the same.
tk
ShortURL: https://www.toddklindt.com/PoshWorkflowScan