powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Set-BpaResult



NAME
Set-BPAResult

SYNOPSIS
The Set-BPAResult cmdlet allows you to exclude or include existing results of a Best Practices Analyzer (BPA) scan
to show you only the scan results that you want to see.

SYNTAX
Set-BPAResult [-BestPracticesModelId] [-Results] > [[-Exclude]] []


DESCRIPTION
The Set-BPAResult cmdlet allows you to exclude or include existing results of a Best Practices Analyzer (BPA) scan
to show you only the scan results that you want to see. The action specified in the cmdlet (Exclude, for example) d
etermines how the existing results of a BPA scan are updated. Set-BPAResult is typically applied after using the Ge
t-BPAResult cmdlet to return a collection of scan results. You can apply filters to results returned by the Get-BP
AResult cmdlet, and then pipe the filtered collection of results to the Set-BPAResult cmdlet, specifying either to
include or exclude filtered scan results.


PARAMETERS
-BestPracticesModelId
Specifies the command ID of the Best Practices Analyzer model for which you want to modify scan results. Note t
hat the Set-BPAResult cmdlet does not start a new scan. You can also use the short form of the -BestPracticesMo
delId parameter, -Id.

Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Exclude []
Removes any BPA scan results from a results file that are specified by a filter added to the Set-BPAResults com
mand. The Exclude action applies to all results returned by the Set-BPAResult command. To exclude results by u
sing the -Exclude parameter, add the value $true following the parameter, as shown:

-Exclude $true

Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Results >
Specifies the result collection to be updated in the result file returned by the Set-BPAResults cmdlet. The -R
esults parameter is typically used to specify a filtered subset of scan results that has already been stored in
a variable; the variable name is provided as the valid value for the -Results parameter. For example, if you
have created a variable $allPerformance to store all the Performance category results for a BPA scan of all rol
es on a computer, and you want to exclude those Performance results from the complete collection of scan result
s, you add the parameter -Results $allPerformance to a Set-BPAResult cmdlet. For more detailed examples, see t
he Examples section.

Required? true
Position? 4
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS




OUTPUTS




NOTES


If the Set-BPAResult command is canceled before the results are written to a file, the operation is canceled an
d the results file is not modified. If cancellation occurs after the results file has been modified, the comman
d's actions are carried out, and the command cannot be canceled.


-------------------------- EXAMPLE 1 --------------------------

C:\PS>Get-BPAResult -BestPracticesModelId | Where { $_.Category -eq "Performance" } | Set-BPAR
esult -Id -Exclude $true


Description
-----------
The first section of the preceding example, to the left of the first pipe character (|), uses the Get-BPAResult cmd
let to retrieve Best Practices Analyzer scan results for the model ID represented by "Specified Model Id." The seco
nd section of the command filters the results of the Get-BPAResult cmdlet to get only those scan results for which
the category name is equal to "Performance." The final section of the example, following the second pipe character,
excludes the Performance results filtered by the previous section of the example.





-------------------------- EXAMPLE 2 --------------------------

C:\PS>$rcPolicy = Get-BPAResult -BestPracticesModelId | Where { $_.Category -eq "Policy" }
Set-BPAResult -Id -Exclude $true -Results $rcPolicy


Description
-----------
The first line of the preceding example, to the left of the pipe character (|), instructs the Get-BPAResult cmdlet
to retrieve Best Practices Analyzer scan results for the model represented by "Specified Model Id." The second sect
ion of the example, after the pipe character, filters the results of the Get-BPAResult cmdlet to return only those
scan results for which the category name is equal to (note the -eq option) Policy. The variable $rcPolicy is create
d to store the filtered results of the Get-BPAResult cmdlet; this variable can be used in subsequent commands to re
present those results.

The second line of the command uses the Set-BPAResult cmdlet to exclude the set of results stored in the $rcPolicy
variable, for the specified model ID. In this example, the -Results parameter is added because the administrator wa
nts to exclude a specific subset of scan results for that model, and has created the variable $rcPolicy to represen
t that subset of results.






RELATED LINKS
Online version: http://go.microsoft.com/fwlink/?LinkId=141492
Invoke-BPAModel
Get-BPAModel
Get-BPAResult