Skip to content

Commit c75322e

Browse files
committed
Updated help
1 parent cfb8942 commit c75322e

6 files changed

Lines changed: 123 additions & 125 deletions

File tree

functions/Get-PDCClone.ps1

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,52 @@
11
function Get-PDCClone {
2+
<#
3+
.SYNOPSIS
4+
Get-PDCClone get on or more clones
25
3-
<#
4-
.SYNOPSIS
5-
Get-PDCClone get on or more clones
6+
.DESCRIPTION
7+
Get-PDCClone will retrieve the clones and apply filters if needed.
8+
By default all the clones are returned
69
7-
.DESCRIPTION
8-
Get-PDCClone will retrieve the clones and apply filters if needed.
9-
By default all the clones are returned
10+
.PARAMETER HostName
11+
Filter based on the hostname
1012
11-
.PARAMETER HostName
12-
Filter based on the hostname
13+
.PARAMETER Database
14+
Filter based on the database
1315
14-
.PARAMETER Database
15-
Filter based on the database
16+
.PARAMETER ImageID
17+
Filter based on the image id
1618
17-
.PARAMETER ImageID
18-
Filter based on the image id
19+
.PARAMETER ImageName
20+
Filter based on the image name
1921
20-
.PARAMETER ImageName
21-
Filter based on the image name
22+
.PARAMETER ImageLocation
23+
Filter based on the image location
2224
23-
.PARAMETER ImageLocation
24-
Filter based on the image location
25+
.NOTES
26+
Author: Sander Stad (@sqlstad, sqlstad.nl)
2527
26-
.NOTES
27-
Author: Sander Stad (@sqlstad, sqlstad.nl)
28+
Website: https://psdatabaseclone.io
29+
Copyright: (C) Sander Stad, sander@sqlstad.nl
30+
License: MIT https://opensource.org/licenses/MIT
2831
29-
Website: https://psdatabaseclone.io
30-
Copyright: (C) Sander Stad, sander@sqlstad.nl
31-
License: MIT https://opensource.org/licenses/MIT
32+
.LINK
33+
https://psdatabaseclone.io/
3234
33-
.LINK
34-
https://psdatabaseclone.io/
35+
.EXAMPLE
36+
Get-PDCClone -HostName host1, host2
3537
36-
.EXAMPLE
37-
Get-PDCClone -HostName host1, host2
38+
Retrieve the clones for host1 and host2
3839
39-
Retrieve the clones for host1 and host2
40+
.EXAMPLE
41+
Get-PDCClone -Database DB1
4042
41-
.EXAMPLE
42-
Get-PDCClone -Database DB1
43+
Get all the clones that have the name DB1
4344
44-
Get all the clones that have the name DB1
45+
.EXAMPLE
46+
Get-PDCClone -ImageName DB1_20180703085917
4547
46-
.EXAMPLE
47-
Get-PDCClone -ImageName DB1_20180703085917
48-
49-
Get all the clones that were made with image "DB1_20180703085917"
50-
51-
#>
48+
Get all the clones that were made with image "DB1_20180703085917"
49+
#>
5250

5351
[CmdLetBinding()]
5452

functions/New-PDCClone.ps1

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,83 @@
11
function New-PDCClone {
2-
<#
3-
.SYNOPSIS
4-
New-PDCClone creates a new clone
2+
<#
3+
.SYNOPSIS
4+
New-PDCClone creates a new clone
55
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.
99
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
1212
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:
1515
16-
$scred = Get-Credential, then pass $scred object to the -SqlCredential parameter.
16+
$scred = Get-Credential, then pass $scred object to the -SqlCredential parameter.
1717
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.
2020
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:
2323
24-
$scred = Get-Credential, then pass $scred object to the -Credential parameter.
24+
$scred = Get-Credential, then pass $scred object to the -Credential parameter.
2525
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
2828
29-
.PARAMETER Destination
30-
Destination directory to save the clone to
29+
.PARAMETER Destination
30+
Destination directory to save the clone to
3131
32-
.PARAMETER CloneName
33-
Name of the clone
32+
.PARAMETER CloneName
33+
Name of the clone
3434
35-
.PARAMETER Database
36-
Database name for the clone
35+
.PARAMETER Database
36+
Database name for the clone
3737
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
4141
42-
.PARAMETER Force
43-
Forcefully create items when needed
42+
.PARAMETER Force
43+
Forcefully create items when needed
4444
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.
4949
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.
5252
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.
5555
56-
.NOTES
57-
Author: Sander Stad (@sqlstad, sqlstad.nl)
56+
.NOTES
57+
Author: Sander Stad (@sqlstad, sqlstad.nl)
5858
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
6262
63-
.LINK
64-
https://psdatabaseclone.io/
63+
.LINK
64+
https://psdatabaseclone.io/
6565
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
6868
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
7070
71-
.EXAMPLE
72-
New-PDCClone -SqlInstance SQLDB1 -Database DB1, DB2 -LatestImage
71+
.EXAMPLE
72+
New-PDCClone -SqlInstance SQLDB1 -Database DB1, DB2 -LatestImage
7373
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
7575
76-
.EXAMPLE
77-
New-PDCClone -SqlInstance SQLDB1, SQLDB2 -Database DB1 -LatestImage
76+
.EXAMPLE
77+
New-PDCClone -SqlInstance SQLDB1, SQLDB2 -Database DB1 -LatestImage
7878
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+
#>
8181
[CmdLetBinding(DefaultParameterSetName = 'ByLatest')]
8282
param(
8383
[parameter(Mandatory = $true)]

functions/New-PDCImage.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function New-PDCImage {
2-
<#
2+
<#
33
.SYNOPSIS
44
New-PDCImage creates a new image
55
@@ -118,10 +118,10 @@ function New-PDCImage {
118118
begin {
119119

120120
# Test the module database setup
121-
try{
121+
try {
122122
Test-PDCConfiguration -EnableException
123123
}
124-
catch{
124+
catch {
125125
Stop-PSFFunction -Message "Something is wrong in the module configuration" -ErrorRecord $_ -Continue
126126
}
127127

functions/Remove-PDCClone.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function Remove-PDCClone {
2-
<#
2+
<#
33
.SYNOPSIS
44
Remove-PDCClone removes one or more clones from a host
55

functions/Remove-PDCImage.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function Remove-PDCImage {
2-
<#
2+
<#
33
.SYNOPSIS
44
Remove-PDCImage removes one or more images
55

internal/functions/Test-PDCConfiguration.ps1

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
function Test-PDCConfiguration {
2-
<#
3-
.SYNOPSIS
4-
Test the configuration of the module
2+
<#
3+
.SYNOPSIS
4+
Test the configuration of the module
55
6-
.DESCRIPTION
7-
The configuration of the module is vital to let it function.
8-
This function checks several configurations
6+
.DESCRIPTION
7+
The configuration of the module is vital to let it function.
8+
This function checks several configurations
99
10-
.PARAMETER SqlInstance
11-
The instance that represents the PSDatabaseClone instance that holds the database
10+
.PARAMETER SqlInstance
11+
The instance that represents the PSDatabaseClone instance that holds the database
1212
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:
1515
16-
$scred = Get-Credential, then pass $scred object to the -SourceSqlCredential parameter.
16+
$scred = Get-Credential, then pass $scred object to the -SourceSqlCredential parameter.
1717
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.
2020
21-
.PARAMETER Database
22-
The database that holds all the information for the PSDatabaseClone module
21+
.PARAMETER Database
22+
The database that holds all the information for the PSDatabaseClone module
2323
24-
.PARAMETER EnableException
25-
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
26-
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
27-
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
24+
.PARAMETER EnableException
25+
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
26+
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
27+
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
2828
29-
.PARAMETER WhatIf
30-
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.
29+
.PARAMETER WhatIf
30+
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.
3131
32-
.PARAMETER Confirm
33-
If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.
32+
.PARAMETER Confirm
33+
If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.
3434
35-
.NOTES
36-
Author: Sander Stad (@sqlstad, sqlstad.nl)
35+
.NOTES
36+
Author: Sander Stad (@sqlstad, sqlstad.nl)
3737
38-
Website: https://psdatabaseclone.io
39-
Copyright: (C) Sander Stad, sander@sqlstad.nl
40-
License: MIT https://opensource.org/licenses/MIT
38+
Website: https://psdatabaseclone.io
39+
Copyright: (C) Sander Stad, sander@sqlstad.nl
40+
License: MIT https://opensource.org/licenses/MIT
4141
42-
.LINK
43-
https://psdatabaseclone.io/
44-
#>
42+
.LINK
43+
https://psdatabaseclone.io/
44+
#>
4545

4646
[CmdLetBinding()]
4747

0 commit comments

Comments
 (0)