Test-SbecConfig

Test-SbecConfig is accessible with the help of BootEventCollector module. To configure BootEventCollector, go through this link.

Synopsis

Validates a configuration.

Description

The Test-SbecConfig cmdlet validates a configuration for the Setup and Boot Event Collector.

This cmdlet checks a configuration for validity without applying it. This is similar to running the command bevtcol.exe -checkOnly, except that Test-SbecConfig uses the running service to perform the validation.

The values that Test-SbecConfig returns are a subset of those returned by Set-SbecActiveConfig, because Test-SbecConfig does not apply the configuration.

You must have the Builtin Administrator privilege to run this command.

This cmdlet is also available using the alias Validate-SbecConfig.

Parameters

-CimSession

Runs the cmdlet on the remote computers through a remote session. Enter a session object, such as the output of a New-CimSession or Get-CimSession cmdlet or an array of these objects. The default is to run the cmdlet on the local computer. For more information, see About_CimSession.

Type:CimSession[]
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ComputerName

Specifies the names of the computers on which you want to perform the operation. You can specify a fully qualified domain name (FQDN), a NetBIOS name, or an IP address for each computer. For more information see Invoke-CimMethod on MSDN.

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

-Content

Specifies the configuration to validate. The acceptable values for this parameter are:

  • A multiline string. Use \n to indicate line breaks.
  • An array of one-line strings. This cmdlet merges the array.
  • A mix of multiline strings and string arrays.
Type:String[]
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

-Continue

Indicates that this operation will not throw an exception if a failure occurs. Instead the caller should examine the output of the cmdlet for the error information.

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

Syntax

Test-SbecConfig [-Content] <String[]> [-Continue] [[-ComputerName] <String[]>] [[-CimSession] <CimSession[]>] [<CommonParameters>]

—————–Example 1—————–
Validate a configuration
PS C:\> $res = Test-SbecConfig -Content $NewBootConfig -Continue
This command validates the configuration in $NewBootConfig, and then stores the results in the $res variable. Because the Continue parameter is specified, the command does not throw an error if any errors occur.

—————–Example 2—————–
Validate a configuration using the pipeline
PS C:\> Get-Content BootConfig.xml | Test-SbecConfig -Continue | Format-List
This command validates the configuration from a file. Format-List prints all the returned information without reducing it.

—————–Example 3—————–
Validate a configuration and throw on error
PS C:\> $res = Test-SbecConfig -Content (Get-Content BootConfig.xml)
Validate the configuration from a file and throw on error.

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

Get-Command Test-SbecConfig

Get-Command Test-SbecConfig powershell script command cmdlet

You can also read about

  • Get-SbecActiveConfig
  • Set-SbecActiveConfig
  • Test-SbecActiveConfig

To know more PowerShell cmdlets(Commands) on BootEventCollector 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 *