@@ -227,6 +227,7 @@ Show = $Show"
227
227
}
228
228
catch {
229
229
Write-Warning " We aren't going to get very far without creating the $DownloadFolder "
230
+ Write-Warning " Run `$ Error[0] | Fl -Force to find out what happened"
230
231
Return
231
232
}
232
233
}
@@ -238,6 +239,7 @@ Show = $Show"
238
239
}
239
240
catch {
240
241
Write-Warning " We aren't going to get very far without creating the $InstallationFolder "
242
+ Write-Warning " Run `$ Error[0] | Fl -Force to find out what happened"
241
243
Return
242
244
}
243
245
}
@@ -247,8 +249,9 @@ Show = $Show"
247
249
$null = New-Item $DataFolder - ItemType Directory
248
250
}
249
251
}
250
- catch {
252
+ catch {
251
253
Write-Warning " We aren't going to get very far without creating the $DataFolder "
254
+ Write-Warning " Run `$ Error[0] | Fl -Force to find out what happened"
252
255
}
253
256
}
254
257
# endregion
@@ -288,7 +291,8 @@ Show = $Show"
288
291
}
289
292
}
290
293
catch {
291
- Write-Warning " The Beard is sad! There was an error downloading file :( $_ "
294
+ Write-Warning " The Beard is sad! There was an error downloading file :( "
295
+ Write-Warning " Run `$ Error[0] | Fl -Force to find out what happened"
292
296
return
293
297
}
294
298
}
@@ -314,6 +318,7 @@ Show = $Show"
314
318
}
315
319
else {
316
320
Write-Warning " Hmm something has gone wrong - where is the zip file? It should be $FilePath "
321
+ Write-Warning " Run `$ Error[0] | Fl -Force to find out what happened"
317
322
Return
318
323
}
319
324
}
@@ -326,8 +331,9 @@ Show = $Show"
326
331
try {
327
332
$Ag = Get-DbaAvailabilityGroup - SqlInstance $SQLInstance - AvailabilityGroup $AvailabilityGroup
328
333
}
329
- catch {
334
+ catch {
330
335
Write-Warning " Failed to get the informatio about the Availability Group - Gonna have to stop"
336
+ Write-Warning " Run `$ Error[0] | Fl -Force to find out what happened"
331
337
}
332
338
333
339
$replicastring = ForEach ($replica in $Ag.AvailabilityReplicas.Name ) {
@@ -346,6 +352,7 @@ Show = $Show"
346
352
}
347
353
catch {
348
354
Write-Warning " We aren't going to get very far without creating the folder $InstanceFolder for the data for the replica $Replica "
355
+ Write-Warning " Run `$ Error[0] | Fl -Force to find out what happened"
349
356
Return
350
357
}
351
358
}
@@ -393,8 +400,9 @@ Show = $Show"
393
400
try {
394
401
$Errorlogpath = (Get-DbaErrorLogConfig - SqlInstance $replica ).LogPath
395
402
}
396
- catch {
403
+ catch {
397
404
Write-Warning " Failed to get the error log path for the replica $replica - Going to be difficult to gather all the data for $replica "
405
+ Write-Warning " Run `$ Error[0] | Fl -Force to find out what happened"
398
406
}
399
407
400
408
$UNCErrorLogPath = ' \\' + $replicaHostName + ' \' + $Errorlogpath.Replace (' :' , ' $' )
@@ -432,7 +440,9 @@ Show = $Show"
432
440
}
433
441
}
434
442
catch {
443
+
435
444
Write-Warning " Failed to get all of the information from the replica $replica - need to stop"
445
+ Write-Warning " Run `$ Error[0] | Fl -Force to find out what happened"
436
446
Return
437
447
}
438
448
}
@@ -449,6 +459,7 @@ Show = $Show"
449
459
}
450
460
catch {
451
461
Write-Warning " Failed to copy the files to the installation folder - Cant carry on"
462
+ Write-Warning " Run `$ Error[0] | Fl -Force to find out what happened"
452
463
return
453
464
}
454
465
@@ -478,6 +489,7 @@ Show = $Show"
478
489
}
479
490
catch {
480
491
Write-Warning " Failed to create the configuration json file- cant continue"
492
+ Write-Warning " Run `$ Error[0] | Fl -Force to find out what happened"
481
493
}
482
494
}
483
495
0 commit comments