external help file | Module Name | online version | schema |
---|---|---|---|
Bicep-help.xml |
Bicep |
2.0.0 |
Tests if a bicep or bicepparam file is valid.
Test-BicepFile [-Path] <String> [[-OutputType] <String>] [[-AcceptDiagnosticLevel] <BicepDiagnosticLevel>]
[-IgnoreDiagnosticOutput] [<CommonParameters>]
Tests if a bicep file is valid. Returns true/false by default, but can be made to return JSON output.
PS C:\> Test-BicepFile -Path 'MyBicep.bicep'
Returns true if the bicep file has no errors or warnings.
PS C:\> Test-BicepFile -Path 'MyBicep.bicep' -AcceptDiagnosticLevel 'Warning'
Returns true if the bicep file has no errors.
Set the highest level of diagnostic output that will be accepted for the test to pass. Setting Warning here will make a bicep file with errors fail the test while a bicep files with warnings will be tested valid.
Settings this to Error will accept anything. Since this is not a wanted scenario the command will throw an error.
Type: BicepDiagnosticLevel
Parameter Sets: (All)
Aliases:
Accepted values: Off, Info, Warning, Error
Required: False
Position: 2
Default value: Info
Accept pipeline input: False
Accept wildcard characters: False
Will run silently, not outputing any diagnostic information to the information stream.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Set format for output. Simple will only return true or false.
Type: String
Parameter Sets: (All)
Aliases:
Accepted values: Simple, Json
Required: False
Position: 1
Default value: Simple
Accept pipeline input: False
Accept wildcard characters: False
Path to a bicep file to test.
Type: String
Parameter Sets: (All)
Aliases: PSPath
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
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.