Skip to content

Commit a68af49

Browse files
committed
Updated examples for Connect-FabricAccount #164
1 parent db658f8 commit a68af49

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

source/Public/Connect-FabricAccount.ps1

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,28 @@ function Connect-FabricAccount {
3838
```
3939
4040
.EXAMPLE
41-
Connects as Service Principal using id and secret
41+
Connects as Service Principal using AppId and secret
4242
4343
```powershell
44-
Connect-FabricAccount -TenantId 'xxx' -ServicePrincipalId 'appId' -ServicePrincipalSecret $secret
44+
$TenantID = '12345678-1234-1234-1234-123456789012'
45+
$ServicePrincipalId = '4cbbe76e-1234-1234-0000-ffffffffffff'
46+
$ServicePrincipalSecret = 'xyz'
47+
48+
$ServicePrincipalSecretSecure = ($ServicePrincipalSecret | ConvertTo-SecureString -AsPlainText -Force)
49+
Connect-FabricAccount -TenantId $TenantID -ServicePrincipalId $ServicePrincipalId -ServicePrincipalSecret $ServicePrincipalSecretSecure -Reset
50+
```
51+
52+
.EXAMPLE
53+
Connects as Service Principal using credential object
54+
55+
```powershell
56+
$TenantID = '12345678-1234-1234-1234-123456789012'
57+
$ServicePrincipalId = '4cbbe76e-1234-1234-0000-ffffffffffff'
58+
$ServicePrincipalSecret = 'xyz'
59+
60+
$ServicePrincipalSecretSecure = ($ServicePrincipalSecret | ConvertTo-SecureString -AsPlainText -Force)
61+
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ServicePrincipalId, $ServicePrincipalSecretSecure
62+
Connect-FabricAccount -TenantId $TenantID -Credential $credential -Verbose -Reset
4563
```
4664
4765
.OUTPUTS

0 commit comments

Comments
 (0)