CleanCode logo
sitemap
SEARCH:

CleanCode PowerShell Libraries v1.2.08 API: CleanCode » SqlTools » Update-DBEnvironment

Update-DBEnvironment

NAME

Update-DBEnvironment

SYNOPSIS

Infer values for server and database into reference variables.

SYNTAX

Update-DBEnvironment [[-ServerInstance] <PSReference>] [[-Database] <PSReference>] [<CommonParameters>]

DESCRIPTION

Updates the supplied server instance and the database with inferred values if the supplied values are undefined. 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

-ServerInstance <PSReference>
        Reference to a character string specifying the name of an instance of
        the Database Engine. For default instances, only specify the computer name:
        "MyComputer". For named instances, use the format "ComputerName\InstanceName".
        If -ServerInstance is not specified Update-DBEnvironment attempts to infer it:
        * If on a SQLSERVER: drive (or alias) and the path specifies the SQL folder,
        Update-DBEnvironment uses the server and instance specified in the path.
        * If not on a SQLSERVER: drive but the current location on your SQLSERVER:
        drive specifies the SQL folder, Update-DBEnvironment uses the server and instance
        specified in that path.

        Required?                    false
        Position?                    1
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false

-Database <PSReference>
        Reference to a character string specifying the name of a database.
        Update-DBEnvironment connects to this database in the instance specified by -ServerInstance.
        If -Database is not specified Update-DBEnvironment attempts to infer it:
        * If on a SQLSERVER: drive (or alias) and the path specifies both the SQL folder
        and a database name, Update-DBEnvironment uses the database specified in the path.
        * If not on a SQLSERVER: drive but the current location on your SQLSERVER:
        drive specifies both the SQL folder and a database name, Update-DBEnvironment uses
        the database specified in that path.

        Required?                    false
        Position?                    2
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false

<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 Update-DBEnvironment.

OUTPUTS

None. Produces no output.

NOTES



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

        Since CleanCode 1.1.05.

EXAMPLES


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

C:\PS>Update-DBEnvironment ([ref]$ServerInstance) ([ref]$Database)

If either of the supplied server or database values are $null or empty string, Get-DBPathInfo is used to attempt to infer a values for it, updating the supplied variables by reference.

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