Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/AzWorkspaceManager.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $SessionVariables = [ordered]@{
baseUri = ''
ExpiresOn = ''
workspace = ''
apiVersion = '2023-10-01'
apiVersion = '2025-01-01-preview'
}

Set-Variable -Name Guid -Value (New-Guid).Guid -Scope Script -Force
Expand Down
6 changes: 5 additions & 1 deletion src/Private/Get-LogAnalyticsWorkspace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ function Get-LogAnalyticsWorkspace {
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage = "It does not match expected pattern '{1}'")]
[string]$Name,
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$Name,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName
)

Expand Down
1 change: 1 addition & 0 deletions src/Public/Add-AzWorkspaceManager.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function Add-AzWorkspaceManager {
[string]$Name,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $false, ValueFromPipeline = $true)]
Expand Down
7 changes: 5 additions & 2 deletions src/Public/Add-AzWorkspaceManagerAssignment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ function Add-AzWorkspaceManagerAssignment {
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[ValidateNotNullOrEmpty()]
[string]$WorkspaceName,
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidateNotNullOrEmpty()][Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $true, ValueFromPipeline = $false)]
Expand Down
6 changes: 5 additions & 1 deletion src/Public/Add-AzWorkspaceManagerAssignmentJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ function Add-AzWorkspaceManagerAssignmentJob {
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[string]$WorkspaceName, # //TODO: Add validation for workspace name
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $false, ValueFromPipeline = $false)]
Expand Down
6 changes: 5 additions & 1 deletion src/Public/Add-AzWorkspaceManagerGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ function Add-AzWorkspaceManagerGroup {
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[string]$WorkspaceName,
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $true, ValueFromPipeline = $false)]
Expand Down
6 changes: 5 additions & 1 deletion src/Public/Add-AzWorkspaceManagerMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ function Add-AzWorkspaceManagerMember {
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[string]$WorkspaceName,
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $false)]
Expand Down
17 changes: 10 additions & 7 deletions src/Public/Get-AzWorkspaceManager.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ function Get-AzWorkspaceManager {
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage = "It does not match expected pattern '{1}'")]
[string]$Name,
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$Name,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName
)

Expand All @@ -22,7 +25,7 @@ function Get-AzWorkspaceManager {
Get-LogAnalyticsWorkspace -Name $Name
}

try {
# try {
if ($SessionVariables.workspace) {
Write-Verbose "Get Microsoft Sentinel Workspace Manager Configuration for workspace '$Name'"
$uri = "$($SessionVariables.workspace)/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations?api-version=$($SessionVariables.apiVersion)"
Expand All @@ -47,10 +50,10 @@ function Get-AzWorkspaceManager {
Write-Message -FunctionName $($MyInvocation.MyCommand.Name) -Message "Workspace Manager is not configured for workspace '$Name'" -Severity 'Information'
$SessionVariables.workspaceManagerConfiguration = $false
}
}
catch {
Write-Message -FunctionName $($MyInvocation.MyCommand.Name) -Message $($_.Exception.Message) -Severity 'Error'
}
# }
# catch {
# Write-Message -FunctionName $($MyInvocation.MyCommand.Name) -Message $($_.Exception.Message) -Severity 'Error'
# }
}
<#
.SYNOPSIS
Expand Down
11 changes: 7 additions & 4 deletions src/Public/Get-AzWorkspaceManagerAssignment.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
function Get-AzWorkspaceManagerAssignment {
[cmdletbinding()]
param (
[Parameter(Mandatory = $false, ValueFromPipeline = $true)]
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[string]$WorkspaceName,
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipeline = $true)]
[ValidateNotNullOrEmpty()]
[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $false, ValueFromPipeline = $true)]
Expand Down
7 changes: 5 additions & 2 deletions src/Public/Get-AzWorkspaceManagerAssignmentJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ function Get-AzWorkspaceManagerAssignmentJob {
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[string]$WorkspaceName,
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $false)]
Expand Down
10 changes: 6 additions & 4 deletions src/Public/Get-AzWorkspaceManagerGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ function Get-AzWorkspaceManagerGroup {
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage = "It does not match expected pattern '{1}'")]
[string]$WorkspaceName,
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

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

Expand Down
8 changes: 6 additions & 2 deletions src/Public/Get-AzWorkspaceManagerItem.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ function Get-AzWorkspaceManagerItem {
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage = "It does not match expected pattern '{1}'")]
[string]$WorkspaceName,
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $false)]
Expand Down
8 changes: 6 additions & 2 deletions src/Public/Get-AzWorkspaceManagerMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ function Get-AzWorkspaceManagerMember {
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage = "It does not match expected pattern '{1}'")]
[string]$WorkspaceName,
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $false)]
Expand Down
6 changes: 5 additions & 1 deletion src/Public/Remove-AzWorkspaceManager.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ function Remove-AzWorkspaceManager {
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[string]$Name,
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$Name,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $false)]
Expand Down
6 changes: 5 additions & 1 deletion src/Public/Remove-AzWorkspaceManagerAssignment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ function Remove-AzWorkspaceManagerAssignment {
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[string]$WorkspaceName,
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $false)]
Expand Down
9 changes: 7 additions & 2 deletions src/Public/Remove-AzWorkspaceManagerAssignmentJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ function Remove-AzWorkspaceManagerAssignmentJob {
[cmdletbinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage = "It does not match expected pattern '{1}'")]
[string]$WorkspaceName,
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
Expand Down
8 changes: 6 additions & 2 deletions src/Public/Remove-AzWorkspaceManagerGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ function Remove-AzWorkspaceManagerGroup {
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage = "It does not match expected pattern '{1}'")]
[string]$WorkspaceName,
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
Expand Down
8 changes: 6 additions & 2 deletions src/Public/Remove-AzWorkspaceManagerMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ function Remove-AzWorkspaceManagerMember {
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage = "It does not match expected pattern '{1}'")]
[string]$WorkspaceName,
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$', ErrorMessage="It does not match expected pattern '{1}'")]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceNameCompleterAttribute(
"Microsoft.OperationalInsights/workspaces",
"ResourceGroupName"
)][string]$WorkspaceName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
[Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute()]
[string]$ResourceGroupName,

[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)]
Expand Down
Loading