Skip to content

Commit 075e17d

Browse files
2 parents 36afe87 + 2c0b6a0 commit 075e17d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Test-OLA.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,15 @@ Describe "Testing $Server Backup solution" {
6969
}
7070
}
7171

72+
if($Share.StartsWith('\\') -eq $False)
73+
{
74+
$UNC = $Share.Replace(':','$')
75+
$Root = '\\' + $ServerName + '\' + $UNC + '\' + $Folder
76+
}
77+
else
78+
{
7279
$Root = $Share + '\' + $Folder
80+
}
7381

7482
Context "New Backup Jobs on $server" {
7583
It "Agent should be running" {
@@ -105,7 +113,7 @@ Describe "Testing $Server Backup solution" {
105113
}
106114
}# foreach jobs
107115
} # end context new backup jobs
108-
Context "Other Maintenance Jobs on $Instance" {
116+
Context "Other Maintenance Jobs on $Server" {
109117
$Jobs = $Jobs.Where{($_.Name -eq 'DatabaseIntegrityCheck - SYSTEM_DATABASES') -or ($_.Name -eq 'DatabaseIntegrityCheck - USER_DATABASES') -or ($_.Name -eq 'IndexOptimize - USER_DATABASES')}
110118
foreach($job in $Jobs)
111119
{
@@ -128,7 +136,7 @@ Describe "Testing $Server Backup solution" {
128136
}# foreach jobs
129137

130138
} # end context other maintenanace jobs
131-
Context "OLA cleanup jobs on $Instance" {
139+
Context "OLA cleanup jobs on $Server" {
132140
$Jobs = $Jobs.Where{($_.Name -eq 'Output File Cleanup') -or ($_.Name -eq 'CommandLog Cleanup') -or ($_.Name -eq 'sp_delete_backuphistory') -or ($_.Name -eq 'sp_purge_jobhistory')}
133141
foreach($job in $Jobs)
134142
{

0 commit comments

Comments
 (0)