@@ -18,7 +18,7 @@ Get and update search results
18
18
#>
19
19
function Test-SearchGetSearchResultsAndUpdate
20
20
{
21
- $rgname = " mms-eus"
21
+ $rgname = " mms-eus"
22
22
$wsname = " 188087e4-5850-4d8b-9d08-3e5b448eaecd"
23
23
24
24
$top = 5
@@ -45,9 +45,15 @@ Get schemas for a given workspace
45
45
#>
46
46
function Test-SearchGetSchema
47
47
{
48
- $rgname = " mms-eus"
49
- $wsname = " 188087e4-5850-4d8b-9d08-3e5b448eaecd"
48
+ $wsname = Get-ResourceName
49
+ $dsName = Get-ResourceName
50
+ $rgname = Get-ResourceGroupName
51
+ $wslocation = Get-ProviderLocation
52
+
53
+ New-AzureRmResourceGroup - Name $rgname - Location $wslocation - Force
50
54
55
+ # Create a workspace to house the data sources
56
+ $workspace = New-AzureRmOperationalInsightsWorkspace - ResourceGroupName $rgname - Name $wsname - Location $wslocation - Sku premium - Force
51
57
$schema = Get-AzureRmOperationalInsightsSchema - ResourceGroupName $rgname - WorkspaceName $wsname
52
58
Assert-NotNull $schema
53
59
Assert-NotNull $schema.Metadata
@@ -61,7 +67,7 @@ Get saved searches and search results from a saved search
61
67
#>
62
68
function Test-SearchGetSavedSearchesAndResults
63
69
{
64
- $rgname = " mms-eus"
70
+ $rgname = " mms-eus"
65
71
$wsname = " 188087e4-5850-4d8b-9d08-3e5b448eaecd"
66
72
67
73
$savedSearches = Get-AzureRmOperationalInsightsSavedSearch - ResourceGroupName $rgname - WorkspaceName $wsname
@@ -93,8 +99,15 @@ Create a new saved search, update, and then remove it
93
99
#>
94
100
function Test-SearchSetAndRemoveSavedSearches
95
101
{
96
- $rgname = " mms-eus"
97
- $wsname = " 188087e4-5850-4d8b-9d08-3e5b448eaecd"
102
+ $wsname = Get-ResourceName
103
+ $dsName = Get-ResourceName
104
+ $rgname = Get-ResourceGroupName
105
+ $wslocation = Get-ProviderLocation
106
+
107
+ New-AzureRmResourceGroup - Name $rgname - Location $wslocation - Force
108
+
109
+ # Create a workspace to house the data sources
110
+ $workspace = New-AzureRmOperationalInsightsWorkspace - ResourceGroupName $rgname - Name $wsname - Location $wslocation - Sku premium - Force
98
111
99
112
$id = " test-new-saved-search-id-2015"
100
113
$displayName = " TestingSavedSearch"
@@ -124,8 +137,8 @@ function Test-SearchSetAndRemoveSavedSearches
124
137
125
138
# Set saved search cmdlet has issue with Etag. Temporarily comment out the call until it's fixed.
126
139
# Test updating the search
127
- # $query = "* | distinct Computer"
128
- # Set-AzureRmOperationalInsightsSavedSearch -ResourceGroupName $rgname -WorkspaceName $wsname -SavedSearchId $id -DisplayName $displayName -Category $category -Query $query -Tags $tags -Version $version -ETag $etag
140
+ $query = " * | distinct Computer"
141
+ Set-AzureRmOperationalInsightsSavedSearch - ResourceGroupName $rgname - WorkspaceName $wsname - SavedSearchId $id - DisplayName $displayName - Category $category - Query $query - Tags $tags - Version $version - ETag $etag
129
142
130
143
# Check that the search was updated
131
144
$savedSearches = Get-AzureRmOperationalInsightsSavedSearch - ResourceGroupName $rgname - WorkspaceName $wsname
0 commit comments