Invoke-PowerAppsChecker

This topic is pre-release documentation and is subject to change.

Performs the actions necessary for initiating an analysis job with the PowerApps checker service and waits for and downloads the results.

Syntax

Invoke-PowerAppsChecker
      [-FileUnderAnalysis <String[]>]
      [-FileUnderAnalysisSasUri <String[]>]
      [-OutputDirectory <String>]
      [-Ruleset <Ruleset[]>]
      [-Rule <Rule[]>]
      [-RuleLevelOverrides <Rule[]>]
      [-ExcludedFileNamePattern <String[]>]
      [-MaxStatusChecks <Int32>]
      [-SecondsBetweenChecks <Int32>]
      [-ClientApplicationId <Guid>]
      [-ClientApplicationSecret <SecureString>]
      [-TenantId <Guid>]
      [-ApiUrl] <Uri>
      [-LocaleName <String>]
      [-MaxConnectionTimeOutMinutes <Int32>]
      [<CommonParameters>]
Invoke-PowerAppsChecker
      [-FileUnderAnalysis <String[]>]
      [-FileUnderAnalysisSasUri <String[]>]
      [-OutputDirectory <String>]
      [-Ruleset <Ruleset[]>]
      [-Rule <Rule[]>]
      [-RuleLevelOverrides <Rule[]>]
      [-ExcludedFileNamePattern <String[]>]
      [-MaxStatusChecks <Int32>]
      [-SecondsBetweenChecks <Int32>]
      [-ClientApplicationId <Guid>]
      [-ClientApplicationSecret <SecureString>]
      [-TenantId <Guid>]
      [-LocaleName <String>]
      [[-Geography] <ApiGeography>]
      [-MaxConnectionTimeOutMinutes <Int32>]
      [<CommonParameters>]

Description

The Invoke-PowerAppsChecker cmdlet first, uploads the file specified by the FileUnderAnalysis parameter, if provided, next submits an analysis job with the PowerApps checker service, monitors for status updates, and when completed, downloads a compressed report file. The file provided is a JSON formatted report, which is in Static Analysis Results Interchange Format (SARIF). A Microsoft.PowerApps.Checker.Client.Models.AnalyzeResult object is returned.

Examples

Example 1

PS C:\> $rulesets = Get-PowerAppsCheckerRulesets -Geography Europe
PS C:\> $rulesetToUse = $rulesets | where Name -EQ 'AppSource Certification'
PS C:\> $analyzeResult = Invoke-PowerAppsChecker -Geography Europe -ClientApplicationId 'dc316d60-f8a8-4b75-b835-ba81054a0b0e' `
    -TenantId '3a11a289-d956-408f-92f6-eddb3413abc2' -Ruleset $rulesetToUse -FileUnderAnalysis "C:\src\mysolution.zip" `
    -OutputDirectory "C:\out"

In this example the data is run in the European data centers and using the AppSource Certification ruleset as the list of rules for the PowerApps checker service to use in its analysis. This is an example of an interactive approach. A prompt will be received to login to the Azure tenant. The user must reside in the tenant provided as well as have access to login to the application provided.

Example 2

PS C:\> $rulesets = Get-PowerAppsCheckerRulesets -Geography Europe
PS C:\> $rulesetToUse = $rulesets | where Name -NE 'AppSource Certification'
PS C:\> $analyzeResult = Invoke-PowerAppsChecker -Geography Europe -ClientApplicationId 'dc316d60-f8a8-4b75-b835-ba81054a0b0e' `
    -TenantId '3a11a289-d956-408f-92f6-eddb3413abc2' -Ruleset $rulesetToUse -FileUnderAnalysis "C:\src\mysolution.zip" `
    -OutputDirectory "C:\out" -ClientApplicationSecret (ConvertTo-SecureString -AsPlainText -Force -String '*************************************')

In this example the data is run in the European data centers and using the AppSource Certification ruleset as the list of rules for the PowerApps checker service to use in its analysis. This is an example of an approach to be used in non-interactive scenarios,such as automated builds and deployments. No prompt will be received to login to the Azure tenant.

Example 3

PS C:\> $rulesets = Get-PowerAppsCheckerRulesets -Geography UnitedStates
PS C:\> $rulesetToUse = $rulesets | where Name -EQ 'AppSource Certification'
PS C:\> $overrides = New-PowerAppsCheckerRuleLevelOverride -Id 'meta-avoid-silverlight' -OverrideLevel High
PS C:\> $analyzeResult = Invoke-PowerAppsChecker -Geography UnitedStates -ClientApplicationId 'dc316d60-f8a8-4b75-b835-ba81054a0b0e' `
    -TenantId '3a11a289-d956-408f-92f6-eddb3413abc2' -Ruleset $rulesetToUse -FileUnderAnalysis "C:\src\mysolution.zip" `
    -RuleLevelOverrides $overrides -OutputDirectory "C:\out"

In this example the data is run in the United States data centers using the AppSource Certification ruleset as the list of rules for the PowerApps checker service to use in its analysis. If there are any violations of the meta-avoid-silverlight rule, they are treated as a severity level of High. This is an example of an interactive approach. A prompt is received to sign in to the Azure tenant. The user must reside in the tenant provided as well as have access to sign in to the application provided.

Parameters

-ApiUrl

URL of the PowerApps checker root service endpoint. Unless provided a direct URL from Microsoft, Geography should be used.

Type:Uri
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ClientApplicationId

Id of the client application registered in your tenant that will be used to connect to the service. This is the identifier used while processing analysis requests in the PowerApps checker service. The client application must reside in the tenant provided as well as have access to the PowerApps-Advisor APIs.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ClientApplicationSecret

Used as a credential, along with what is specified in the ClientApplicationId, for authenticating against Azure Active Directory. A token is generated and submitted along with the request to the PowerApps checker service. For more information about how to create a secret, see Certificates and secrets.

Type:SecureString
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ExcludedFileNamePattern

List the names of files to be excluded from the analysis. It can include a full file name or a name with leading or trailing wildcards, such as-jquery or form.js

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FileUnderAnalysis

One or more paths to local files to be uploaded and used as part of the analysis. Notice that each file must be under 30 MB. If you have a file over 30 MB you must upload it to your blob storage and provide a SAS URI in the FileUnderAnalysisSasUri parameter.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FileUnderAnalysisSasUri

One or more paths to a file uploaded in a location accessible by URL, for example, Azure blob storage. This path must be available with no other credentials required, commonly referred to as a SAS URL. For more information about how to upload to Azure blob storage, see Upload, download, and list blobs by using Azure PowerShell.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Geography

The PowerApps checker service temporarily stores the data that you upload in Azure along with the reports that are generated. By specifying a geography, you can control where the data is stored. If no geography is specified, then United States is the default.

Type:ApiGeography
Accepted values:PreviewUnitedStates, UnitedStates, Europe, Asia, Australia, Japan, India, Canada, SouthAmerica, UnitedKingdom, France, Germany, UnitedArabEmirates, USGovernment, USGovernmentL4, USGovernmentL5DoD, China
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-LocaleName

Specifies the language code that determines how the results are listed, such as es, for Spanish. The languages that are supported are included in the validation set of the parameter.

Type:String
Accepted values:bg, ca, cs, da, de, el, en, es, et, eu, fi, fr, gl, hi, hr, hu, id, it, ja, kk, ko, lt, lv, ms, nb, nl, pl, pt-BR, pt-pt, ro, ru, sk, sl, sr-Cyrl-RS, sr-Latn-RS, sv, th, tr, uk, vi, zh-HANS, zh-HANT
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MaxConnectionTimeOutMinutes

Maximum number in minutes to wait before quitting a web based operation.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MaxStatusChecks

Maximum number of times in which status calls are made to the service. The default number is 20, which in most cases is sufficient. If the threshold is exceeded, then a timeout exception is thrown.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OutputDirectory

Directory in which the resulting reports are to be downloaded. This directory must already exist or it will not pass validation.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Rule

One or more rule that are to be run as part of the analysis. This is of type Microsoft.PowerApps.Checker.Client.Models.Rule[]. The Rule object should minimally contain the RuleCode property. You can also use what is returned from a call to the Get-PowerAppsCheckerRule cmdlet. This parameter can be used instead of or in combination with the Ruleset parameter. At least one of these two parameters must be provided.

Type:Rule[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RuleLevelOverrides

Use this parameter including values created from New-PowerAppsCheckerRuleLevelOverride to set the service to treat violations of a rule as a higher or lower severity level.

Type:Rule[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Ruleset

One or more rulesets that contain the rules that are to be run as part of the analysis. This is of type Microsoft.PowerApps.Checker.Client.Models.Ruleset[]. The Ruleset object should minimally contain the Id or Name property. You can also use what is returned from a call to the Get-PowerAppsCheckerRuleset cmdlet. This parameter can be used instead of or in combination with the Rule parameter. At least one of these two parameters must be provided.

Type:Ruleset[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SecondsBetweenChecks

The number of seconds between status checks. The default is 15 seconds.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TenantId

Id of your tenant. It is also referred to as the directory Id. It can be found in the overview properties of Azure Active Directory in your Azure subscription.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String[]

System.String

Microsoft.PowerApps.Checker.Client.Models.Ruleset[]

Microsoft.PowerApps.Checker.Client.Models.Rule[]

System.Int32

System.Guid

System.Security.SecureString

System.Nullable`1[[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

System.Uri

Microsoft.PowerApps.Checker.PowerShell.ApiGeography

Outputs

System.Object