Skip to content

Commit

Permalink
Pass trace params as array rather than splatted hashtable (#376)
Browse files Browse the repository at this point in the history
# Description
Summary of changes:
This pull request includes a minor change to the `Start-SdnNetshTrace`
function in the `src/modules/SdnDiag.Common.psm1` file. The change
corrects the way the `ArgumentList` parameter is passed to the
`Invoke-PSRemoteCommand` cmdlet.

*
[`src/modules/SdnDiag.Common.psm1`](diffhunk://#diff-9ab71f66f6e21719dc9527f01ea738656003bbbe631f4f1bd85ab1ab8a746f24L2182-R2182):
Changed the `ArgumentList` parameter from `@traceParams` to
`$traceParams` in the `Invoke-PSRemoteCommand` cmdlet within the
`Start-SdnNetshTrace` function.

# Change type
- [x] Bug fix (non-breaking change)
- [ ] Code style update (formatting, local variables)
- [ ] New Feature (non-breaking change that adds new functionality
without impacting existing)
- [ ] Breaking change (fix or feature that may cause functionality
impact)
- [ ] Other

# Checklist:
- [x] My code follows the style and contribution guidelines of this
project.
- [x] I have tested and validated my code changes.
  • Loading branch information
arudell authored Jan 29, 2025
1 parent b7b2b7b commit f0c7678
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/SdnDiag.Common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2179,7 +2179,7 @@ function Start-SdnNetshTrace {
try {
if ($PSCmdlet.ParameterSetName -eq 'Remote') {
$traceParams.Add('Role', $Role)
Invoke-PSRemoteCommand -ComputerName $ComputerName -Credential $Credential -ScriptBlock { Start-SdnNetshTrace } -ArgumentList @traceParams
Invoke-PSRemoteCommand -ComputerName $ComputerName -Credential $Credential -ScriptBlock { Start-SdnNetshTrace } -ArgumentList $traceParams
}
else {
$traceProviderString = Get-TraceProviders -Role $Role -Providers $Providers -AsString
Expand Down

0 comments on commit f0c7678

Please sign in to comment.