Skip to content

Commit f24f9bc

Browse files
RobRob
Rob
authored and
Rob
committed
made sure it works with no filters!
1 parent a052dcc commit f24f9bc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

notebooks/NotDotNet/Agent/AGENT - Agent Jobs and schedules to Excel.ipynb

+8-4
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,16 @@
8282
"cell_type": "code",
8383
"source": [
8484
"$ExcelDirectory = 'c:\\temp\\' # Alter this to the directory you want the file created\r\n",
85-
"$SqlInstances = '' # Alter this for the SQL Instance you want to get the agent jobs for\r\n",
85+
"$SqlInstances = 'SQL2017N5' # Alter this for the SQL Instance you want to get the agent jobs for\r\n",
8686
"$FilterInclude = '' #'OLA*','DevOps*', 'SSIS*' # to filter to include specific jobs add them here in single quotes use * for the wild card IE '*FULL*', 'SQLWATCH*' , 'DBA*'\r\n",
8787
"$FilterExclude = '' # 'DevOps*', 'SSIS*' # to filter to exclude specific jobs add them here in single quotes use * for the wild card IE '*FULL*', 'SQLWATCH*' , 'DBA*'\r\n",
8888
"Write-Output \"Processing $sqlinstances\""
8989
],
9090
"metadata": {
9191
"azdata_cell_guid": "0ad19104-eb88-4c73-bfee-197cc6946f07",
92-
"tags": []
92+
"tags": [
93+
"hide_input"
94+
]
9395
},
9496
"outputs": [],
9597
"execution_count": null
@@ -115,7 +117,7 @@
115117
"}\r\n",
116118
"\r\n",
117119
"if (($FilterInclude -eq '') -and ($FilterExclude -eq '') ){\r\n",
118-
" $Filter = {$psitem.AgentJob -like '*'}\r\n",
120+
" $WhereString = {$psitem.AgentJob -like '*'}\r\n",
119121
"} elseif (($FilterInclude -ne '') -and ($FilterExclude -eq '')) { \r\n",
120122
"$WhereArray = @() \r\n",
121123
" $FilterInclude.ForEach{\r\n",
@@ -323,7 +325,9 @@
323325
],
324326
"metadata": {
325327
"azdata_cell_guid": "1d73d504-79a1-473b-974f-1cef90ced761",
326-
"tags": []
328+
"tags": [
329+
"hide_input"
330+
]
327331
},
328332
"outputs": [],
329333
"execution_count": null

0 commit comments

Comments
 (0)