Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #8 add support for spaces in group name #9

Merged
merged 1 commit into from
Sep 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Public/Add-AzWorkspaceManagerGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function Add-AzWorkspaceManagerGroup {

[Parameter(Mandatory = $true, ValueFromPipeline = $false)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[ValidatePattern('^[A-Za-z0-9]+( [A-Za-z0-9-]+[A-Za-z0-9])*$', ErrorMessage="It does not match expected pattern '{1}'")]
[string]$Name,

[Parameter(Mandatory = $false, ValueFromPipeline = $false)]
Expand Down Expand Up @@ -54,7 +54,7 @@ function Add-AzWorkspaceManagerGroup {
if ($SessionVariables.workspaceManagerConfiguration -eq 'Enabled') {
try {
Write-Verbose "Adding Workspace Manager Group to workspace [$WorkspaceName)]"
$uri = "$($SessionVariables.workspace)/providers/Microsoft.SecurityInsights/workspaceManagerGroups/$($Name)?api-version=$($SessionVariables.apiVersion)"
$uri = "$($SessionVariables.workspace)/providers/Microsoft.SecurityInsights/workspaceManagerGroups/$($Name.Replace(' ', '-'))?api-version=$($SessionVariables.apiVersion)"

$requestParam = @{
Headers = $authHeader
Expand Down Expand Up @@ -95,6 +95,8 @@ function Add-AzWorkspaceManagerGroup {
The name of the ResouceGroup where the log analytics workspace is located.
.PARAMETER Name
The name of the workspace manager group.
If an name is provided with spaces in it, the name will be converted to a name without spaces.
The display name will be the name with spaces.
.PARAMETER Description
The description of the workspace manager group. If not specified, the name will be used.
.PARAMETER workspaceManagerMembers
Expand Down
Loading