Skip to content

Commit 8d261a4

Browse files
committed
Injected examples , synopsis and descriptions
1 parent 80419db commit 8d261a4

22 files changed

+884
-541
lines changed

src/Authentication/Authentication.Core/Microsoft.Graph.Authentication.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<LangVersion>9.0</LangVersion>
55
<TargetFrameworks>netstandard2.0;net6.0;net472</TargetFrameworks>
66
<RootNamespace>Microsoft.Graph.PowerShell.Authentication.Core</RootNamespace>
7-
<Version>2.6.0</Version>
7+
<Version>2.6.1</Version>
88
</PropertyGroup>
99
<PropertyGroup>
1010
<EnableNETAnalyzers>true</EnableNETAnalyzers>

src/Authentication/Authentication.Test/Microsoft.Graph.Authentication.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<TargetFrameworks>net6.0;net472</TargetFrameworks>
44
<IsPackable>false</IsPackable>
5-
<Version>2.6.0</Version>
5+
<Version>2.6.1</Version>
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />

src/Authentication/Authentication/Microsoft.Graph.Authentication-help.xml

Lines changed: 251 additions & 69 deletions
Large diffs are not rendered by default.

src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<WarningsAsErrors />
1111
<NuspecFile>Microsoft.Graph.Authentication.nuspec</NuspecFile>
1212
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
13-
<Version>2.6.0</Version>
13+
<Version>2.6.1</Version>
1414
</PropertyGroup>
1515
<PropertyGroup>
1616
<EnableNETAnalyzers>true</EnableNETAnalyzers>

src/Authentication/Authentication/Microsoft.Graph.Authentication.dll-Help.xml

Lines changed: 222 additions & 263 deletions
Large diffs are not rendered by default.

src/Authentication/Authentication/Microsoft.Graph.Authentication.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package>
33
<metadata>
4-
<version>2.6.0</version>
4+
<version>2.6.1</version>
55
<id>Microsoft.Graph.Authentication</id>
66
<description>Microsoft Graph PowerShell authentication module</description>
77
<authors>Microsoft</authors>

src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft
55
#
6-
# Generated on: 19/09/2023
6+
# Generated on: 21/09/2023
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
RootModule = './Microsoft.Graph.Authentication.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '2.6.0'
15+
ModuleVersion = '2.6.1'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'

src/Authentication/descriptions/Microsoft.Graph.Authentication.md

Whitespace-only changes.

src/Authentication/docs/Add-MgEnvironment.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
external help file: Microsoft.Graph.Authentication.dll-Help.xml
33
Module Name: Microsoft.Graph.Authentication
44
online version: https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/add-mgenvironment
@@ -46,21 +46,6 @@ Accept pipeline input: True (ByPropertyName)
4646
Accept wildcard characters: False
4747
```
4848
49-
### -Confirm
50-
Prompts you for confirmation before running the cmdlet.
51-
52-
```yaml
53-
Type: SwitchParameter
54-
Parameter Sets: (All)
55-
Aliases: cf
56-
57-
Required: False
58-
Position: Named
59-
Default value: None
60-
Accept pipeline input: False
61-
Accept wildcard characters: False
62-
```
63-
6449
### -GraphEndpoint
6550
The service root endpoint for Microsoft Graph.
6651
@@ -91,6 +76,21 @@ Accept pipeline input: True (ByPropertyName)
9176
Accept wildcard characters: False
9277
```
9378
79+
### -Confirm
80+
Prompts you for confirmation before running the cmdlet.
81+
82+
```yaml
83+
Type: SwitchParameter
84+
Parameter Sets: (All)
85+
Aliases: cf
86+
87+
Required: False
88+
Position: Named
89+
Default value: None
90+
Accept pipeline input: False
91+
Accept wildcard characters: False
92+
```
93+
9494
### -WhatIf
9595
Shows what would happen if the cmdlet runs.
9696
The cmdlet is not run.

src/Authentication/docs/Connect-MgGraph.md

Lines changed: 101 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
external help file: Microsoft.Graph.Authentication.dll-Help.xml
33
Module Name: Microsoft.Graph.Authentication
44
online version: https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/connect-mggraph
@@ -8,59 +8,146 @@ schema: 2.0.0
88
# Connect-MgGraph
99

1010
## SYNOPSIS
11-
{{ Fill in the Synopsis }}
11+
Microsoft Graph PowerShell supports two types of authentication: delegated and app-only access. There are a number of cmdlets that can be used to manage the different parameters required during authentication, for example, environment, application ID, and certificate.
1212

1313
## SYNTAX
1414

1515
### UserParameterSet (Default)
1616
```
1717
Connect-MgGraph [[-Scopes] <String[]>] [[-ClientId] <String>] [-TenantId <String>]
18-
[-ContextScope <ContextScope>] [-Environment <String>] [-UseDeviceCode] [-ClientTimeout <Double>] [-NoWelcome]
19-
[-Break] [<CommonParameters>]
18+
[-ContextScope <ContextScope>] [-Environment <String>] [-UseDeviceCode] [-ClientTimeout <Double>]
19+
[<CommonParameters>]
2020
```
2121

2222
### AppCertificateParameterSet
2323
```
2424
Connect-MgGraph [-ClientId] <String> [[-CertificateSubjectName] <String>] [[-CertificateThumbprint] <String>]
2525
[-Certificate <X509Certificate2>] [-TenantId <String>] [-ContextScope <ContextScope>] [-Environment <String>]
26-
[-ClientTimeout <Double>] [-NoWelcome] [-Break] [<CommonParameters>]
26+
[-ClientTimeout <Double>] [<CommonParameters>]
2727
```
2828

2929
### IdentityParameterSet
3030
```
3131
Connect-MgGraph [[-ClientId] <String>] [-ContextScope <ContextScope>] [-Environment <String>]
32-
[-ClientTimeout <Double>] [-Identity] [-NoWelcome] [-Break] [<CommonParameters>]
32+
[-ClientTimeout <Double>] [-Identity] [<CommonParameters>]
3333
```
3434

3535
### AppSecretCredentialParameterSet
3636
```
3737
Connect-MgGraph [-ClientSecretCredential <PSCredential>] [-TenantId <String>] [-ContextScope <ContextScope>]
38-
[-Environment <String>] [-ClientTimeout <Double>] [-NoWelcome] [-Break] [<CommonParameters>]
38+
[-Environment <String>] [-ClientTimeout <Double>] [<CommonParameters>]
3939
```
4040

4141
### AccessTokenParameterSet
4242
```
43-
Connect-MgGraph [-AccessToken] <SecureString> [-Environment <String>] [-ClientTimeout <Double>] [-NoWelcome]
44-
[-Break] [<CommonParameters>]
43+
Connect-MgGraph [-AccessToken] <SecureString> [-Environment <String>] [-ClientTimeout <Double>]
44+
[<CommonParameters>]
4545
```
4646

4747
### EnvironmentVariableParameterSet
4848
```
4949
Connect-MgGraph [-ContextScope <ContextScope>] [-Environment <String>] [-ClientTimeout <Double>]
50-
[-EnvironmentVariable] [-NoWelcome] [-Break] [<CommonParameters>]
50+
[-EnvironmentVariable] [<CommonParameters>]
5151
```
5252

5353
## DESCRIPTION
54-
{{ Fill in the Description }}
54+
You must invoke Connect-MgGraph before any commands that access Microsoft Graph. This cmdlet gets the access token using the Microsoft Authentication Library
5555

5656
## EXAMPLES
5757

58-
### Example 1
58+
### Example 1: Delegated access: Using interactive authentication, where you provide the scopes that you require during your session
59+
```powershell
60+
PS C:\> Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All"
61+
```
62+
63+
This example shows how to authenticate to graph with scopes.
64+
65+
### Example 2: Delegated access: Using device code flow
66+
```powershell
67+
PS C:\> Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All" -UseDeviceAuthentication
68+
```
69+
70+
This example shows how to authenticate to graph with scopes and device.
71+
72+
### Example 3: Delegated access: Using your own access token
73+
```powershell
74+
PS C:\> Connect-MgGraph -AccessToken $AccessToken
75+
```
76+
77+
This example shows how to authenticate to graph using an access token.
78+
79+
### Example 4: Delegated access: custom application for Microsoft Graph PowerShell
80+
```powershell
81+
PS C:\> Connect-MgGraph -ClientId <YOUR_NEW_APP_ID> -TenantId <YOUR_TENANT_ID>
82+
```
83+
84+
Follow this [link](https://learn.microsoft.com/en-us/powershell/microsoftgraph/authentication-commands?view=graph-powershell-1.0#using-connect-mggraph) for more information on the steps for creating custom applications.
85+
86+
### Example 5: App-only access: Using client credential with a certificate - Certificate Thumbprint
87+
```powershell
88+
PS C:\> Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateThumbprint "YOUR_CERT_THUMBPRINT"
89+
```
90+
91+
Follow this [link](https://learn.microsoft.com/en-us/powershell/microsoftgraph/authentication-commands?view=graph-powershell-1.0#using-connect-mggraph) for more information on how to load the certificate.
92+
93+
### Example 6: App-only access: Using client credential with a certificate - Certificate name
94+
```powershell
95+
PS C:\> Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateName "YOUR_CERT_SUBJECT"
96+
```
97+
98+
Follow this [link](https://learn.microsoft.com/en-us/powershell/microsoftgraph/authentication-commands?view=graph-powershell-1.0#using-connect-mggraph) for more information on how to load the certificate.
99+
100+
### Example 7: App-only access: Using client credential with a certificate - Certificate
101+
```powershell
102+
PS C:\> $Cert = Get-ChildItem Cert:\LocalMachine\My\$CertThumbprint
103+
PS C:\> Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -Certificate $Cert
104+
```
105+
106+
Follow this [link](https://learn.microsoft.com/en-us/powershell/microsoftgraph/authentication-commands?view=graph-powershell-1.0#using-connect-mggraph) for more information on how to load the certificate.
107+
108+
### Example 8: Using client secret credentials
59109
```powershell
60-
PS C:\> {{ Add example code here }}
110+
PS C:\> $ClientSecretCredential = Get-Credential -Credential "Client_Id"
111+
# Enter client_secret in the password prompt.
112+
PS C:\> Connect-MgGraph -TenantId "Tenant_Id" -ClientSecretCredential $ClientSecretCredential
61113
```
62114

63-
{{ Add example description here }}
115+
This authentication method is ideal for background interactions. It does not require a user to physically sign in.
116+
117+
### Example 9: Using managed identity: System-assigned managed identity
118+
```powershell
119+
PS C:\> Connect-MgGraph -Identity
120+
```
121+
122+
Uses an automatically managed identity on a service instance. The identity is tied to the lifecycle of a service instance.
123+
124+
### Example 10: Using managed identity: User-assigned managed identity
125+
```powershell
126+
PS C:\> Connect-MgGraph -Identity -ClientId "User_Assigned_Managed_identity_Client_Id"
127+
```
128+
129+
Uses a user created managed identity as a standalone Azure resource.
130+
131+
### Example 11: Connecting to an environment or cloud
132+
```powershell
133+
PS C:\> Get-MgEnvironment
134+
Name AzureADEndpoint GraphEndpoint Type
135+
---- --------------- ------------- ----
136+
China https://login.chinacloudapi.cn https://microsoftgraph.chinacloudapi.cn Built-in
137+
Global https://login.microsoftonline.com https://graph.microsoft.com Built-in
138+
USGov https://login.microsoftonline.us https://graph.microsoft.us Built-in
139+
USGovDoD https://login.microsoftonline.us https://dod-graph.microsoft.us Built-in
140+
PS C:\> Connect-MgGraph -Environment USGov
141+
```
142+
143+
When you use Connect-MgGraph, you can choose to target other environments. By default, Connect-MgGraph targets the global public cloud.
144+
145+
### Example 12: Connecting to an environment as a different identity
146+
```powershell
147+
PS C:\> Connect-MgGraph -ContextScope Process
148+
```
149+
150+
To connect as a different identity other than CurrentUser, specify the -ContextScope parameter with the value Process.
64151

65152
## PARAMETERS
66153

@@ -80,21 +167,6 @@ Accept pipeline input: False
80167
Accept wildcard characters: False
81168
```
82169
83-
### -Break
84-
Wait for .NET debugger to attach
85-
86-
```yaml
87-
Type: SwitchParameter
88-
Parameter Sets: (All)
89-
Aliases:
90-
91-
Required: False
92-
Position: Named
93-
Default value: None
94-
Accept pipeline input: False
95-
Accept wildcard characters: False
96-
```
97-
98170
### -Certificate
99171
An X.509 certificate supplied during invocation.
100172
@@ -264,21 +336,6 @@ Accept pipeline input: False
264336
Accept wildcard characters: False
265337
```
266338
267-
### -NoWelcome
268-
Hides the welcome message.
269-
270-
```yaml
271-
Type: SwitchParameter
272-
Parameter Sets: (All)
273-
Aliases:
274-
275-
Required: False
276-
Position: Named
277-
Default value: None
278-
Accept pipeline input: False
279-
Accept wildcard characters: False
280-
```
281-
282339
### -Scopes
283340
An array of delegated permissions to consent to.
284341

0 commit comments

Comments
 (0)