diff --git a/d365bap.tools/d365bap.tools.psd1 b/d365bap.tools/d365bap.tools.psd1
index 48f4af7..b88ebb7 100644
--- a/d365bap.tools/d365bap.tools.psd1
+++ b/d365bap.tools/d365bap.tools.psd1
@@ -105,7 +105,7 @@
, 'Set-UdeDbJitCache'
, 'Set-UdeEnvironmentInSession'
- , 'Start-BapDatabaseRefresh'
+ , 'Start-UdeDatabaseRefresh'
, 'Start-UdeDbSsms'
, 'Switch-BapTenant'
diff --git a/d365bap.tools/functions/Clear-UdeOrphanedConfig.ps1 b/d365bap.tools/functions/Clear-UdeOrphanedConfig.ps1
index 2bca531..e241945 100644
--- a/d365bap.tools/functions/Clear-UdeOrphanedConfig.ps1
+++ b/d365bap.tools/functions/Clear-UdeOrphanedConfig.ps1
@@ -67,10 +67,12 @@ function Clear-UdeOrphanedConfig {
$colPackageDirs = Get-Item -Path $pathPackages | `
Select-Object -ExpandProperty FullName
- # Then we need to find all active package directories - based on the UDE configs
- $activePackageDirs = @($colConfigs.PackagesLocalDirectory | `
- ForEach-Object { Split-Path -Path $_ -Parent }) | `
- Select-Object -Unique
+ if ($colConfigs.Count -gt 0) {
+ # Then we need to find all active package directories - based on the UDE configs
+ $activePackageDirs = @($colConfigs.PackagesLocalDirectory | `
+ ForEach-Object { Split-Path -Path $_ -Parent }) | `
+ Select-Object -Unique
+ }
# Finally, we need to find all orphaned package directories
$colPackageDirs | Where-Object { $_ -notin $activePackageDirs } | ForEach-Object {
diff --git a/d365bap.tools/functions/Confirm-BapEnvironmentIntegration.ps1 b/d365bap.tools/functions/Confirm-BapEnvironmentIntegration.ps1
index e321022..6249be3 100644
--- a/d365bap.tools/functions/Confirm-BapEnvironmentIntegration.ps1
+++ b/d365bap.tools/functions/Confirm-BapEnvironmentIntegration.ps1
@@ -60,7 +60,7 @@ function Confirm-BapEnvironmentIntegration {
if (Test-PSFFunctionInterrupt) { return }
- $baseUri = $envObj.LinkedMetaPpacEnvUri
+ $baseUri = $envObj.PpacEnvUri
$secureToken = (Get-AzAccessToken -ResourceUrl $baseUri -AsSecureString).Token
$tokenWebApiValue = ConvertFrom-SecureString -AsPlainText -SecureString $secureToken
diff --git a/d365bap.tools/functions/Get-BapEnvironment.ps1 b/d365bap.tools/functions/Get-BapEnvironment.ps1
index 5979b91..4f373e6 100644
--- a/d365bap.tools/functions/Get-BapEnvironment.ps1
+++ b/d365bap.tools/functions/Get-BapEnvironment.ps1
@@ -138,7 +138,8 @@ function Get-BapEnvironment {
"Properties.linkedAppMetadata.url as FinOpsMetadataEnvUri",
@{Name = "PpacManagedEnv"; Expression = { $_.Properties.governanceConfiguration.protectionLevel -ne 'Basic' } },
@{Name = "Managed"; Expression = { $_.Properties.governanceConfiguration.protectionLevel -ne 'Basic' } },
- "Properties.linkedAppMetadata.url as FnOEnvUri",
+ @{Name = "FnOEnvUri"; Expression = { $_.Properties.linkedAppMetadata.url -replace "com/", "com" } },
+ @{Name = "FinOpsEnvUri"; Expression = { $_.Properties.linkedAppMetadata.url -replace "com/", "com" } },
@{Name = "PpacEnvUri"; Expression = { $_.Properties.linkedEnvironmentMetadata.instanceUrl -replace "com/", "com" } },
@{Name = "PpacEnvApiUri"; Expression = { $_.Properties.linkedEnvironmentMetadata.instanceApiUrl -replace "com/", "com" } },
@{Name = "AdminMode"; Expression = { $_.Properties.states.runtime.id -eq "AdminMode" } },
diff --git a/d365bap.tools/functions/Get-BapEnvironmentApplicationUser.ps1 b/d365bap.tools/functions/Get-BapEnvironmentApplicationUser.ps1
index ced31b9..77861bc 100644
--- a/d365bap.tools/functions/Get-BapEnvironmentApplicationUser.ps1
+++ b/d365bap.tools/functions/Get-BapEnvironmentApplicationUser.ps1
@@ -96,7 +96,7 @@ function Get-BapEnvironmentApplicationUser {
if (Test-PSFFunctionInterrupt) { return }
- $baseUri = $envObj.LinkedMetaPpacEnvUri
+ $baseUri = $envObj.PpacEnvUri
$secureToken = (Get-AzAccessToken -ResourceUrl $baseUri -AsSecureString).Token
$tokenWebApiValue = ConvertFrom-SecureString -AsPlainText -SecureString $secureToken
diff --git a/d365bap.tools/functions/Get-BapEnvironmentPowerApp.ps1 b/d365bap.tools/functions/Get-BapEnvironmentPowerApp.ps1
index 2040911..0ec6b37 100644
--- a/d365bap.tools/functions/Get-BapEnvironmentPowerApp.ps1
+++ b/d365bap.tools/functions/Get-BapEnvironmentPowerApp.ps1
@@ -89,7 +89,7 @@ function Get-BapEnvironmentPowerApp {
if (Test-PSFFunctionInterrupt) { return }
- $baseUri = $envObj.LinkedMetaPpacEnvUri
+ $baseUri = $envObj.PpacEnvUri
$uriPowerAppsApi = $envObj."Api.PowerApps"
$secureToken = (Get-AzAccessToken -ResourceUrl $baseUri -AsSecureString).Token
diff --git a/d365bap.tools/functions/Get-BapEnvironmentSecurityRole.ps1 b/d365bap.tools/functions/Get-BapEnvironmentSecurityRole.ps1
index 5e2e76e..fc0e76e 100644
--- a/d365bap.tools/functions/Get-BapEnvironmentSecurityRole.ps1
+++ b/d365bap.tools/functions/Get-BapEnvironmentSecurityRole.ps1
@@ -124,7 +124,7 @@ function Get-BapEnvironmentSecurityRole {
if (Test-PSFFunctionInterrupt) { return }
- $baseUri = $envObj.LinkedMetaPpacEnvUri
+ $baseUri = $envObj.PpacEnvUri
$secureToken = (Get-AzAccessToken -ResourceUrl $baseUri -AsSecureString).Token
$tokenWebApiValue = ConvertFrom-SecureString -AsPlainText -SecureString $secureToken
diff --git a/d365bap.tools/functions/Get-BapEnvironmentSolution.ps1 b/d365bap.tools/functions/Get-BapEnvironmentSolution.ps1
index 9a7526f..f9248a2 100644
--- a/d365bap.tools/functions/Get-BapEnvironmentSolution.ps1
+++ b/d365bap.tools/functions/Get-BapEnvironmentSolution.ps1
@@ -117,7 +117,7 @@ function Get-BapEnvironmentSolution {
if (Test-PSFFunctionInterrupt) { return }
- $baseUri = $envObj.LinkedMetaPpacEnvUri
+ $baseUri = $envObj.PpacEnvUri
$secureToken = (Get-AzAccessToken -ResourceUrl $baseUri -AsSecureString).Token
$tokenWebApiValue = ConvertFrom-SecureString -AsPlainText -SecureString $secureToken
diff --git a/d365bap.tools/functions/Get-BapEnvironmentUser.ps1 b/d365bap.tools/functions/Get-BapEnvironmentUser.ps1
index 2a180a1..13b2d37 100644
--- a/d365bap.tools/functions/Get-BapEnvironmentUser.ps1
+++ b/d365bap.tools/functions/Get-BapEnvironmentUser.ps1
@@ -84,7 +84,7 @@ function Get-BapEnvironmentUser {
if (Test-PSFFunctionInterrupt) { return }
- $baseUri = $envObj.LinkedMetaPpacEnvUri
+ $baseUri = $envObj.PpacEnvUri
$secureToken = (Get-AzAccessToken -ResourceUrl $baseUri -AsSecureString).Token
$tokenWebApiValue = ConvertFrom-SecureString -AsPlainText -SecureString $secureToken
diff --git a/d365bap.tools/functions/Get-BapEnvironmentVirtualEntity.ps1 b/d365bap.tools/functions/Get-BapEnvironmentVirtualEntity.ps1
index 36f0768..8bb56b9 100644
--- a/d365bap.tools/functions/Get-BapEnvironmentVirtualEntity.ps1
+++ b/d365bap.tools/functions/Get-BapEnvironmentVirtualEntity.ps1
@@ -119,7 +119,7 @@ function Get-BapEnvironmentVirtualEntity {
if (Test-PSFFunctionInterrupt) { return }
- $baseUri = $envObj.LinkedMetaPpacEnvUri
+ $baseUri = $envObj.PpacEnvUri
$secureToken = (Get-AzAccessToken -ResourceUrl $baseUri -AsSecureString).Token
$tokenWebApiValue = ConvertFrom-SecureString -AsPlainText -SecureString $secureToken
diff --git a/d365bap.tools/functions/Get-UdeEnvironment.ps1 b/d365bap.tools/functions/Get-UdeEnvironment.ps1
index ce69584..6f726ad 100644
--- a/d365bap.tools/functions/Get-UdeEnvironment.ps1
+++ b/d365bap.tools/functions/Get-UdeEnvironment.ps1
@@ -65,25 +65,6 @@ function Get-UdeEnvironment {
}
process {
- $SoapBody = @"
-
-
- CrmUser
- 9.2.49.6961
- ##REQUESTID##
-
-
-
-
-
- ##REQUESTID##
- msprov_getfinopsapplicationdetails
-
-
-
-
-"@
-
$resCol = @(
foreach ($envObj in $($colEnv | Where-Object FinOpsMetadataEnvType -eq "Internal")) {
if ($searchById) {
@@ -103,42 +84,31 @@ function Get-UdeEnvironment {
}
# We need to get the internal provisioning details via SOAP call
- $baseUri = $envObj.LinkedMetaPpacEnvUri
+ $baseUri = $envObj.PpacEnvUri
$secureToken = (Get-AzAccessToken -ResourceUrl $baseUri -AsSecureString).Token
$tokenWebApiValue = ConvertFrom-SecureString -AsPlainText -SecureString $secureToken
- $payload = $SoapBody -replace "##REQUESTID##", ([System.Guid]::NewGuid().ToString())
- $localUri = "$($baseUri)/XRMServices/2011/Organization.svc/web?SDKClientVersion=9.2.49.6961"
-
$headers = @{
- "Content-Type" = "text/xml; charset=utf-8"
"Authorization" = "Bearer $($tokenWebApiValue)"
- "Soapaction" = "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute"
}
- $Response = Invoke-WebRequest -Uri $localUri `
- -Method Post `
+ $localUri = $baseUri + '/api/data/v9.2/msprov_getfinopsapplicationdetails'
+
+ $Response = Invoke-RestMethod -Uri $localUri `
+ -Method Get `
-Headers $headers `
- -Body $payload `
- -UseBasicParsing `
-SkipHttpErrorCheck
- if (-not ($Response.StatusCode -like "2**")) {
+ if ($null -eq $Response) {
$messageString = "Could not obtain the Ppac Provision details for $($envObj.PpacEnvName). It could be due to insufficient permissions or the environment not being fully provisioned. Please try to access the environment details from PowerPlatform Admin Center."
Write-PSFMessage -Level Important -Message $messageString
Write-PSFHostColor -String "- https://admin.powerplatform.microsoft.com/environments/environment/$($envObj.PpacEnvId)/hub"
}
else {
- $tmpXml = [xml]$Response.Content
- $nodes = $tmpXml.SelectNodes('//*[local-name()="KeyValuePairOfstringanyType"]')
-
- foreach ($node in $nodes) {
- $keyNode = $node.SelectSingleNode('*[local-name()="key"]')
- $valueNode = $node.SelectSingleNode('*[local-name()="value"]')
-
- $propName = $($keyNode.InnerText).Replace("applicationversion", "AppVersion").Replace("platformversion", "PlatVersion").Replace("finopsenvironmentstate", "State").Replace("applicationdeploymenttype", "Type").Replace("finopsenvironmentid", "Id")
- $envObj | Add-Member -NotePropertyName "Provisioning$($propName)" -NotePropertyValue $valueNode.InnerText
- }
+ $envObj | Add-Member -NotePropertyName "ProvisioningAppVersion" -NotePropertyValue $Response.applicationversion
+ $envObj | Add-Member -NotePropertyName "ProvisioningPlatVersion" -NotePropertyValue $Response.platformversion
+ $envObj | Add-Member -NotePropertyName "ProvisioningState" -NotePropertyValue $Response.finopsenvironmentstate
+ $envObj | Add-Member -NotePropertyName "ProvisioningType" -NotePropertyValue $Response.applicationdeploymenttype
}
# We need to user friendly version details from the installed D365 app
diff --git a/d365bap.tools/functions/Get-UdeEnvironmentOperationHistory.ps1 b/d365bap.tools/functions/Get-UdeEnvironmentOperationHistory.ps1
index b381461..24509b5 100644
--- a/d365bap.tools/functions/Get-UdeEnvironmentOperationHistory.ps1
+++ b/d365bap.tools/functions/Get-UdeEnvironmentOperationHistory.ps1
@@ -118,7 +118,7 @@ function Get-UdeEnvironmentOperationHistory {
}
foreach ($opsObj in $colModules) {
- foreach ($prop in ($opsObj.msprov_operationproperties | `
+ foreach ($prop in ($opsObj.msprov_operationproperties | Where-Object { $null -ne $_ } |`
ConvertFrom-Json -Depth 10).PsObject.Properties) {
$opsObj | Add-Member -NotePropertyName "prop_$($prop.Name)" -NotePropertyValue $prop.Value -Force
}
@@ -152,7 +152,6 @@ function Get-UdeEnvironmentOperationHistory {
if ($DownloadLog) {
Write-PSFMessage `
-Message "Please note that for 'FnO DB Sql Jit request' there exists no logs. Will attempt to download logs for other operations." `
-
foreach ($histObj in $resCol) {
$logFileName = "$($histObj.Id)_$($histObj.msprov_logs_name)"
@@ -165,11 +164,14 @@ function Get-UdeEnvironmentOperationHistory {
Invoke-WebRequest -Uri $logUri `
-Method Get `
-Headers $headers `
- -OutFile $downloadFilePath
+ -OutFile $downloadFilePath `
+ -SkipHttpErrorCheck
}
}
- }
+ Write-PSFMessage -Level Important -Message "Operation logs downloaded to:"
+ Write-PSFHostColor -String "- '$downloadDir'"
+ }
$resCol
}
diff --git a/d365bap.tools/functions/Set-BapEnvironmentSecurityRoleMember.ps1 b/d365bap.tools/functions/Set-BapEnvironmentSecurityRoleMember.ps1
index 15e4745..8c7bde7 100644
--- a/d365bap.tools/functions/Set-BapEnvironmentSecurityRoleMember.ps1
+++ b/d365bap.tools/functions/Set-BapEnvironmentSecurityRoleMember.ps1
@@ -56,7 +56,7 @@ function Set-BapEnvironmentSecurityRoleMember {
if (Test-PSFFunctionInterrupt) { return }
- $baseUri = $envObj.LinkedMetaPpacEnvUri
+ $baseUri = $envObj.PpacEnvUri
$secureToken = (Get-AzAccessToken -ResourceUrl $baseUri -AsSecureString).Token
$tokenWebApiValue = ConvertFrom-SecureString -AsPlainText -SecureString $secureToken
diff --git a/d365bap.tools/functions/Set-BapEnvironmentVirtualEntity.ps1 b/d365bap.tools/functions/Set-BapEnvironmentVirtualEntity.ps1
index 6e34b30..e648b82 100644
--- a/d365bap.tools/functions/Set-BapEnvironmentVirtualEntity.ps1
+++ b/d365bap.tools/functions/Set-BapEnvironmentVirtualEntity.ps1
@@ -120,7 +120,7 @@ function Set-BapEnvironmentVirtualEntity {
if (Test-PSFFunctionInterrupt) { return }
- $baseUri = $envObj.LinkedMetaPpacEnvUri
+ $baseUri = $envObj.PpacEnvUri
$secureToken = (Get-AzAccessToken -ResourceUrl $baseUri -AsSecureString).Token
$tokenWebApiValue = ConvertFrom-SecureString -AsPlainText -SecureString $secureToken
diff --git a/d365bap.tools/functions/Start-BapDatabaseRefresh.ps1 b/d365bap.tools/functions/Start-UdeDatabaseRefresh.ps1
similarity index 83%
rename from d365bap.tools/functions/Start-BapDatabaseRefresh.ps1
rename to d365bap.tools/functions/Start-UdeDatabaseRefresh.ps1
index d6e51f5..5fe1f13 100644
--- a/d365bap.tools/functions/Start-BapDatabaseRefresh.ps1
+++ b/d365bap.tools/functions/Start-UdeDatabaseRefresh.ps1
@@ -28,36 +28,36 @@
Instructs the cmdlet to execute an advanced copy for Finance and Operations.
.EXAMPLE
- PS C:\> Start-BapDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat*
+ PS C:\> Start-UdeDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat*
This will start a full copy database refresh from the environment with id containing "dev" to the environment with id containing "uat".
It defaults to a full copy.
.EXAMPLE
- PS C:\> Start-BapDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy
+ PS C:\> Start-UdeDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy
This will start a full copy database refresh from the environment with id containing "dev" to the environment with id containing "uat".
.EXAMPLE
- PS C:\> Start-BapDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType TransactionLess
+ PS C:\> Start-UdeDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType TransactionLess
This will start a transaction-less database refresh from the environment with id containing "dev" to the environment with id containing "uat".
.EXAMPLE
- PS C:\> Start-BapDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy -IncludeAuditData
+ PS C:\> Start-UdeDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy -IncludeAuditData
This will start a full copy database refresh from the environment with id containing "dev" to the environment with id containing "uat".
It will include audit data in the copy.
.EXAMPLE
- PS C:\> Start-BapDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy -AdvancedFnO
+ PS C:\> Start-UdeDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy -AdvancedFnO
This will start a full copy database refresh from the environment with id containing "dev" to the environment with id containing "uat".
It will execute an advanced copy for Finance and Operations.
.NOTES
Author: Mötz Jensen (@Splaxi)
#>
-function Start-BapDatabaseRefresh {
+function Start-UdeDatabaseRefresh {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
[CmdletBinding()]
param (
@@ -88,8 +88,8 @@ function Start-BapDatabaseRefresh {
process {
if (Test-PSFFunctionInterrupt) { return }
- $envSource = Get-BapEnvironment -EnvironmentId $SourceEnvironmentId | Select-Object -First 1
- $envTarget = Get-BapEnvironment -EnvironmentId $TargetEnvironmentId | Select-Object -First 1
+ $envSource = Get-UdeEnvironment -EnvironmentId $SourceEnvironmentId | Select-Object -First 1
+ $envTarget = Get-UdeEnvironment -EnvironmentId $TargetEnvironmentId | Select-Object -First 1
if ($null -eq $envSource -or $null -eq $envTarget) {
$messageString = "Could not find either source or target environments. Please verify the Ids and try again, or list available environments using Get-BapEnvironment."
@@ -109,6 +109,15 @@ function Start-BapDatabaseRefresh {
return
}
+ if (([Version]$envSource.FinOpsApp).Build -lt ([Version]$envTarget.FinOpsApp).Build) {
+ $messageString = "The build version of FnO application in the source environment is lower than in the target environment. Database refresh is not supported in this scenario."
+
+ Write-PSFMessage -Level Important -Message $messageString
+ Stop-PSFFunction -Message "Stopping because one of the FnO application is different." `
+ -Exception $([System.Exception]::new($($messageString -replace '<[^>]+>', '')))
+ return
+ }
+
$payload = [PSCustomObject][ordered]@{
sourceEnvironmentId = $envSource.PpacEnvId
targetEnvironmentName = $envTarget.PpacEnvName
diff --git a/d365bap.tools/functions/Update-BapEnvironmentVirtualEntityMetadata.ps1 b/d365bap.tools/functions/Update-BapEnvironmentVirtualEntityMetadata.ps1
index 2a437cb..e503829 100644
--- a/d365bap.tools/functions/Update-BapEnvironmentVirtualEntityMetadata.ps1
+++ b/d365bap.tools/functions/Update-BapEnvironmentVirtualEntityMetadata.ps1
@@ -46,7 +46,7 @@ function Update-BapEnvironmentVirtualEntityMetadata {
if (Test-PSFFunctionInterrupt) { return }
- $baseUri = $envObj.LinkedMetaPpacEnvUri
+ $baseUri = $envObj.PpacEnvUri
$secureToken = (Get-AzAccessToken -ResourceUrl $baseUri -AsSecureString).Token
$tokenWebApiValue = ConvertFrom-SecureString -AsPlainText -SecureString $secureToken
diff --git a/d365bap.tools/tests/functions/Start-BapDatabaseRefresh.Tests.ps1 b/d365bap.tools/tests/functions/Start-BapDatabaseRefresh.Tests.ps1
index cea2868..4ccb959 100644
--- a/d365bap.tools/tests/functions/Start-BapDatabaseRefresh.Tests.ps1
+++ b/d365bap.tools/tests/functions/Start-BapDatabaseRefresh.Tests.ps1
@@ -1,4 +1,4 @@
-Describe "Start-BapDatabaseRefresh Unit Tests" -Tag "Unit" {
+Describe "Start-UdeDatabaseRefresh Unit Tests" -Tag "Unit" {
BeforeAll {
# Place here all things needed to prepare for the tests
}
@@ -8,11 +8,11 @@
Describe "Ensuring unchanged command signature" {
It "should have the expected parameter sets" {
- (Get-Command Start-BapDatabaseRefresh).ParameterSets.Name | Should -Be '__AllParameterSets'
+ (Get-Command Start-UdeDatabaseRefresh).ParameterSets.Name | Should -Be '__AllParameterSets'
}
It 'Should have the expected parameter SourceEnvironmentId' {
- $parameter = (Get-Command Start-BapDatabaseRefresh).Parameters['SourceEnvironmentId']
+ $parameter = (Get-Command Start-UdeDatabaseRefresh).Parameters['SourceEnvironmentId']
$parameter.Name | Should -Be 'SourceEnvironmentId'
$parameter.ParameterType.ToString() | Should -Be System.String
$parameter.IsDynamic | Should -Be $False
@@ -25,7 +25,7 @@
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
}
It 'Should have the expected parameter TargetEnvironmentId' {
- $parameter = (Get-Command Start-BapDatabaseRefresh).Parameters['TargetEnvironmentId']
+ $parameter = (Get-Command Start-UdeDatabaseRefresh).Parameters['TargetEnvironmentId']
$parameter.Name | Should -Be 'TargetEnvironmentId'
$parameter.ParameterType.ToString() | Should -Be System.String
$parameter.IsDynamic | Should -Be $False
@@ -38,7 +38,7 @@
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
}
It 'Should have the expected parameter CopyType' {
- $parameter = (Get-Command Start-BapDatabaseRefresh).Parameters['CopyType']
+ $parameter = (Get-Command Start-UdeDatabaseRefresh).Parameters['CopyType']
$parameter.Name | Should -Be 'CopyType'
$parameter.ParameterType.ToString() | Should -Be System.String
$parameter.IsDynamic | Should -Be $False
@@ -51,7 +51,7 @@
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
}
It 'Should have the expected parameter IncludeAuditData' {
- $parameter = (Get-Command Start-BapDatabaseRefresh).Parameters['IncludeAuditData']
+ $parameter = (Get-Command Start-UdeDatabaseRefresh).Parameters['IncludeAuditData']
$parameter.Name | Should -Be 'IncludeAuditData'
$parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
$parameter.IsDynamic | Should -Be $False
@@ -64,7 +64,7 @@
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
}
It 'Should have the expected parameter AdvancedFnO' {
- $parameter = (Get-Command Start-BapDatabaseRefresh).Parameters['AdvancedFnO']
+ $parameter = (Get-Command Start-UdeDatabaseRefresh).Parameters['AdvancedFnO']
$parameter.Name | Should -Be 'AdvancedFnO'
$parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
$parameter.IsDynamic | Should -Be $False
diff --git a/docs/Start-BapDatabaseRefresh.md b/docs/Start-UdeDatabaseRefresh.md
similarity index 89%
rename from docs/Start-BapDatabaseRefresh.md
rename to docs/Start-UdeDatabaseRefresh.md
index 2912ab8..15db46e 100644
--- a/docs/Start-BapDatabaseRefresh.md
+++ b/docs/Start-UdeDatabaseRefresh.md
@@ -5,7 +5,7 @@ online version:
schema: 2.0.0
---
-# Start-BapDatabaseRefresh
+# Start-UdeDatabaseRefresh
## SYNOPSIS
Start a database refresh between two environments
@@ -13,7 +13,7 @@ Start a database refresh between two environments
## SYNTAX
```
-Start-BapDatabaseRefresh [-SourceEnvironmentId] [[-TargetEnvironmentId] ]
+Start-UdeDatabaseRefresh [-SourceEnvironmentId] [[-TargetEnvironmentId] ]
[[-CopyType] ] [-IncludeAuditData] [-AdvancedFnO] []
```
@@ -26,7 +26,7 @@ The source and target environments must both be either managed or unmanaged.
### EXAMPLE 1
```
-Start-BapDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat*
+Start-UdeDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat*
```
This will start a full copy database refresh from the environment with id containing "dev" to the environment with id containing "uat".
@@ -34,21 +34,21 @@ It defaults to a full copy.
### EXAMPLE 2
```
-Start-BapDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy
+Start-UdeDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy
```
This will start a full copy database refresh from the environment with id containing "dev" to the environment with id containing "uat".
### EXAMPLE 3
```
-Start-BapDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType TransactionLess
+Start-UdeDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType TransactionLess
```
This will start a transaction-less database refresh from the environment with id containing "dev" to the environment with id containing "uat".
### EXAMPLE 4
```
-Start-BapDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy -IncludeAuditData
+Start-UdeDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy -IncludeAuditData
```
This will start a full copy database refresh from the environment with id containing "dev" to the environment with id containing "uat".
@@ -56,7 +56,7 @@ It will include audit data in the copy.
### EXAMPLE 5
```
-Start-BapDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy -AdvancedFnO
+Start-UdeDatabaseRefresh -SourceEnvironmentId *dev* -TargetEnvironmentId *uat* -CopyType FullCopy -AdvancedFnO
```
This will start a full copy database refresh from the environment with id containing "dev" to the environment with id containing "uat".