cancel
Showing results for 
Search instead for 
Did you mean: 
Rick72

Get a list of apps with PowerShell which have not been updated for six months

It is recommended to update or (re)publish your app every six month. Click here to go to the related webpage. To be honest, I do not know if this it true for SharePoint forms (I assume it is), but for apps it is recommended.

 

So how does one know which apps are not updated or (re)published in six months? Well, PowerShell to the rescue!

 

There are PowerShell cmdlets for PowerApps (and Flow) and a blog post about this was published on 2018-05-29. Click here for the blog post. Some examples are given in that blog post but none which can directly be used for this overview.

 

To get a list of apps which have not been updated or (re)published in six months (in this case 150 days), just execute the following code:

 

$days = -150
Get-AdminApp | Where-Object {(Get-Date $_.LastModifiedTime) -lt (get-Date).AddDays($days)} | Select -ExpandProperty 'Internal' | Select -ExpandProperty 'Properties' | Select-Object displayName, createdTime, lastModifiedTime, @{Name="Created By"; Expression={$_.CreatedBy.displayName}}, @{Name="List Url"; Expression={$_.embeddedApp.listUrl}}

 

The following properties are shown:

  • Display name.
  • Date/Time of creation.
  • Date/Time of last modification.
  • Created By.
  • List url (in case of a SharePoint form).

 

The lastModifiedTime property works for both situations where the last version is published or unpublished.

 

The cmdlet Get-App instead of Get-AdminApp could also be use by non-administrators though what defines an administrator is not yet clear to me. I need some more testing to know for sure.

 

I used 150 days because normally you want to know it sooner then 6 months.

 

The property "Internal" of an app object has a property called "Properties" which contains more interesting properties.

Comments