-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunDataverseCommands.ps1
More file actions
58 lines (38 loc) · 2.6 KB
/
Copy pathRunDataverseCommands.ps1
File metadata and controls
58 lines (38 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Param(
[string] [Parameter(Mandatory = $true)] $UserName,
[string] [Parameter(Mandatory = $true)] $Password,
[string] [Parameter(Mandatory = $true)] $Region,
[string] [Parameter(Mandatory = $true)] $Organisation,
[string] [Parameter(Mandatory = $true)] $TenantId
)
Import-Module "$PSScriptRoot\DataverseOperations.psm1"
$Connection = Get-DataverseConnection -UserName $UserName -Password $Password -Region $Region -Organisation $Organisation -MaxAttempts 3
Add-PowerAppsAccount -TenantID $TenantId -Username $Username -Password $Password
#In the below example, the $Env:SERVICEBUSURL and $Env:AZUREQUEUENAME are from Azure DevOps variable
Update-QueueServiceEndpoint -Connection $Connection -ServiceEndpointId "00000000-0000-0000-0000-000000000000" -SasKey "ServiceBusSasKey" -Address $Env:SERVICEBUSURL -Path $Env:AZUREQUEUENAME
Update-WebhookServiceEndpoint -Connection $Connection -ServiceEndpointId "00000000-0000-0000-0000-000000000000" -SasKey "WebhookKey" -Address "https://address.com"
Remove-Field -FieldName "cr06a_fieldname" -EntityName "cr06a_entityname" -Connection $Connection
#Business Rule category = 2, classic workflow = 0
Remove-Process -ComponentName "workflow" -ComponentType 0 -ComponentId "00000000-0000-0000-0000-000000000000" -Connection $Connection
Remove-Form -FormId "00000000-0000-0000-0000-000000000000" -Connection $Connection
Remove-View -ViewId "00000000-0000-0000-0000-000000000000" -Connection $Connection
Remove-Entity -EntityName "cr06a_entityname" -Connection $Connection
Remove-Field -FieldName "cr06a_fieldname" -EntityName "cr06a_entityname" -Connection $Connection
Remove-OptionSet -Name "cr06a_optionsetname" -Connection $Connection
Remove-OptionSetItem -OptionSetName "cr06a_optionsetname" -Value 100000000 -Connection $Connection
Remove-Plugin -RecordId "00000000-0000-0000-0000-000000000000" -Connection $Connection
Remove-PluginStep -Id "00000000-0000-0000-0000-000000000000" -Connection $Connection
Remove-WebResource -WebResourceId "00000000-0000-0000-0000-000000000000" -Connection $Connection
$condition =
@"
<filter type="or" >
<condition attribute="uniquename" operator="in" >
<value>SolutionX</value>
<value>SolutionY</value>
</condition>
</filter>
"@
Remove-Solutions -FetchXmlFilterCondition $condition -Connection $Connection
Update-EnvVariable -EnvVariableId "00000000-0000-0000-0000-000000000000" -Connection $Connection
Remove-EnvVariable -Name "cr06a_envvar" -Connection $Connection
Remove-CanvasApp -EnvironmentName "prod" -CanvasAppName "cr06a_app"