SeeminglyScience / EditorServicesCommandSuite

Collection of editor commands for use in PowerShell Editor Services.
Other
151 stars 13 forks source link

Splat Command splits OutputPath into Output and Path argument for Assert-PSRule #70

Closed Manbearpiet closed 2 years ago

Manbearpiet commented 2 years ago

Summary

I tried splatting the following command:

Assert-PSRule  -Module 'PSRule.Rules.Azure' -Format File -InputPath '$(System.DefaultWorkingDirectory)/Features/${{ parameters.workloadName }}/' -Style AzurePipelines -OutputFormat NUnit3 -OutputPath $(System.DefaultWorkingDirectory)/reports/ps-rule-results.xml

This produced:

$assertPSRuleSplat = @{
    Module = 'PSRule.Rules.Azure'
    Format = 'File'
    InputPath = '$(System.DefaultWorkingDirectory)/Features/${{ parameters.workloadName }}/'
    Style = 'AzurePipelines'
    OutputFormat = 'NUnit3'
    OutputPath = $(System.DefaultWorkingDirectory)
    Path = '/reports/ps-rule-results.xml'
}

Assert-PSRule  @assertPSRuleSplat

As you can see it splits OutputPath and it's value into OutputPath and Path. There is no Path Argument specified.

code --version                                                                                                                                                                                                                                      in pwsh at 14:43:36 
1.69.2
3b889b090b5ad5793f524b5d1d39fda662b96a2a
x64

$PSVersionTable                                                                                                                                                                                                                                     

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     1.0.0      beta4      EditorServicesCommandSuite          Desk      {Get-CommandSuiteSetting, Set-CommandSuiteSetting, New-CommandSuiteSettingFile, Add-ModuleQualification…}
Manbearpiet commented 2 years ago

PEBCAK, path containing should be enclosed in double quotes, unquoted delivers different results :).