Home Forums Programming Powershell If SQL DB exists, dont run function. If it doesnt run function. RE: If SQL DB exists, dont run function. If it doesnt run function.
gsc_dba
SSCertifiable
Points: 5407
More actions
February 25, 2016 at 4:22 am
#1860997
Untested but should work:
if ( $null -ne $server.Databases[$DBName] ) { $exists = $true } else { $exists = $false }