Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 97 additions & 66 deletions versioned_docs/version-v4/commands/Add-AssertionOperator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ id: Add-ShouldOperator
# Override slug so url matches v4 name
slug: Add-AssertionOperator
title: Add-AssertionOperator
description: Help page for the Powershell Pester "Add-AssertionOperator" command
description: Help for Pester command 'Add-AssertionOperator'. Register an Assertion Operator with Pester
keywords:
- Powershell
- PowerShell
- Pester
- Help
- Documentation
Expand All @@ -15,15 +15,19 @@ hide_table_of_contents: false
custom_edit_url: null
---

:::info This page was generated
Contributions are welcome in [Pester-repo](https://github.com/pester/pester).
:::

## SYNOPSIS

Register an Assertion Operator with Pester

## SYNTAX

```powershell
Add-AssertionOperator [-Name] <String> [-Test] <ScriptBlock> [[-Alias] <String[]>] [[-InternalName] <String>]
[-SupportsArrayInput] [<CommonParameters>]
Add-AssertionOperator [-Name] <string> [-Test] <scriptblock> [[-Alias] <string[]>]
[[-InternalName] <string>] [-SupportsArrayInput]
```

## DESCRIPTION
Expand All @@ -37,7 +41,6 @@ This function allows you to create custom Should assertions.
```powershell
function BeAwesome($ActualValue, [switch] $Negate)
{

[bool] $succeeded = $ActualValue -eq 'Awesome'
if ($Negate) { $succeeded = -not $succeeded }

Expand Down Expand Up @@ -69,92 +72,120 @@ PS C:\> "bad" | should -BeAwesome

## PARAMETERS

### -Name
### -Alias

The name of the assertion.
This will become a Named Parameter of Should.
A list of aliases for the Named Parameter.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: System.String[]
DefaultValue: '@()'
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### -Test
### -InternalName

The test function.
The function must return a PSObject with a [Bool]succeeded and a [string]failureMessage property.
If -Name is different from the actual function name, record the actual function name here.
Used by Get-ShouldOperator to pull function help.

```yaml
Type: ScriptBlock
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### -Alias
### -Name

A list of aliases for the Named Parameter.
The name of the assertion.
This will become a Named Parameter of Should.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: @()
Accept pipeline input: False
Accept wildcard characters: False
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### -InternalName
### -SupportsArrayInput

If -Name is different from the actual function name, record the actual function name here.
Used by Get-ShouldOperator to pull function help.
Does the test function support the passing an array of values to test.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### -SupportsArrayInput
### -Test

Does the test function support the passing an array of values to test.
The test function.
The function must return a PSObject with a [Bool]succeeded and a [string]failureMessage property.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: System.Management.Automation.ScriptBlock
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
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](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand All @@ -164,6 +195,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## RELATED LINKS

## EDIT THIS PAGE
## VERSION

This page was auto-generated using Pester's comment based help. To edit the content of this page, change the corresponding help in the [pester/Pester v4](https://github.com/pester/Pester/tree/rel/4.x.x) repository. See our [contribution guide](https://github.com/pester/docs#contributing) for more information.
*This page was generated using comment-based help in [Pester 4.10.1](https://github.com/pester/pester).*
44 changes: 28 additions & 16 deletions versioned_docs/version-v4/commands/AfterAll.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
id: AfterAll
title: AfterAll
description: Help page for the Powershell Pester "AfterAll" command
description: Help for Pester command 'AfterAll'. Defines a series of steps to perform at the end of the current Context or Describe block.
keywords:
- Powershell
- PowerShell
- Pester
- Help
- Documentation
Expand All @@ -12,6 +12,10 @@ hide_table_of_contents: false
custom_edit_url: null
---

:::info This page was generated
Contributions are welcome in [Pester-repo](https://github.com/pester/pester).
:::

## SYNOPSIS

Defines a series of steps to perform at the end of the current Context
Expand All @@ -20,7 +24,7 @@ or Describe block.
## SYNTAX

```powershell
AfterAll [-Scriptblock] <ScriptBlock> [<CommonParameters>]
AfterAll [-Scriptblock] <scriptblock>
```

## DESCRIPTION
Expand All @@ -46,20 +50,28 @@ PS C:\> {{ Add example code here }}
the scriptblock to execute

```yaml
Type: ScriptBlock
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: System.Management.Automation.ScriptBlock
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
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](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand All @@ -69,8 +81,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## RELATED LINKS

[https://pester.dev/docs/v4/commands/BeforeAll](https://pester.dev/docs/v4/commands/BeforeAll)
- [https://pester.dev/docs/commands/BeforeAll](https://pester.dev/docs/commands/BeforeAll)

## EDIT THIS PAGE
## VERSION

This page was auto-generated using Pester's comment based help. To edit the content of this page, change the corresponding help in the [pester/Pester v4](https://github.com/pester/Pester/tree/rel/4.x.x) repository. See our [contribution guide](https://github.com/pester/docs#contributing) for more information.
*This page was generated using comment-based help in [Pester 4.10.1](https://github.com/pester/pester).*
Loading