Skip to content

Commit

Permalink
Change -Path parameter alias from -f to -p #99 (#100)
Browse files Browse the repository at this point in the history
* Add accepted values of InputFormat
* Change path alias from -f to -p #99
  • Loading branch information
BernieWhite authored Mar 1, 2019
1 parent 49d2417 commit e4de52e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
## Unreleased

- Added support for input deserialization from FileInfo objects [#95](https://github.com/BernieWhite/PSRule/issues/95)
- **Breaking change** - Changed parameter alias for `-Path` from `-f` to `-p` [#99](https://github.com/BernieWhite/PSRule/issues/99)

## v0.3.0-B190231 (pre-release)

Expand Down
2 changes: 1 addition & 1 deletion PSRule.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ task BuildHelp BuildModule, PlatyPS, {
$Null = Copy-Item -Path out/docs/PSRule/* -Destination out/modules/PSRule/en-AU;
}

task ScaffoldHelp BuildModule, {
task ScaffoldHelp Build, {

Import-Module (Join-Path -Path $PWD -ChildPath out/modules/PSRule) -Force;

Expand Down
2 changes: 1 addition & 1 deletion docs/commands/PSRule/en-US/Get-PSRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ If the `-Module` parameter is used, rule definitions from the currently working
```yaml
Type: String[]
Parameter Sets: (All)
Aliases: f
Aliases: p
Required: False
Position: 0
Expand Down
9 changes: 2 additions & 7 deletions docs/commands/PSRule/en-US/Invoke-PSRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ If the `-Module` parameter is used, rule definitions from the currently working
```yaml
Type: String[]
Parameter Sets: (All)
Aliases: f
Aliases: p
Required: False
Position: 0
Expand Down Expand Up @@ -237,16 +237,11 @@ Accept wildcard characters: False

Configures the input format for when a string is passed in as a target object. By default, strings are just treated as raw text. However, when set strings can be read as YAML or JSON and converted to an object.

The following formats are available:

- None
- Yaml
- Json

```yaml
Type: InputFormat
Parameter Sets: (All)
Aliases:
Accepted values: None, Yaml, Json
Required: False
Position: Named
Expand Down
9 changes: 2 additions & 7 deletions docs/commands/PSRule/en-US/Test-PSRuleTarget.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ If the `-Module` parameter is used, rule definitions from the currently working
```yaml
Type: String[]
Parameter Sets: (All)
Aliases: f
Aliases: p

Required: False
Position: 1
Expand Down Expand Up @@ -136,16 +136,11 @@ Accept wildcard characters: False

Configures the input format for when a string is passed in as a target object. By default, strings are just treated as raw text. However, when set strings can be read as YAML or JSON and converted to an object.

The following formats are available:

- None
- Yaml
- Json

```yaml
Type: InputFormat
Parameter Sets: (All)
Aliases:
Accepted values: None, Yaml, Json
Required: False
Position: Named
Expand Down
10 changes: 5 additions & 5 deletions src/PSRule/PSRule.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function Invoke-PSRule {
param (
# A list of paths to check for rule definitions
[Parameter(Position = 0)]
[Alias('f')]
[Alias('p')]
[String[]]$Path = $PWD,

# Filter to rules with the following names
Expand All @@ -71,7 +71,7 @@ function Invoke-PSRule {
[PSRule.Configuration.ResultFormat]$As = [PSRule.Configuration.ResultFormat]::Detail,

[Parameter(Mandatory = $False)]
[ValidateSet('Yaml', 'Json')]
[ValidateSet('None', 'Yaml', 'Json')]
[PSRule.Configuration.InputFormat]$Format,

[Parameter(Mandatory = $False)]
Expand Down Expand Up @@ -182,7 +182,7 @@ function Test-PSRuleTarget {
param (
# A list of paths to check for rule definitions
[Parameter(Position = 0)]
[Alias('f')]
[Alias('p')]
[String[]]$Path = $PWD,

# Filter to rules with the following names
Expand All @@ -201,7 +201,7 @@ function Test-PSRuleTarget {
[PSRule.Configuration.PSRuleOption]$Option,

[Parameter(Mandatory = $False)]
[ValidateSet('Yaml', 'Json')]
[ValidateSet('None', 'Yaml', 'Json')]
[PSRule.Configuration.InputFormat]$Format,

[Parameter(Mandatory = $False)]
Expand Down Expand Up @@ -301,7 +301,7 @@ function Get-PSRule {
param (
# A list of paths to check for rule definitions
[Parameter(Position = 0, Mandatory = $False)]
[Alias('f')]
[Alias('p')]
[String[]]$Path = $PWD,

# Filter to rules with the following names
Expand Down

0 comments on commit e4de52e

Please sign in to comment.