Share via


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

ServiceReqApi

Invoke-PowerAppsChecker
    [-ApiUrl] <Uri>
    [-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>]
    [-MaxConnectionTimeOutMinutes <Int32>]
    [<CommonParameters>]

ServiceReqGeo

Invoke-PowerAppsChecker
    [[-Geography] <ApiGeography>]
    [-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>]
    [-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 'aaaabbbb-0000-cccc-1111-dddd2222eeee' -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 'aaaabbbb-0000-cccc-1111-dddd2222eeee' -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 'aaaabbbb-0000-cccc-1111-dddd2222eeee' -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.

Parameter properties

Type:Uri
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ServiceReqApi
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SecureString
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:ApiGeography
Default value:None
Accepted values:PreviewUnitedStates, UnitedStates, Europe, Asia, Australia, Japan, India, Canada, SouthAmerica, UnitedKingdom, France, Germany, UnitedArabEmirates, USGovernment, USGovernmentL4, USGovernmentL5DoD, China
Supports wildcards:False
DontShow:False

Parameter sets

ServiceReqGeo
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
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
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MaxConnectionTimeOutMinutes

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OutputDirectory

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:

Rule[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:

Rule[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:

Ruleset[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SecondsBetweenChecks

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

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.Uri

Microsoft.PowerApps.Checker.PowerShell.ApiGeography

Outputs

System.Object