You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/manage/azure-arc-enabled-sql-server/modify-license-type/modify-license-type.ps1
+22-4Lines changed: 22 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,15 @@
6
6
# If not specified, all subscriptions your role has access to are scanned.
7
7
#
8
8
# The script accepts the following command line parameters:
9
-
#
9
+
#.
10
10
# -SubId [subscription_id] | [csv_file_name] (Optional. Limits the scope to specific subscriptions. Accepts a .csv file with the list of subscriptions.
11
11
# If not specified all subscriptions will be scanned)
12
12
# -ResourceGroup [resource_goup] (Optional. Limits the scope to a specific resoure group)
13
13
# -MachineName [machine_name] (Optional. Limits the scope to a specific machine)
14
14
# -LicenseType [license_type_value] (Optional. Sets the license type to the specified value)
15
-
# -EnableESU [Yes or No] (Optional. Enables the ESU policy the value is "Yes" or disables it if the value is "No"
15
+
# -EnableESU [Yes or No] (Optional. Enables the ESU policy if the value is "Yes" or disables it if the value is "No"
16
+
# To enable, the license type must be "Paid" or "PAYG"
17
+
# -UsePcoreLicense [Yes or No] (Optional. Enables unlimited virtualization license if the value is "Yes" or disables it if the value is "No"
16
18
# To enable, the license type must be "Paid" or "PAYG"
17
19
# -Force (Optional. Forces the chnahge of the license type to the specified value on all installed extensions.
18
20
# If Force is not specified, the -LicenseType value is set only if undefined. Ignored if -LicenseType is not specified
@@ -36,6 +38,9 @@ param (
36
38
[ValidateSet("Yes","No", IgnoreCase=$false)]
37
39
[string] $EnableESU,
38
40
[Parameter (Mandatory=$false)]
41
+
[ValidateSet("Yes","No", IgnoreCase=$false)]
42
+
[string] $UsePcoreLicense,
43
+
[Parameter (Mandatory=$false)]
39
44
[switch] $Force
40
45
)
41
46
@@ -243,11 +248,24 @@ foreach ($sub in $subscriptions){
243
248
write-host"The configured license type does not support ESUs"
244
249
}
245
250
}
246
-
251
+
252
+
# Enable UsePcoreLicense for qualified license types or disable
253
+
if ($UsePcoreLicense) {
254
+
if (($settings["LicenseType"] |select-string"Paid","PAYG") -or ($UsePcoreLicense-eq"No")) {
0 commit comments