Skip to content

Commit 2bb4b76

Browse files
authored
Merge pull request #1181 from anosov1960/master
Fixed optionality of parameters
2 parents d42ab54 + d82dfc0 commit 2bb4b76

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

samples/manage/azure-arc-enabled-sql-server/modify-license-type/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services: Azure Arc-enabled SQL Server
33
platforms: Azure
44
author: anosov1960
55
ms.author: sashan
6-
ms.date: 6/21/2023
6+
ms.date: 7/5/2023
77
---
88

99

@@ -32,7 +32,7 @@ The script accepts the following command line parameters:
3232
|-MachineName |machine_name|Optional: Limits the scope to a specific machine|
3333
|-LicenceType | "Paid", "PAYG" or "LicenseOnly"| Optional: Sets the license type to the specified value |
3434
|-EnableESU | "Yes", "No" | Optional. Enables the ESU policy the value is "Yrs" or disables it if the value is "No". To enable, the license type must be "Paid" or "PAYG"|
35-
|-Force|\$True or \$False (default)|Optional. Forces the change of the license type to the specified value on all installed extensions. If -Force is not specified, the -LicenseType value is set only if undefined. Ignored if -LicenseType is not specified|
35+
|-Force| |Optional. Forces the change of the license type to the specified value on all installed extensions. If -Force is not specified, the -LicenseType value is set only if undefined. Ignored if -LicenseType is not specified|
3636

3737
<sup>1</sup>You can create a .csv file using the following command and then edit to remove the subscriptions you don't want to scan.
3838
```PowerShell
@@ -52,15 +52,15 @@ The following command will scan all the subscriptions to which the user has acce
5252
The following command will scan the subscription `<sub_id>` and set the license type value to "Paid" on all servers.
5353

5454
```PowerShell
55-
.\modify-license-type.ps1 -SubId <sub_id> -LicenseType Paid -Force $True
55+
.\modify-license-type.ps1 -SubId <sub_id> -LicenseType Paid -Force
5656
```
5757

5858
## Example 3
5959

6060
The following command will scan resource group <resource_group_name> in the subscription `<sub_id>` and set the license type value to "PAYG" on all servers.
6161

6262
```PowerShell
63-
.\modify-license-type.ps1 -SubId <sub_id> -ResourceGroup <resource_group_name> -LicenseType PAYG -Force $True
63+
.\modify-license-type.ps1 -SubId <sub_id> -ResourceGroup <resource_group_name> -LicenseType PAYG -Force
6464
```
6565

6666
# Running the script using Cloud Shell

samples/manage/azure-arc-enabled-sql-server/modify-license-type/modify-license-type.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# -LicenseType [license_type_value] (Optional. Sets the license type to the specified value)
1515
# -EnabelESU [Yes or No] (Optional. Enables the ESU policy the value is "Yes" or disables it if the value is "No"
1616
# To enable, the license type must be "Paid" or "PAYG"
17-
# -Force [$true or $false] (Optional. Forces the chnahge of the license type to the specified value on all installed extensions.
17+
# -Force (Optional. Forces the chnahge of the license type to the specified value on all installed extensions.
1818
# If Force is not specified, the -LicenseType value is set only if undefined. Ignored if -LicenseType is not specified
1919
#
2020
# This script uses a function ConvertTo-HashTable that was created by Adam Bertram (@adam-bertram).
@@ -35,8 +35,8 @@ param (
3535
[Parameter (Mandatory= $false)]
3636
[ValidateSet("Yes","No", IgnoreCase=$false)]
3737
[string] $EnableESU,
38-
[Parameter (Mandatory= $true)]
39-
[boolean] $Force=$false
38+
[Parameter (Mandatory= $false)]
39+
[switch] $Force
4040
)
4141

4242
function CheckModule ($m) {

0 commit comments

Comments
 (0)