Skip to content

Commit ed1ff29

Browse files
So that we have good practice and resolve PR comments
Signed-off-by: Rob Sewell <mrrobsewell@outlook.com>
1 parent 3b535d6 commit ed1ff29

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

source/Public/Connect-FabricAccount.ps1

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,27 @@ function Connect-FabricAccount {
55
Connects to the Fabric WebAPI.
66
77
.DESCRIPTION
8-
Connects to the Fabric WebAPI by using the cmdlet Connect-AzAccount.
9-
This function retrieves the authentication token for the Fabric API and sets up the headers for API calls.
8+
Connects to the Fabric WebAPI by using the cmdlet Connect-AzAccount. This function retrieves the authentication token for the Fabric API and sets up the headers for API calls.
109
1110
.PARAMETER TenantId
12-
The TenantId of the Azure Active Directory tenant you want to connect to
13-
and in which your Fabric Capacity is.
11+
The TenantId of the Azure Active Directory tenant you want to connect to and in which your Fabric Capacity is.
1412
1513
.PARAMETER ServicePrincipalId
1614
The Client ID (AppId) of the service principal used for authentication.
1715
1816
.PARAMETER ServicePrincipalSecret
19-
The **secure string** representing the service principal secret. Use Read-Host -AsSecureString or other secure entry.
17+
The **secure string** representing the service principal secret.
2018
2119
.PARAMETER Credential
2220
A PSCredential object representing a user credential (username and secure password).
2321
2422
.EXAMPLE
25-
Connect-FabricAccount `
26-
-TenantId '12345678-1234-1234-1234-123456789012'
23+
Connect-FabricAccount -TenantId '12345678-1234-1234-1234-123456789012'
2724
2825
.EXAMPLE
2926
$secret = Read-Host -AsSecureString
3027
Connect-FabricAccount -TenantId 'xxx' -ServicePrincipalId 'appId' -ServicePrincipalSecret $secret
3128
32-
3329
.NOTES
3430
3531
Revsion History:
@@ -39,7 +35,6 @@ function Connect-FabricAccount {
3935
4036
.LINK
4137
Connect-AzAccount https://learn.microsoft.com/de-de/powershell/module/az.accounts/connect-azaccount?view=azps-12.4.0
42-
4338
#>
4439

4540
[CmdletBinding(SupportsShouldProcess)]
@@ -66,7 +61,6 @@ function Connect-FabricAccount {
6661
if ($servicePrincipalId) {
6762
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $servicePrincipalId, $servicePrincipalSecret
6863
$null = Connect-AzAccount -ServicePrincipal -TenantId $tenantId -Credential $credential
69-
#Set-AzContext -Tenant $tenantId | Out-Null
7064
}
7165
elseif ($null -ne $credential) {
7266
$null = Connect-AzAccount -Credential $credential -Tenant $tenantId
@@ -88,8 +82,6 @@ function Connect-FabricAccount {
8882
$FabricSession.HeaderParams = @{'Authorization' = "Bearer {0}" -f $FabricSession.FabricToken }
8983
Write-Verbose "HeaderParams: $($FabricSession.HeaderParams)"
9084
}
91-
9285
end {
9386
}
94-
9587
}

0 commit comments

Comments
 (0)