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
14 changes: 4 additions & 10 deletions Tests/Engine/ModuleHelp.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -229,20 +229,14 @@ Describe 'Cmdlet parameter help' {
foreach($parameterAttribute in $parameter.Attributes) {
if ($parameterAttribute.ValueFromPipeline -eq $null) { continue }

$parameterHelpPipelineInput = if ($parameterHelp.pipelineInput -eq 'True (ByPropertyName, ByValue)') {
$true
}
else {
[System.Boolean]::Parse($parameterHelp.pipelineInput)
}
$parameterHelpPipelineInput = $parameterHelp.pipelineInput -eq 'True' -or $parameterHelp.pipelineInput -match 'ByPropertyName'

$parameterHelpPipelineInput | Should -Be $parameterAttribute.ValueFromPipelineByPropertyName `
-Because "Parameter $parameterName of command $CommandName and parameter set $($parameterAttribute.ParameterSetName) has correct ValueFromPipelineByPropertyName attribute"

if ($parameterHelp.pipelineInput -eq 'True (ByPropertyName, ByValue)') {
$parameterAttribute.ValueFromPipeline | Should -BeTrue `
-Because "Parameter $parameterName of command $CommandName and parameter set $($parameterAttribute.ParameterSetName) has correct ValueFromPipeline attribute"
}
$parameterHelpPipelineInput = $parameterHelp.pipelineInput -match 'ByValue'
$parameterHelpPipelineInput | Should -Be $parameterAttribute.ValueFromPipeline `
-Because "Parameter $parameterName of command $CommandName and parameter set $($parameterAttribute.ParameterSetName) has correct ValueFromPipeline attribute"
}
}

Expand Down
39 changes: 37 additions & 2 deletions docs/Cmdlets/Invoke-Formatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Formats script text or a file based on the input settings or default settings.

```
Invoke-Formatter [-ScriptDefinition] <string> [[-Settings] <Object>] [[-Range] <int[]>]
[<CommonParameters>]
[-WhatIf] [-Confirm] [<CommonParameters>]
Invoke-Formatter -Path <string> [[-Settings] <Object>] [[-Range] <int[]>]
[<CommonParameters>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -168,6 +168,41 @@ Accept pipeline input: True
Accept wildcard characters: False
```

### -Confirm

Prompts you for confirmation before writing changes to a file specified by **Path**. This parameter
has no effect when **ScriptDefinition** is used.

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

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf

Shows which files specified by **Path** would be changed without writing them. Formatting still
runs and the formatted text is returned. This parameter has no effect when **ScriptDefinition** is
used.

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

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
Expand Down