CleanCode logo
sitemap
SEARCH:

CleanCode PowerShell Libraries v1.2.08 API: CleanCode » SqlTools » Get-DBPathInfo

Get-DBPathInfo

NAME

Get-DBPathInfo

SYNOPSIS

Infer values for server and database from SQLSERVER: drive.

SYNTAX

Get-DBPathInfo [<CommonParameters>]

DESCRIPTION

Infers the server instance and database from the current location or, if not on a SQL Server drive, then from the default SQLSERVER: drive. It extends the notion of default context. That is, you do not actually have to be on the SQLSERVER: drive, only to have set the current location on that drive to a server and database path.

PARAMETERS

<CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, see 
        about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 

INPUTS

None. You cannot pipe objects to Get-DBPathInfo.

OUTPUTS

Two-element array: first element contains server and instance name; second element contains database name.

NOTES



        This function is part of the CleanCode toolbox
        from http://cleancode.sourceforge.net/.

        Since CleanCode 1.1.05.

EXAMPLES


-------------------------- EXAMPLE 1 --------------------------

C:\PS>($serverCandidate, $dbCandidate) = Get-DBPathInfo

If your current location is *not* on a SQLSERVER: drive or alias, then the current location of the SQLSERVER: drive is used as the reference location. If your current location includes the SQLSERVER: drive or an alias to some node on it, that is the reference location. Either way, the reference location is examined to see if it contains a server and/or database. If either server or db are both are not found $null is returned for that item.

RELATED LINKS

-none-

This documentation set was created with CleanCode's DocTreeGenerator.

Valid XHTML 1.0!Valid CSS!Get CleanCode at SourceForge.net. Fast, secure and Free Open Source software downloads
Copyright © 2001-2015 Michael Sorens • Contact usPrivacy Policy
Usage governed by Mozilla Public License 1.1 and CleanCode Courtesy License
CleanCode -- The Website for Clean DesignRevised 2015.12.16