New-SqlCloneSqlScript
Published 15 January 2018
New-SqlCloneSqlScript
Creates an ModificationScript T-SQL modification for consumption by New-SqlCloneImage.
Syntax
New-SqlCloneSqlScript [-Sql] <string> [-Name <string>] [<CommonParameters>] New-SqlCloneSqlScript [-Path] <string> [-Name <string>] [<CommonParameters>]
Description
The New-SqlCloneSqlScript cmdlet creates a simple data object containing the details needed for Clone to perform a T-SQL image modification.
This cmdlet returns an ModificationScript which can be passed to the New-SqlCloneImage cmdlet's Modifications parameter.
Parameters
-Sql
<System.String>
Specifies the plaintext T-SQL to run in this modification.
Aliases | None |
Required? | true |
Position? | 1 |
Default Value | None |
Accept Pipeline Input | true (ByValue) |
Accept Wildcard Characters | false |
-Path
<System.String>
Specifies the path to a file containing T-SQL to run in this modification.
Aliases | None |
Required? | true |
Position? | 1 |
Default Value | None |
Accept Pipeline Input | true (ByValue) |
Accept Wildcard Characters | false |
-Name
<System.String>
Names this modification step for logging and display purposes.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
System.String
Specifies the plaintext T-SQL to run in this modification.
-
System.String
Specifies the path to a file containing T-SQL to run in this modification.
Return values
The output type is the type of the objects that the cmdlet emits.
- RedGate.SqlClone.Api.ScriptRunning.ModificationScript
Examples
---------- EXAMPLE 1 ----------
$myModification = New-SqlCloneSqlScript -Path '\\red-gate\data-scripts\change-permissions.sql' -Name 'Change Permissions'
This example creates a T-SQL modification object that can be provided to the -Modifications parameter of New-SqlCloneImage or as part of a template with New-SqlCloneTemplate.