Skip to content

Commit

Permalink
warning to verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 27, 2017
1 parent 4e116fe commit ccea650
Show file tree
Hide file tree
Showing 24 changed files with 102 additions and 102 deletions.
8 changes: 4 additions & 4 deletions functions/Copy-DbaAgentAlert.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function Copy-DbaAgentAlert {
if ($force -eq $false) {
$copyAgentAlertStatus.Status = "Skipped"
$copyAgentAlertStatus
Write-Message -Message "Alert [$alertName] exists at destination. Use -Force to drop and migrate." -Level Warning
Write-Message -Message "Alert [$alertName] exists at destination. Use -Force to drop and migrate." -Level Verbose
continue
}

Expand All @@ -183,22 +183,22 @@ function Copy-DbaAgentAlert {
$destSevConflict = $destAlerts | Where-Object Severity -eq $serverAlert.Severity
$destSevDbConflict = $destAlerts | Where-Object { $_.Severity -eq $serverAlert.Severity -and $_.DatabaseName -eq $serverAlert.DatabaseName }
if ($destSevConflict) {
Write-Message -Level Warning -Message "Alert [$($destSevConflict.Name)] has already been defined to use the severity $($serverAlert.Severity). Skipping."
Write-Message -Level Verbose -Message "Alert [$($destSevConflict.Name)] has already been defined to use the severity $($serverAlert.Severity). Skipping."

$copyAgentAlertStatus.Status = "Skipped"
$copyAgentAlertStatus
continue
}
if ($destSevDbConflict) {
Write-Message -Level Warning -Message "Alert [$($destSevConflict.Name)] has already been defined to use the severity $($serverAlert.Severity) on database $($severAlert.DatabaseName). Skipping."
Write-Message -Level Verbose -Message "Alert [$($destSevConflict.Name)] has already been defined to use the severity $($serverAlert.Severity) on database $($severAlert.DatabaseName). Skipping."

$copyAgentAlertStatus.Status = "Skipped"
$copyAgentAlertStatus
continue
}

if ($serverAlert.JobName -and $destServer.JobServer.Jobs.Name -NotContains $serverAlert.JobName) {
Write-Message -Level Warning -Message "Alert [$alertName] has job [$($serverAlert.JobName)] configured as response. The job does not exist on destination $destServer. Skipping."
Write-Message -Level Verbose -Message "Alert [$alertName] has job [$($serverAlert.JobName)] configured as response. The job does not exist on destination $destServer. Skipping."

$copyAgentAlertStatus.Status = "Skipped"
$copyAgentAlertStatus
Expand Down
6 changes: 3 additions & 3 deletions functions/Copy-DbaAgentCategory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function Copy-DbaAgentCategory {
if ($force -eq $false) {
$copyJobCategoryStatus.Status = "Skipped"
$copyJobCategoryStatus
Write-Message -Level Warning -Message "Job category $categoryName exists at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "Job category $categoryName exists at destination. Use -Force to drop and migrate."
continue
}
else {
Expand Down Expand Up @@ -223,7 +223,7 @@ function Copy-DbaAgentCategory {
if ($force -eq $false) {
$copyOperatorCategoryStatus.Status = "Skipped"
$copyOperatorCategoryStatus
Write-Message -Level Warning -Message "Operator category $categoryName exists at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "Operator category $categoryName exists at destination. Use -Force to drop and migrate."
continue
}
else {
Expand Down Expand Up @@ -308,7 +308,7 @@ function Copy-DbaAgentCategory {
if ($force -eq $false) {
$copyAlertCategoryStatus.Status = "Skipped"
$copyAlertCategoryStatus
Write-Message -Level Warning -Message "Alert category $categoryName exists at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "Alert category $categoryName exists at destination. Use -Force to drop and migrate."
continue
}
else {
Expand Down
12 changes: 6 additions & 6 deletions functions/Copy-DbaAgentJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function Copy-DbaAgentJob {
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Notes = "Job is associated with maintenance plan"
$copyJobStatus
Write-Message -Level Warning -Message "Job [$jobName] is associated with Maintenance Plan: $MaintenancePlanName"
Write-Message -Level Verbose -Message "Job [$jobName] is associated with Maintenance Plan: $MaintenancePlanName"
continue
}

Expand All @@ -162,7 +162,7 @@ function Copy-DbaAgentJob {
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Notes = "Job is dependent on database: $missingDb"
$copyJobStatus
Write-Message -Level Warning -Message "Database(s) $missingDb doesn't exist on destination. Skipping job [$jobName]."
Write-Message -Level Verbose -Message "Database(s) $missingDb doesn't exist on destination. Skipping job [$jobName]."
continue
}

Expand All @@ -174,7 +174,7 @@ function Copy-DbaAgentJob {
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Notes = "Job is dependent on login $missingLogin"
$copyJobStatus
Write-Message -Level Warning -Message "Login(s) $missingLogin doesn't exist on destination. Use -Force to set owner to [sa]. Skipping job [$jobName]."
Write-Message -Level Verbose -Message "Login(s) $missingLogin doesn't exist on destination. Use -Force to set owner to [sa]. Skipping job [$jobName]."
continue
}
}
Expand All @@ -187,7 +187,7 @@ function Copy-DbaAgentJob {
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Notes = "Job is dependent on proxy $($proxyNames[0])"
$copyJobStatus
Write-Message -Level Warning -Message "Proxy Account(s) $($proxyNames[0]) doesn't exist on destination. Skipping job [$jobName]."
Write-Message -Level Verbose -Message "Proxy Account(s) $($proxyNames[0]) doesn't exist on destination. Skipping job [$jobName]."
continue
}

Expand All @@ -199,7 +199,7 @@ function Copy-DbaAgentJob {
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Notes = "Job is dependent on operator $missingOperator"
$copyJobStatus
Write-Message -Level Warning -Message "Operator(s) $($missingOperator) doesn't exist on destination. Skipping job [$jobName]"
Write-Message -Level Verbose -Message "Operator(s) $($missingOperator) doesn't exist on destination. Skipping job [$jobName]"
continue
}

Expand All @@ -208,7 +208,7 @@ function Copy-DbaAgentJob {
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Notes = "Job already exist on destination"
$copyJobStatus
Write-Message -Level Warning -Message "Job $jobName exists at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "Job $jobName exists at destination. Use -Force to drop and migrate."
continue
}
else {
Expand Down
4 changes: 2 additions & 2 deletions functions/Copy-DbaAgentOperator.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ function Copy-DbaAgentOperator {
if ($force -eq $false) {
$copyOperatorStatus.Status = "Skipped"
$copyOperatorStatus
Write-Message -Level Warning -Message "Operator $operatorName exists at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "Operator $operatorName exists at destination. Use -Force to drop and migrate."
continue
}
else {
if ($failsafe.FailSafeOperator -eq $operatorName) {
Write-Message -Level Warning -Message "$operatorName is the failsafe operator. Skipping drop."
Write-Message -Level Verbose -Message "$operatorName is the failsafe operator. Skipping drop."
continue
}

Expand Down
6 changes: 3 additions & 3 deletions functions/Copy-DbaAgentProxyAccount.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function Copy-DbaAgentProxyAccount {
if ($null -eq $credentialtest) {
$copyAgentProxyAccountStatus.Status = "Skipped"
$copyAgentProxyAccountStatus
Write-Message -Level Warning -Message "Associated credential account, $CredentialName, does not exist on $destination. Skipping migration of $proxyName."
Write-Message -Level Verbose -Message "Associated credential account, $CredentialName, does not exist on $destination. Skipping migration of $proxyName."
continue
}

Expand All @@ -144,7 +144,7 @@ function Copy-DbaAgentProxyAccount {
if ($force -eq $false) {
$copyAgentProxyAccountStatus.Status = "Skipped"
$copyAgentProxyAccountStatus
Write-Message -Level Warning -Message "Server proxy account $proxyName exists at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "Server proxy account $proxyName exists at destination. Use -Force to drop and migrate."
continue
}
else {
Expand Down Expand Up @@ -182,7 +182,7 @@ function Copy-DbaAgentProxyAccount {
$copyAgentProxyAccountStatus.Status = "Skipping"
$copyAgentProxyAccountStatus

Write-Message -Level Warning -Message "One or more subsystems do not exist on the destination server. Skipping that part."
Write-Message -Level Verbose -Message "One or more subsystems do not exist on the destination server. Skipping that part."
}
else {
$copyAgentProxyAccountStatus.Status = "Failed"
Expand Down
4 changes: 2 additions & 2 deletions functions/Copy-DbaAgentSharedSchedule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ function Copy-DbaAgentSharedSchedule {
if ($force -eq $false) {
$copySharedScheduleStatus.Status = "Skipped"
$copySharedScheduleStatus
Write-Message -Level Warning -Message "Shared job schedule $scheduleName exists at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "Shared job schedule $scheduleName exists at destination. Use -Force to drop and migrate."
continue
}
else {
if ($destServer.JobServer.Jobs.JobSchedules.Name -contains $scheduleName) {
$copySharedScheduleStatus.Status = "Skipped"
$copySharedScheduleStatus
Write-Message -Level Warning -Message "Schedule [$scheduleName] has associated jobs. Skipping."
Write-Message -Level Verbose -Message "Schedule [$scheduleName] has associated jobs. Skipping."
continue
}
else {
Expand Down
6 changes: 3 additions & 3 deletions functions/Copy-DbaBackupDevice.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function Copy-DbaBackupDevice {
$copyBackupDeviceStatus.Status = "Skipped"
$copyBackupDeviceStatus

Write-Message -Level Warning -Message "backup device $deviceName exists at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "backup device $deviceName exists at destination. Use -Force to drop and migrate."
continue
}
else {
Expand Down Expand Up @@ -173,8 +173,8 @@ function Copy-DbaBackupDevice {
$destPath = Join-AdminUnc $destNetBios $backupDirectory

if ($Pscmdlet.ShouldProcess($destination, "Updating create code to use new path")) {
Write-Message -Level Warning -Message "$path doesn't exist on $destination"
Write-Message -Level Warning -Message "Using default backup directory $backupDirectory"
Write-Message -Level Verbose -Message "$path doesn't exist on $destination"
Write-Message -Level Verbose -Message "Using default backup directory $backupDirectory"

try {
Write-Message -Level Verbose -Message "Updating $deviceName to use $backupDirectory"
Expand Down
8 changes: 4 additions & 4 deletions functions/Copy-DbaCentralManagementServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function Copy-DbaCentralManagementServer {
if ($force -eq $false) {
$copyDestinationGroupStatus.Status = "Skipped"
$copyDestinationGroupStatus
Write-Message -Level Warning -Message "Destination group $groupName exists at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "Destination group $groupName exists at destination. Use -Force to drop and migrate."
continue
}
if ($Pscmdlet.ShouldProcess($destination, "Dropping group $groupName")) {
Expand Down Expand Up @@ -175,7 +175,7 @@ function Copy-DbaCentralManagementServer {
$copyInstanceStatus.Status = "Skipped"
$copyInstanceStatus

Write-Message -Level Warning -Message "$serverName is Central Management Server. Add prohibited. Skipping."
Write-Message -Level Verbose -Message "$serverName is Central Management Server. Add prohibited. Skipping."
continue
}
}
Expand All @@ -185,7 +185,7 @@ function Copy-DbaCentralManagementServer {
$copyInstanceStatus.Status = "Skipped"
$copyInstanceStatus

Write-Message -Level Warning -Message "Instance $instanceName exists in group $groupName at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "Instance $instanceName exists in group $groupName at destination. Use -Force to drop and migrate."
continue
}

Expand Down Expand Up @@ -252,7 +252,7 @@ function Copy-DbaCentralManagementServer {
$copyGroupStatus.Status = "Skipped"
$copyGroupStatus

Write-Message -Level Warning -Message "Subgroup $fromSubGroupName exists at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "Subgroup $fromSubGroupName exists at destination. Use -Force to drop and migrate."
continue
}

Expand Down
4 changes: 2 additions & 2 deletions functions/Copy-DbaCredential.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function Copy-DbaCredential {
$copyCredentialStatus.Status = "Skipping"
$copyCredentialStatus

Write-Message -Level Warning -Message "$credentialName exists $($destServer.Name). Skipping."
Write-Message -Level Verbose -Message "$credentialName exists $($destServer.Name). Skipping."
continue
}
else {
Expand Down Expand Up @@ -367,7 +367,7 @@ function Copy-DbaCredential {
$destination = $destServer.DomainInstanceName

if ($SourceSqlCredential.Username -ne $null) {
Write-Message -Level Warning -Message "You are using SQL credentials and this script requires Windows admin access to the $Source server. Trying anyway."
Write-Message -Level Verbose -Message "You are using SQL credentials and this script requires Windows admin access to the $Source server. Trying anyway."
}

if ($sourceServer.VersionMajor -lt 9 -or $destServer.VersionMajor -lt 9) {
Expand Down
2 changes: 1 addition & 1 deletion functions/Copy-DbaCustomError.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function Copy-DbaCustomError {
$copyCustomErrorStatus.Status = "Skipped"
$copyCustomErrorStatus

Write-Message -Level Warning -Message "Custom error $customErrorId $language exists at destination. Use -Force to drop and migrate."
Write-Message -Level Verbose -Message "Custom error $customErrorId $language exists at destination. Use -Force to drop and migrate."
continue
}
else {
Expand Down
Loading

0 comments on commit ccea650

Please sign in to comment.