Skip to content

Add argument completers and defaults to bring user comfort for interactive scenario's #12

@Manbearpiet

Description

@Manbearpiet

Is your feature request related to a problem? Please describe.
While the module functions within a pipeline context in a script, some users prefer manual interaction with PowerShell. To provide user comfort to these users, Azure PowerShell their argument completers and some default values could be used to improve their user experience.

Describe the solution you'd like
Please implement the following for the resourceId's:

# This attribute will allow the user to autocomplete resource-ids for the specified resource type
[Parameter()]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceIdCompleter(
  "Microsoft.OperationalInsights/workspaces"
)]
[string]$ResourceId

and specifically for the tenantID parameter of the following function, as a default:

(Get-AzContext | Select-Object -ExpandProperty Tenant | Select-Object -ExpandProperty Id)

Describe alternatives you've considered
The alternative is either custom scripting it with argument completers or not doing it

Additional context

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[array]$ResourceId

And for the WorkspaceName and ResourceGroupName param:

# This attribute will allow the user to autocomplete with valid resource groups
[Parameter()]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]
$ResourceGroupName,

# This attribute will allow the user to autocomplete resourcenames within the supplied resourcegroups
[Parameter()]
[String]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
  "Microsoft.OperationalInsights/workspaces",
  "ResourceGroupName"
)]
$WorkspaceName
)

[string]$WorkspaceName, # //TODO: Add validation for workspace name

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions