|
1 | 1 | function New-PDCClone { |
2 | | - <# |
3 | | - .SYNOPSIS |
4 | | - New-PDCClone creates a new clone |
| 2 | +<# |
| 3 | +.SYNOPSIS |
| 4 | + New-PDCClone creates a new clone |
5 | 5 |
|
6 | | - .DESCRIPTION |
7 | | - New-PDCClone willcreate a new clone based on an image. |
8 | | - The clone will be created in a certain directory, mounted and attached to a database server. |
| 6 | +.DESCRIPTION |
| 7 | + New-PDCClone willcreate a new clone based on an image. |
| 8 | + The clone will be created in a certain directory, mounted and attached to a database server. |
9 | 9 |
|
10 | | - .PARAMETER SqlInstance |
11 | | - SQL Server name or SMO object representing the SQL Server to connect to |
| 10 | +.PARAMETER SqlInstance |
| 11 | + SQL Server name or SMO object representing the SQL Server to connect to |
12 | 12 |
|
13 | | - .PARAMETER SqlCredential |
14 | | - Allows you to login to servers using SQL Logins as opposed to Windows Auth/Integrated/Trusted. To use: |
| 13 | +.PARAMETER SqlCredential |
| 14 | + Allows you to login to servers using SQL Logins as opposed to Windows Auth/Integrated/Trusted. To use: |
15 | 15 |
|
16 | | - $scred = Get-Credential, then pass $scred object to the -SqlCredential parameter. |
| 16 | + $scred = Get-Credential, then pass $scred object to the -SqlCredential parameter. |
17 | 17 |
|
18 | | - Windows Authentication will be used if SqlCredential is not specified. SQL Server does not accept Windows credentials being passed as credentials. |
19 | | - To connect as a different Windows user, run PowerShell as that user. |
| 18 | + Windows Authentication will be used if SqlCredential is not specified. SQL Server does not accept Windows credentials being passed as credentials. |
| 19 | + To connect as a different Windows user, run PowerShell as that user. |
20 | 20 |
|
21 | | - .PARAMETER Credential |
22 | | - Allows you to login to servers using Windows Auth/Integrated/Trusted. To use: |
| 21 | +.PARAMETER Credential |
| 22 | + Allows you to login to servers using Windows Auth/Integrated/Trusted. To use: |
23 | 23 |
|
24 | | - $scred = Get-Credential, then pass $scred object to the -Credential parameter. |
| 24 | + $scred = Get-Credential, then pass $scred object to the -Credential parameter. |
25 | 25 |
|
26 | | - .PARAMETER ParentVhd |
27 | | - Points to the parent VHD to create the clone from |
| 26 | +.PARAMETER ParentVhd |
| 27 | + Points to the parent VHD to create the clone from |
28 | 28 |
|
29 | | - .PARAMETER Destination |
30 | | - Destination directory to save the clone to |
| 29 | +.PARAMETER Destination |
| 30 | + Destination directory to save the clone to |
31 | 31 |
|
32 | | - .PARAMETER CloneName |
33 | | - Name of the clone |
| 32 | +.PARAMETER CloneName |
| 33 | + Name of the clone |
34 | 34 |
|
35 | | - .PARAMETER Database |
36 | | - Database name for the clone |
| 35 | +.PARAMETER Database |
| 36 | + Database name for the clone |
37 | 37 |
|
38 | | - .PARAMETER Disabled |
39 | | - Registers the clone in the configuration as disabled. |
40 | | - If this setting is used the clone will not be recovered when the repair command is run |
| 38 | +.PARAMETER Disabled |
| 39 | + Registers the clone in the configuration as disabled. |
| 40 | + If this setting is used the clone will not be recovered when the repair command is run |
41 | 41 |
|
42 | | - .PARAMETER Force |
43 | | - Forcefully create items when needed |
| 42 | +.PARAMETER Force |
| 43 | + Forcefully create items when needed |
44 | 44 |
|
45 | | - .PARAMETER EnableException |
46 | | - By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. |
47 | | - This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. |
48 | | - Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch. |
| 45 | +.PARAMETER EnableException |
| 46 | + By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. |
| 47 | + This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. |
| 48 | + Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch. |
49 | 49 |
|
50 | | - .PARAMETER WhatIf |
51 | | - If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run. |
| 50 | +.PARAMETER WhatIf |
| 51 | + If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run. |
52 | 52 |
|
53 | | - .PARAMETER Confirm |
54 | | - If this switch is enabled, you will be prompted for confirmation before executing any operations that change state. |
| 53 | +.PARAMETER Confirm |
| 54 | + If this switch is enabled, you will be prompted for confirmation before executing any operations that change state. |
55 | 55 |
|
56 | | - .NOTES |
57 | | - Author: Sander Stad (@sqlstad, sqlstad.nl) |
| 56 | +.NOTES |
| 57 | + Author: Sander Stad (@sqlstad, sqlstad.nl) |
58 | 58 |
|
59 | | - Website: https://psdatabaseclone.io |
60 | | - Copyright: (C) Sander Stad, sander@sqlstad.nl |
61 | | - License: MIT https://opensource.org/licenses/MIT |
| 59 | + Website: https://psdatabaseclone.io |
| 60 | + Copyright: (C) Sander Stad, sander@sqlstad.nl |
| 61 | + License: MIT https://opensource.org/licenses/MIT |
62 | 62 |
|
63 | | - .LINK |
64 | | - https://psdatabaseclone.io/ |
| 63 | +.LINK |
| 64 | + https://psdatabaseclone.io/ |
65 | 65 |
|
66 | | - .EXAMPLE |
67 | | - New-PDCClone -SqlInstance SQLDB1 -ParentVhd C:\Temp\images\DB1_20180623203204.vhdx -Destination C:\Temp\clones\ -CloneName DB1_Clone1 |
| 66 | +.EXAMPLE |
| 67 | + New-PDCClone -SqlInstance SQLDB1 -ParentVhd C:\Temp\images\DB1_20180623203204.vhdx -Destination C:\Temp\clones\ -CloneName DB1_Clone1 |
68 | 68 |
|
69 | | - Create a new clone based on the image DB1_20180623203204.vhdx and attach the database to SQLDB1 as DB1_Clone1 |
| 69 | + Create a new clone based on the image DB1_20180623203204.vhdx and attach the database to SQLDB1 as DB1_Clone1 |
70 | 70 |
|
71 | | - .EXAMPLE |
72 | | - New-PDCClone -SqlInstance SQLDB1 -Database DB1, DB2 -LatestImage |
| 71 | +.EXAMPLE |
| 72 | + New-PDCClone -SqlInstance SQLDB1 -Database DB1, DB2 -LatestImage |
73 | 73 |
|
74 | | - Create a new clone on SQLDB1 for the databases DB1 and DB2 with the latest image for those databases |
| 74 | + Create a new clone on SQLDB1 for the databases DB1 and DB2 with the latest image for those databases |
75 | 75 |
|
76 | | - .EXAMPLE |
77 | | - New-PDCClone -SqlInstance SQLDB1, SQLDB2 -Database DB1 -LatestImage |
| 76 | +.EXAMPLE |
| 77 | + New-PDCClone -SqlInstance SQLDB1, SQLDB2 -Database DB1 -LatestImage |
78 | 78 |
|
79 | | - Create a new clone on SQLDB1 and SQLDB2 for the databases DB1 with the latest image |
80 | | - #> |
| 79 | + Create a new clone on SQLDB1 and SQLDB2 for the databases DB1 with the latest image |
| 80 | +#> |
81 | 81 | [CmdLetBinding(DefaultParameterSetName = 'ByLatest')] |
82 | 82 | param( |
83 | 83 | [parameter(Mandatory = $true)] |
|
0 commit comments