PoshCode Archive  Artifact Content

Artifact 5122c86538b959cf4516c8159d8b27e1a0df2e7f7fe066d165fb718901c6ded5:

  • File Show-Databases-on-server.ps1 — part of check-in [b766696cb8] at 2018-06-10 13:41:10 on branch trunk — ############################################################################################# (user: Rob Sewell size: 1116)

# encoding: utf-8
# api: powershell
# title: Show Databases on server
# description: #############################################################################################
# version: 0.1
# type: function
# author: Rob Sewell
# license: CC0
# function: Show-DatabasesOnServer
# x-poshcode-id: 4454
# x-archived: 2016-10-24T23:42:54
# x-published: 2013-09-10T14:34:00
#
# #
# NAME: Show-DatabasesOnServer.ps1
# AUTHOR: Rob Sewell http://sqldbawithabeard.com
# DATE:22/07/2013
# #
# COMMENTS: Load function for finding a databases on Server
# 覧覧覧覧覧覧覧覧覧覧覧覧
#

 #############################################################################################
#
# NAME: Show-DatabasesOnServer.ps1
# AUTHOR: Rob Sewell http://sqldbawithabeard.com
# DATE:22/07/2013
#
# COMMENTS: Load function for finding a databases on Server
# 覧覧覧覧覧覧覧覧覧覧覧覧


Function Show-DatabasesOnServer ([string]$Server)
{
$srv = New-Object ('Microsoft.SqlServer.Management.Smo.Server') $server

Write-Host " The Databases on $Server Are As Follows"
$srv.databases| Select Name
}