Skip to content

Commit 7810c98

Browse files
committed
Renamed functions
1 parent 5d2f656 commit 7810c98

16 files changed

Lines changed: 141 additions & 99 deletions

PSDatabaseClone.psd1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
)
4747

4848
# Assemblies that must be loaded prior to importing this module
49-
# RequiredAssemblies = @()
49+
RequiredAssemblies = @("bin\PSDatabaseClone.dll")
5050

5151
# Script files (.ps1) that are run in the caller's environment prior to
5252
# importing this module
@@ -63,16 +63,16 @@
6363
# NestedModules = @()
6464

6565
# Functions to export from this module
66-
FunctionsToExport = 'Initialize-PDCVhdDisk',
67-
'Invoke-PDCRepairClone',
68-
'New-PDCClone',
69-
'New-PDCImage',
70-
'New-PDCVhdDisk',
71-
'Remove-PDCClone',
72-
'Remove-PDCImage',
73-
'Set-PDCConfiguration',
74-
'Get-PDCClone',
75-
'Get-PDCImage'
66+
FunctionsToExport = 'Initialize-PSDCVhdDisk',
67+
'Invoke-PSDCRepairClone',
68+
'New-PSDCClone',
69+
'New-PSDCImage',
70+
'New-PSDCVhdDisk',
71+
'Remove-PSDCClone',
72+
'Remove-PSDCImage',
73+
'Set-PSDCConfiguration',
74+
'Get-PSDCClone',
75+
'Get-PSDCImage'
7676

7777
# Cmdlets to export from this module
7878
CmdletsToExport = ''
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
function Get-PDCClone {
1+
function Get-PSDCClone {
22
<#
33
.SYNOPSIS
4-
Get-PDCClone get on or more clones
4+
Get-PSDCClone get on or more clones
55
66
.DESCRIPTION
7-
Get-PDCClone will retrieve the clones and apply filters if needed.
7+
Get-PSDCClone will retrieve the clones and apply filters if needed.
88
By default all the clones are returned
99
1010
.PARAMETER HostName
@@ -33,17 +33,17 @@
3333
https://psdatabaseclone.io/
3434
3535
.EXAMPLE
36-
Get-PDCClone -HostName host1, host2
36+
Get-PSDCClone -HostName host1, host2
3737
3838
Retrieve the clones for host1 and host2
3939
4040
.EXAMPLE
41-
Get-PDCClone -Database DB1
41+
Get-PSDCClone -Database DB1
4242
4343
Get all the clones that have the name DB1
4444
4545
.EXAMPLE
46-
Get-PDCClone -ImageName DB1_20180703085917
46+
Get-PSDCClone -ImageName DB1_20180703085917
4747
4848
Get all the clones that were made with image "DB1_20180703085917"
4949
#>
@@ -62,7 +62,7 @@
6262

6363
# Test the module database setup
6464
try {
65-
Test-PDCConfiguration -EnableException
65+
Test-PSDCConfiguration -EnableException
6666
}
6767
catch {
6868
Stop-PSFFunction -Message "Something is wrong in the module configuration" -ErrorRecord $_ -Continue
@@ -128,6 +128,8 @@
128128
$results = $results | Where-Object {$_.ImageLocation -in $ImageLocation}
129129
}
130130

131+
$results.PSTypeN
132+
131133
return $results
132134
}
133135

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
function Get-PDCImage {
1+
function Get-PSDCImage {
22
<#
33
.SYNOPSIS
4-
Get-PDCImage get on or more clones
4+
Get-PSDCImage get on or more clones
55
66
.DESCRIPTION
7-
Get-PDCImage will retrieve the clones and apply filters if needed.
7+
Get-PSDCImage will retrieve the clones and apply filters if needed.
88
By default all the clones are returned
99
1010
.PARAMETER ImageID
@@ -30,17 +30,17 @@
3030
https://psdatabaseclone.io/
3131
3232
.EXAMPLE
33-
Get-PDCImage -ImageName DB1_20180704220944, DB2_20180704221144
33+
Get-PSDCImage -ImageName DB1_20180704220944, DB2_20180704221144
3434
3535
Retrieve the images for DB1_20180704220944, DB2_20180704221144
3636
3737
.EXAMPLE
38-
Get-PDCImage -ImageLocation "\\fileserver1\psdatabaseclone\images\DB1_20180704220944.vhdx"
38+
Get-PSDCImage -ImageLocation "\\fileserver1\psdatabaseclone\images\DB1_20180704220944.vhdx"
3939
4040
Get all the images that are the same as the image location
4141
4242
.EXAMPLE
43-
Get-PDCImage -Database DB1, DB2
43+
Get-PSDCImage -Database DB1, DB2
4444
4545
Get all the images that were made for databases DB1 and DB2
4646
#>
@@ -57,7 +57,7 @@
5757
begin {
5858
# Test the module database setup
5959
try {
60-
Test-PDCConfiguration -EnableException
60+
Test-PSDCConfiguration -EnableException
6161
}
6262
catch {
6363
Stop-PSFFunction -Message "Something is wrong in the module configuration" -ErrorRecord $_ -Continue
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
function Initialize-PDCVhdDisk {
1+
function Initialize-PSDCVhdDisk {
22
<#
33
.SYNOPSIS
4-
Initialize-PDCVhdDisk initialized the VHD
4+
Initialize-PSDCVhdDisk initialized the VHD
55
66
.DESCRIPTION
7-
Initialize-PDCVhdDisk will initialize the VHD.
7+
Initialize-PSDCVhdDisk will initialize the VHD.
88
It mounts the disk, creates a volume, creates the partition and sets it to active
99
1010
.PARAMETER Path
@@ -44,12 +44,12 @@
4444
https://psdatabaseclone.io/
4545
4646
.EXAMPLE
47-
Initialize-PDCVhdDisk -Path $path
47+
Initialize-PSDCVhdDisk -Path $path
4848
4949
Initialize the disk pointing to the path with all default settings
5050
5151
.EXAMPLE
52-
Initialize-PDCVhdDisk -Path $path -AllocationUnitSize 4KB
52+
Initialize-PSDCVhdDisk -Path $path -AllocationUnitSize 4KB
5353
5454
Initialize the disk and format the partition with a 4Kb allocation unit size
5555
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
function Invoke-PDCRepairClone {
1+
function Invoke-PSDCRepairClone {
22
<#
33
.SYNOPSIS
4-
Invoke-PDCRepairClone repairs the clones
4+
Invoke-PSDCRepairClone repairs the clones
55
66
.DESCRIPTION
7-
Invoke-PDCRepairClone has the ability to repair the clones when they have gotten disconnected from the image.
7+
Invoke-PSDCRepairClone has the ability to repair the clones when they have gotten disconnected from the image.
88
In such a case the clone is no longer available for the database server and the database will either not show
99
any information or the database will have the status (Recovery Pending).
1010
@@ -43,7 +43,7 @@
4343
https://psdatabaseclone.io/
4444
4545
.EXAMPLE
46-
Invoke-PDCRepairClone -Hostname Host1
46+
Invoke-PSDCRepairClone -Hostname Host1
4747
4848
Repair the clones for Host1
4949
@@ -61,7 +61,7 @@
6161
begin {
6262
# Test the module database setup
6363
try {
64-
Test-PDCConfiguration -EnableException
64+
Test-PSDCConfiguration -EnableException
6565
}
6666
catch {
6767
Stop-PSFFunction -Message "Something is wrong in the module configuration" -ErrorRecord $_ -Continue
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
function New-PDCClone {
1+
function New-PSDCClone {
22
<#
33
.SYNOPSIS
4-
New-PDCClone creates a new clone
4+
New-PSDCClone creates a new clone
55
66
.DESCRIPTION
7-
New-PDCClone willcreate a new clone based on an image.
7+
New-PSDCClone willcreate a new clone based on an image.
88
The clone will be created in a certain directory, mounted and attached to a database server.
99
1010
.PARAMETER SqlInstance
@@ -67,17 +67,17 @@
6767
https://psdatabaseclone.io/
6868
6969
.EXAMPLE
70-
New-PDCClone -SqlInstance SQLDB1 -ParentVhd C:\Temp\images\DB1_20180623203204.vhdx -Destination C:\Temp\clones\ -CloneName DB1_Clone1
70+
New-PSDCClone -SqlInstance SQLDB1 -ParentVhd C:\Temp\images\DB1_20180623203204.vhdx -Destination C:\Temp\clones\ -CloneName DB1_Clone1
7171
7272
Create a new clone based on the image DB1_20180623203204.vhdx and attach the database to SQLDB1 as DB1_Clone1
7373
7474
.EXAMPLE
75-
New-PDCClone -SqlInstance SQLDB1 -Database DB1, DB2 -LatestImage
75+
New-PSDCClone -SqlInstance SQLDB1 -Database DB1, DB2 -LatestImage
7676
7777
Create a new clone on SQLDB1 for the databases DB1 and DB2 with the latest image for those databases
7878
7979
.EXAMPLE
80-
New-PDCClone -SqlInstance SQLDB1, SQLDB2 -Database DB1 -LatestImage
80+
New-PSDCClone -SqlInstance SQLDB1, SQLDB2 -Database DB1 -LatestImage
8181
8282
Create a new clone on SQLDB1 and SQLDB2 for the databases DB1 with the latest image
8383
#>
@@ -107,7 +107,7 @@
107107

108108
# Test the module database setup
109109
try {
110-
Test-PDCConfiguration -EnableException
110+
Test-PSDCConfiguration -EnableException
111111
}
112112
catch {
113113
Stop-PSFFunction -Message "Something is wrong in the module configuration" -ErrorRecord $_ -Continue
@@ -134,15 +134,15 @@
134134
$computer = [PsfComputer]$uriHost
135135

136136
if (-not $computer.IsLocalhost) {
137-
$command = "Convert-PDCLocalUncPathToLocalPath -UncPath '$ImageNetworkPath'"
137+
$command = "Convert-PSDCLocalUncPathToLocalPath -UncPath '$ImageNetworkPath'"
138138
$commandGetLocalPath = [ScriptBlock]::Create($command)
139139
}
140140

141141
if ($Destination.StartsWith("\\")) {
142142
Write-PSFMessage -Message "The destination cannot be an UNC path. Converting to local path" -Level Verbose
143143
try {
144144
if ($computer.IsLocalhost) {
145-
$Destination = Convert-PDCLocalUncPathToLocalPath -UncPath $Destination
145+
$Destination = Convert-PSDCLocalUncPathToLocalPath -UncPath $Destination
146146
}
147147
else {
148148
$Destination = Invoke-PSFCommand -ComputerName $computer -ScriptBlock $commandGetLocalPath -Credential $DestinationCredential
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
function New-PDCImage {
1+
function New-PSDCImage {
22
<#
33
.SYNOPSIS
4-
New-PDCImage creates a new image
4+
New-PSDCImage creates a new image
55
66
.DESCRIPTION
7-
New-PDCImage will create a new image based on a SQL Server database
7+
New-PSDCImage will create a new image based on a SQL Server database
88
99
The command will either create a full backup or use the last full backup to create the image.
1010
@@ -79,12 +79,12 @@
7979
https://psdatabaseclone.io/
8080
8181
.EXAMPLE
82-
New-PDCImage -SourceSqlInstance SQLDB1 -DestinationSqlInstance SQLDB2 -ImageLocalPath C:\Temp\images\ -Database DB1 -CreateFullBackup
82+
New-PSDCImage -SourceSqlInstance SQLDB1 -DestinationSqlInstance SQLDB2 -ImageLocalPath C:\Temp\images\ -Database DB1 -CreateFullBackup
8383
8484
Create an image for databas DB1 from SQL Server SQLDB1. The temporary destination will be SQLDB2.
8585
The image will be saved in C:\Temp\images.
8686
.EXAMPLE
87-
New-PDCImage -SourceSqlInstance SQLDB1 -DestinationSqlInstance SQLDB2 -ImageLocalPath C:\Temp\images\ -Database DB1 -UseLastFullBackup
87+
New-PSDCImage -SourceSqlInstance SQLDB1 -DestinationSqlInstance SQLDB2 -ImageLocalPath C:\Temp\images\ -Database DB1 -UseLastFullBackup
8888
8989
Create an image from the database DB1 on SQLDB1 using the last full backup and use SQLDB2 as the temporary database server.
9090
The image is written to c:\Temp\images
@@ -119,7 +119,7 @@
119119

120120
# Test the module database setup
121121
try {
122-
Test-PDCConfiguration -EnableException
122+
Test-PSDCConfiguration -EnableException
123123
}
124124
catch {
125125
Stop-PSFFunction -Message "Something is wrong in the module configuration" -ErrorRecord $_ -Continue
@@ -158,15 +158,15 @@
158158
$computer = [PsfComputer]$uriHost
159159

160160
if (-not $computer.IsLocalhost) {
161-
$command = "Convert-PDCLocalUncPathToLocalPath -UncPath '$ImageNetworkPath'"
161+
$command = "Convert-PSDCLocalUncPathToLocalPath -UncPath '$ImageNetworkPath'"
162162
$commandGetLocalPath = [ScriptBlock]::Create($command)
163163
}
164164

165165
# Get the local path from the network path
166166
if (-not $ImageLocalPath) {
167167
try {
168168
if ($computer.IsLocalhost) {
169-
$ImageLocalPath = Convert-PDCLocalUncPathToLocalPath -UncPath $ImageNetworkPath
169+
$ImageLocalPath = Convert-PSDCLocalUncPathToLocalPath -UncPath $ImageNetworkPath
170170
}
171171
else {
172172
$ImageLocalPath = Invoke-PSFCommand -ComputerName $computer -ScriptBlock $commandGetLocalPath -Credential $DestinationCredential
@@ -265,7 +265,7 @@
265265
# try to create the new VHD
266266
try {
267267
Write-PSFMessage -Message "Create the vhd $imageName.vhdx" -Level Verbose
268-
$null = New-PDCVhdDisk -Destination $imagePath -FileName "$imageName.vhdx"
268+
$null = New-PSDCVhdDisk -Destination $imagePath -FileName "$imageName.vhdx"
269269
}
270270
catch {
271271
Stop-PSFFunction -Message "Couldn't create vhd $imageName" -Target "$imageName.vhd" -ErrorRecord $_ -Continue
@@ -275,7 +275,7 @@
275275
try {
276276
Write-PSFMessage -Message "Initializing the vhd $imageName.vhd" -Level Verbose
277277

278-
$diskResult = Initialize-PDCVhdDisk -Path $vhdPath -Credential $DestinationCredential
278+
$diskResult = Initialize-PSDCVhdDisk -Path $vhdPath -Credential $DestinationCredential
279279
}
280280
catch {
281281
Stop-PSFFunction -Message "Couldn't initialize vhd $vhdPath" -Target $imageName -ErrorRecord $_ -Continue
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
function New-PDCVhdDisk {
1+
function New-PSDCVhdDisk {
22
<#
33
.SYNOPSIS
4-
New-PDCVhdDisk creates a new VHD
4+
New-PSDCVhdDisk creates a new VHD
55
66
.DESCRIPTION
7-
New-PDCVhdDisk will create a new VHD.
7+
New-PSDCVhdDisk will create a new VHD.
88
99
.PARAMETER Destination
1010
The destination path of the VHD
@@ -50,7 +50,7 @@
5050
https://psdatabaseclone.io/
5151
5252
.EXAMPLE
53-
New-PDCVhdDisk -Destination C:\temp -Name Database1 -Size 1GB
53+
New-PSDCVhdDisk -Destination C:\temp -Name Database1 -Size 1GB
5454
5555
Creates a dynamic VHD in C:\Temp named Database1.vhdx with a size of 1GB
5656

0 commit comments

Comments
 (0)