Databases Reference
In-Depth Information
If you wanted to list all the available folders under the DEFAULT instance, you could navigate to the
DEFAULT folder using the Get-Location cmdlet and then list all the folders using the Get-ChildItem
cmdlet (see Figure 11-15):
Set-Location \
Set-Location SQL
Set-Location PowerServer3
Set-Location DEFAULT
Get-ChildItem
Figure 11-15
You can keep navigating the hierarchy until the last node available, as shown in Figure 11-16. The follow-
ing example navigates all the way to the ExtendedProperties of the City column in the Person . Address
table in the AdventureWorks2008 database:
Set-Location Databases
Set-Location 'AdventureWorks2008'
Set-Location Tables
Set-Location Person.Address
Set-Location Columns
Set-Location City
Set-Location ExtendedProperties
Every folder contains different methods that can be invoked and different properties you can access and
set values to. In order to find all the methods and properties available under a hierarchal folder, you can
use the Get-item and Get-member cmdlets, as shown in Figure 11-17.
In order to find all the methods available under the folder Databases , use the following code:
Set-Location SQLSERVER:\SQL
Set-Location PowerServer3\DEFAULT\Databases
Get-Item . | Get-Member -Type Methods
Search WWH ::




Custom Search