-
Notifications
You must be signed in to change notification settings - Fork 0
/
SolutionManagement.ps1
97 lines (80 loc) · 3.99 KB
/
SolutionManagement.ps1
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# AUTH SNIPPETS
pac auth create --environment https://hlstechreviewdev.crm.dynamics.com/
pac auth create --environment https://hlstechreview.crm.dynamics.com/
pac auth list
pac auth who
pac auth select --index 4
# Environment variable values for saving
# MOCK channel ID: 19:9b3390f9b3ff4eb0821164774eeaae35@thread.tacv2
# general channel ID: 19:VZvuSWaqpI8YfBoCJ9wg5dMDhdIHaybmn6BgS7dzaZ41@thread.tacv2
# Curbside Consult channel: 19:d99148c5b25a47618ef63bdeed924468@thread.tacv2
# EXPORT SOLUTIONS
# Set these before running the script
$solutionDir = ".\Solutions\"
$solutionVersion = "2.0.0.9"
$newSolutionVersion = "2.0.0.10"
# $solutionName = "HackTrackerCore"
# $solutionName = "HackTrackerAdminApp"
# $solutionName = "HackTrackerSecurityRoles"
# $solutionName = "HackTrackerFlows"
$solutionName = "HackTrackerGuidedApps"
# The following commands execute the export using the variables above
pac auth select --index 5
pac solution export --path ${solutionDir}${solutionName}-${solutionVersion}.zip --name $solutionName --managed false
pac solution export --path ${solutionDir}${solutionName}-${solutionVersion}_managed.zip --name $solutionName --managed true
pac solution online-version --solution-name ${solutionName} --solution-version ${newSolutionVersion}
# Generate Settings File for environment variables
pac solution create-settings -z ${solutionDir}${solutionName}-${solutionVersion}.zip -s ${solutionDir}EnvSettings_1_1_0_16.json
# IMPORT MANAGED SOLUTION
# Set these before running the script
$solutionDir = ".\Solutions\"
$solutionVersion = "2.0.0.9"
# $solutionName = "HackTrackerCore"
# $solutionName = "HackTrackerAdminApp"
# $solutionName = "HackTrackerSecurityRoles"
# $solutionName = "HackTrackerFlows"
$solutionName = "HackTrackerGuidedApps"
# $settingsName = "EnvSettings.json"
# The following commands execute the export using the variables above
pac auth select --index 4
pac solution import --path ${solutionDir}${solutionName}-${solutionVersion}_managed.zip
# OR import with settings file
# pac solution import --path ${solutionDir}${solutionName}-${solutionVersion}_managed.zip --settings-file ${solutionDir}${settingsName}
# UNPACK SOLUTIONS
# Set these before running script
$solutionDir = ".\Solutions\"
$solutionVersion = "2.0.0.9"
# $solutionName = "HackTrackerCore"
# $solutionName = "HackTrackerAdminApp"
# $solutionName = "HackTrackerSecurityRoles"
# $solutionName = "HackTrackerFlows"
$solutionName = "HackTrackerGuidedApps"
$targetFolder = ".\Source\"
pac solution unpack --zipfile ${solutionDir}${solutionName}-${solutionVersion}.zip --folder ${targetFolder}
# SYNC DEV ENVIRONMENTS
# Import from Primary Dev to external sandbox
# Set these before running the script
pac auth create --url https://org3f9e0cf9.crm.dynamics.com/ --name ManagedAzureHackDev
$solutionDir = ".\Solutions\"
$solutionVersion = "1.0.0.6"
$solutionName = "HackTracker"
# The following commands execute the export using the variables above
pac solution import --path ${solutionDir}${solutionName}-${solutionVersion}.zip
pac solution publish --name $solutionName
# Export external dev sandbox
# Set these before running the script
pac auth create --url https://org3f9e0cf9.crm.dynamics.com/ --name ManagedAzureHackDev
$solutionDir = ".\Solutions\"
$solutionVersion = "1.0.0.0"
$solutionName = "Updatetoprimarydev"
# The following commands execute the export using the variables above
pac solution export --path ${solutionDir}${solutionName}-${solutionVersion}.zip --name $solutionName --managed false
# Import From Primary Dev to external sandbox
# Set these before running the script
pac auth create --url https://hlstechreviewdev.crm.dynamics.com/ --name TLCRevewBoardDev
$solutionDir = ".\Solutions\"
$solutionVersion = "1.0.0.0"
$solutionName = "Updatetoprimarydev"
# The following commands execute the export using the variables above
pac solution import --path ${solutionDir}${solutionName}-${solutionVersion}.zip
pac solution publish --name $solutionName