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: CONTRIBUTING.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,24 @@ When contributing to this repository, please first open an an issue describing t
5
5
There are a few different recommended paths to get contributions into the released version of this SDK.
6
6
7
7
## Filing Issues
8
+
8
9
The best way to get started with a contribution is to start a dialog with us. Sometimes features will be under development or out of scope for this SDK and it's best to check before starting work on contribution, especially for large work items.
9
10
10
11
## Adding Scenario-Based Cmdlets
11
-
- Clone the repo - https://github.com/microsoftgraph/msgraph-sdk-powershell.git.
12
-
- Identify the module(s) that you want add the custom cmdlets to. E.g. [Groups.DirectoryObject](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/dev/src/Beta/Groups.DirectoryObject/Groups.DirectoryObject).
13
-
- Navigate to the module’s custom folder. E.g. [Groups.DirectoryObject/custom](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/dev/src/Beta/Groups.DirectoryObject/Groups.DirectoryObject/custom). In here, you will find a readme.md that has basic instructions on how to add custom cmdlets. A full guide can be found [here](https://github.com/Azure/autorest/blob/master/docs/powershell/customization.md#creating-a-new-cmdlet).
14
-
- In the custom directory, add your custom cmdlet naming the file as `{Verb}Mg{Subject}_{Variant}.(cs|ps)`. This file will contain the implementation of your custom cmdlet. You can refer to [NewMgGroupMember_Create.cs](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/src/Beta/Groups.DirectoryObject/Groups.DirectoryObject/custom/NewMgGroupMember_Create.cs) as an example.
15
-
- Once done, bump up the module version number in the module’s root [readme.md](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/src/Beta/Groups.DirectoryObject/Groups.DirectoryObject/readme.md#versioning) then run `.\msgraph-sdk-powershell\tools\GenerateModules.ps1 -BetaGraphVersion -RepositoryApiKey *** -Pack -Build` to create, build and export the cmdlets to `..\exports` folder.
12
+
13
+
- Clone the repo - <https://github.com/microsoftgraph/msgraph-sdk-powershell.git>.
14
+
- Identify the module(s) that you want add the custom cmdlets to. E.g. [Groups](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/dev/src/Groups/Groups).
15
+
- Navigate to the module’s custom folder. E.g. [Groups/custom](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/dev/src/Groups/Groups/custom). In here, you will find a readme.md that has basic instructions on how to add custom cmdlets. A full guide can be found [here](https://github.com/Azure/autorest/blob/master/docs/powershell/customization.md#creating-a-new-cmdlet).
16
+
- In the custom directory, add your custom cmdlet naming the file as `{Verb}Mg{Subject}_{Variant}.(cs|ps)`. This file will contain the implementation of your custom cmdlet. You can refer to [NewMgGroupMember_Create.cs](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/src/Groups/Groups/custom/NewMgGroupMember_Create.cs) as an example.
17
+
- Once done, bump up the module version number in the module’s root [readme.md](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/src/Groups/Groups/readme.md#versioning) then run `.\msgraph-sdk-powershell\tools\GenerateModules.ps1 -Build` to create, build and export the cmdlets to `..\exports` folder.
16
18
17
19
## Modifying Existing Cmdlets
20
+
18
21
When it comes to modifying existing cmdlets, we recommend you use [AutoREST directive](https://github.com/Azure/autorest.powershell/blob/master/docs/directives.md#cmdlet-hiding-exportation-suppression).
22
+
19
23
- Identify cmdlets you want to modify, and the modules they reside in.
20
24
- In the module’s `readme.md`, add your directive in the AutoREST configuration sections to modify the lower-level cmdlets.
21
25
22
-
26
+
## SDK generation
27
+
28
+
See our [SDK generation steps wiki](https://github.com/microsoftgraph/msgraph-sdk-powershell/wiki/Generation-Process) for more information.
@@ -10,97 +12,130 @@ Microsoft Graph | `Microsoft.Graph` | [![Mg]][MgGallery]
10
12
For a list of modules found in this repository, see the [Microsoft Graph PowerShell modules](https://github.com/microsoftgraph/msgraph-sdk-powershell/wiki/MS-Graph-PowerShell-Modules) document.
11
13
12
14
## Installation
15
+
13
16
### PowerShell Gallery
14
17
15
18
All the modules are published on [PowerShell Gallery](https://www.powershellgallery.com/packages/Microsoft.Graph). Installing is as simple as:
16
19
17
-
```ps
20
+
```powershell
18
21
Install-Module Microsoft.Graph
19
22
```
20
23
21
24
If you are upgrading from our preview modules, run `Install-Module` with AllowClobber and Force parameters to avoid command name conflicts:
There is a set of samples in the `samples` folder to help in getting started with the library. If you have an older version of these modules installed, there are extra uninstall instructions in the [InstallModule](./samples/0-InstallModule.ps1) script.
26
31
27
32
## Usage
28
33
29
34
1. Authentication
30
-
31
-
The SDK supports two types of authentication: delegated access, and app-only access.
32
-
- Delegated access via Device Code Flow.
33
35
34
-
```ps
36
+
The SDK supports two types of authentication: delegated access and app-only access.
- App-only access via Client Credential with a certificate.
39
59
40
-
The certificate will be loaded from `Cert:\CurrentUser\My\` store. Ensure the certificate is present in the store before calling `Connect-MgGraph`.
41
-
42
-
You can pass either `-CertificateThumbprint` or `-CertificateName` to `Connect-MgGraph`.
60
+
The certificate will be loaded from `Cert:\CurrentUser\My\` store when `-CertificateThumbprint` or `-CertificateName` is specified. Ensure the certificate is present in the store before calling `Connect-MgGraph`.
5. Sign out of the current logged-in context i.e. app only or delegated access.
77
103
78
-
```ps
104
+
``` powershell
79
105
Disconnect-MgGraph
80
106
```
107
+
81
108
## API Version
109
+
82
110
By default, the SDK uses the Microsoft Graph REST API v1.0. You can change this by using the `Select-MgProfile` command. This reloads all modules and only loads commands that call beta endpoint.
83
111
84
-
```ps
112
+
``` powershell
85
113
Select-MgProfile -Name "beta"
86
114
```
87
115
88
116
## Troubleshooting Permission Related Errors
89
117
90
118
When working with various operations in the Graph, you may encounter an error such as "Insufficient privileges to complete the operation." For example, this particular error can occur when using the `New-MgApplication` command if the appropriate permissions are not granted.
91
119
92
-
If permissionrelated errors occur and the user you authenticated with in the popup has the appropriate permissions to perform the operation try these steps.
120
+
If permission-related errors occur and the user you authenticated within the popup has the appropriate permissions to perform the operation try these steps.
93
121
94
122
- You can try running `Disconnect-MgGraph`, then `Connect-MgGraph`. Then, run the code that encountered the permission issues to see if it works.
95
123
- You can try running `Connect-MgGraph -ForceRefresh`. This will trigger a refresh of the access token in your cache. MSAL will only refresh the access token in your cache if it has expired (usually an hour), or if you explicitly refresh it via `-ForceRefresh`. Then, run the code that encountered the permission issues to see if it works.
96
124
97
125
## Known Issues
98
-
- If you attempt to run `Connect-Graph` from the PowerShell ISE (integrated scripting environment) the command fails with an error "Device code terminal timed-out after {X} seconds". This is a known issue and it is recommended to use a PowerShell host other than the ISE.
126
+
127
+
- Using `-Property {PropertyName}` parameter will not select the property as the output of the command. All commands return CLR objects, and customers should pipe the command outputs to `Format-Table` or `Select-Object` to return individual properties.
128
+
129
+
- Customers upgrading from previous versions of the SDK may encounter auth prompts on every command call. If this happens, one can use the following steps to reset their token cache:
130
+
- Use `Disconnect-MgGraph` to sign out of the current session.
131
+
- Run `Remove-Item "$env:USERPROFILE\.graph" -Recurse -Force` to delete your token cache.
132
+
- Run `Connect-MgGraph` to reconstruct a clean token cache.
99
133
100
134
## Issues
101
-
If you find any bugs when using the Microsoft Graph PowerShell modules, please file an issue in our GitHub issues page.
102
135
103
-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
136
+
If you find any bugs when using the Microsoft Graph PowerShell modules, please file an issue on our GitHub issues page.
137
+
138
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
description: 'The date and time the application was registered. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. Supports $filter (eq, ne, NOT, ge, le, in) and $orderBy.'
19818
+
description: 'The date and time the application was registered. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. Supports $filter (eq, ne, NOT, ge, le, in, and eq on null values) and $orderBy.'
19815
19819
format: date-time
19816
19820
nullable: true
19817
19821
defaultRedirectUri:
@@ -19828,7 +19832,7 @@ components:
19828
19832
nullable: true
19829
19833
displayName:
19830
19834
type: string
19831
-
description: 'The display name for the application. Supports $filter (eq, ne, NOT, ge, le, in, startsWith), $search, and $orderBy.'
19835
+
description: 'The display name for the application. Supports $filter (eq, ne, NOT, ge, le, in, startsWith, and eq on null values), $search, and $orderBy.'
19832
19836
nullable: true
19833
19837
groupMembershipClaims:
19834
19838
type: string
@@ -19838,7 +19842,7 @@ components:
19838
19842
type: array
19839
19843
items:
19840
19844
type: string
19841
-
description: 'The URIs that identify the application within its Azure AD tenant, or within a verified custom domain if the application is multi-tenant. For more information see Application Objects and Service Principal Objects. The any operator is required for filter expressions on multi-valued properties. Not nullable. Supports $filter (eq, ne, ge, le, startsWith).'
19845
+
description: 'Also known as App ID URI, this value is set when an application is used as a resource app. The identifierUris acts as the prefix for the scopes you''ll reference in your API''s code, and it must be globally unique. You can use the default value provided, which is in the form api://<application-client-id>, or specify a more readable URI like https://contoso.com/api. For more information on valid identifierUris patterns and best practices, see Azure AD application registration security best practices. Not nullable. Supports $filter (eq, ne, ge, le, startsWith).'
description: The roles exposed by the application which this service principal represents. For more information see the appRoles property definition on the application entity. Not nullable.
description: 'Free text field to provide an internal end-user facing description of the service principal. End-user portals such MyApps will display the application description in this field. The maximum allowed size is 1024 characters. Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search.'
@@ -20755,7 +20761,7 @@ components:
20755
20761
nullable: true
20756
20762
displayName:
20757
20763
type: string
20758
-
description: 'The display name for the service principal. Supports $filter (eq, ne, NOT, ge, le, in, startsWith), $search, and $orderBy.'
20764
+
description: 'The display name for the service principal. Supports $filter (eq, ne, NOT, ge, le, in, startsWith, and eq on null values), $search, and $orderBy.'
0 commit comments