Invoke-BpaModel

Invoke-BpaModel is accessible with the help of BestPractices module. To configure BestPractices, go through this link.

Synopsis

Starts a Best Practices Analyzer (BPA) scan for a specific model that is installed on a computer.

Description

The Invoke-BpaModel cmdlet starts a Best Practices Analyzer (BPA) scan for a specific model that is installed on a Windows-based computer. The model is specified either by using the ModelId parameter, or by piping the results of the Get-BpaModel cmdlet into this cmdlet. If a model is specified in the cmdlet after the BPA scan has been performed, then the results of the scan are available as an XML file.

This cmdlet cannot be canceled after it has been started.

Single-node XML is not supported by the BPA model schema. For more information about what is supported by the BPA model schema, see the Microsoft Baseline Configuration Analyzer Model Authoring Guide on the Microsoft Download Center.

Parameters

-Authentication

Specifies the authentication mode to use when creating a remote connection for running a remote BPA scan.

Type:AuthenticationMechanism
Accepted values:Default, Basic, Negotiate, NegotiateWithImplicitCredential, Credssp, Digest, Kerberos
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-CertificateThumbprint

Specifies the certificate thumbprint to use when creating a remote connection via SSL for running a remote BPA scan.

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

-ComputerName

Specifies the target computer against which to run the BPA scan.

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

-ConfigurationName

Specifies the session configuration, such as the name of the endpoint, to use when creating a session for a remote BPA scan.

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

-Context

Scans a submodel in the context of a specific model (one that is different from the parent model of the submodel). Example: an administrator wants to run a scan on the Backend submodel of the SQL model, but only those in the context of a third model, a technology that relies upon SQL Server.

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

-Credential

Specifies the credentials to use when creating a remote connection for running a remote BPA scan.

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

-Mode

Specifies the mode to use when running the BPA scan. The acceptable values for this parameter are: All, Analysis, or Discovery.

Type:ScanMode
Accepted values:All, Discovery, Analysis
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ModelId

Identities the model to be used for the BPA scan.

Type:String
Aliases:Id, BestPracticesModelId
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

-Port

Specifies the port to use when creating a remote connection for running a remote BPA scan.

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

-RepositoryPath

Specifies that the default location for reports specified by the ReportsRoot registry key should be overridden. This parameter specifies the path where the results should be stored.

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

-SubModelId

Identifies the submodel to run for the model specified by the ModelId parameter. Example: The Update Services model (Microsoft/Windows/UpdateServices) has two submodels (UpdateServices-DB, UpdateServices-Services).

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

-ThrottleLimit

Specifies the throttle limit to use when creating a remote connection for running a remote BPA scan.

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

-UseSsl

Specifies whether or not to use SSL when creating a remote connection for running a remote BPA scan.

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

Syntax

Invoke-BpaModel [-ModelId] <String> [-RepositoryPath <String>] [-Mode <ScanMode>] [<CommonParameters>]

Invoke-BpaModel [-ModelId] <String> [-RepositoryPath <String>] [-Mode <ScanMode>] [-SubModelId <String>] [-Context <String>] [-ComputerName <String[]>] [-CertificateThumbprint <String>] [-ConfigurationName <String>] [-Credential <PSCredential>] [-Authentication <AuthenticationMechanism>] [-Port <Int32>] [-ThrottleLimit <Int32>] [-UseSsl] [<CommonParameters>]

—————–EXAMPLE 1—————–
PS C:>Invoke-BPAModel -ModelId ModelId1
This example starts a BPA scan on the model that is represented by ModelId1.
The same task can be completed by running any of the following cmdlets.
Invoke-BPAModel -ModelId ModelId1
OR –
Invoke-BPAModel -Id ModelId1
OR –
Invoke-BPAModel ModelId1

—————–EXAMPLE 2—————–
PS C:>Invoke-BPAModel –ModelId ModelId1 -ArgumentTable @{context=domain; name=TOSSolution.com;}
This example starts a BPA scan on the specified model ID. The ArgumentTable parameter helps the administrator start a BPA scan with additional model-specific instructions. In this example, the values of additional and required model parameters are specified by using the ArgumentTable parameter. The scan is focused only on those parts of the model that occur in the TOSSolution.com domain.

—————–EXAMPLE 3—————–
PS C:>Get-BPAModel | Invoke-BPAModel
This example gets all BPA models that are installed on the computer, and then pipes the results of the Get-BPAModel cmdlet to this cmdlet to start a BPA scan on all models.

You can check the Version, CommandType and Source of this cmdlet by giving below command.

Get-Command Invoke-BpaModel

Get-Command Invoke-BpaModel powershell script command cmdlet bpa best practices

You can also read about

To know more PowerShell cmdlets(Commands) on BestPractices click here

Click on this Link for an Single place where you get all the PowerShell cmdlet sorted based on the modules.

You can also refer other blogs on PowerShell at link

You can also refer other blogs on Microsoft at link

And also if you required any technology you want to learn, let us know below we will publish them in our site http://tossolution.com/

Like our page in Facebook and follow us for New technical information.

References are taken from Microsoft

Leave a Reply

Your email address will not be published. Required fields are marked *