Skip to content

Code formatting: Splatting input parameters before Invoke-FabricRestMethod calls #87

@NowinskiK

Description

@NowinskiK

There is an idea to format input parameters as splatting with hash tables.
All original code files from @tiagobalabuch use multiple lines with ` characters.
Example:

        $response = Invoke-FabricRestMethod `
            -Uri $apiEndpointUrl `
            -Method Post `
            -Body $bodyJson

New format suggested by @jpomfret :

            $apiParams = @{
                Uri    = $apiEndpointURI
                method = 'Post'
                body   = $bodyJson
            }
            $response = Invoke-FabricRestMethod @apiParams

Microsoft Learn: about_splatting

These are cosmetic changes and should not impact the current code logic.

Stats:

Method # used
Invoke-FabricRestMethod ` 154
Invoke-FabricRestMethod @ (hash splatting) 10
Invoke-FabricRestMethod - (one line) 27

Metadata

Metadata

Assignees

No one assigned

    Labels

    standardizationNo logic changes, but refactoring and alignment to module's patterns

    Type

    No type

    Projects

    Status

    📌 Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions