Skip to content

Commit 9cd4853

Browse files
peombwagithub-actions[bot]Microsoft Graph DevX Toolingmsewawerufinsharp
authored
1.9.0 Release (#933)
* Prepopulate User-Agent header. (#928) * Commands Clean-up (#927) * Clean-up planner commmands. * Clean-up commands in DeviceManagement.Enrolment module. * Weekly OpenApiDocs Download (#932) * Weekly OpenApiDocs Download * Bump SDK version * Bump SDK version * [run ci] Co-authored-by: Microsoft Graph DevX Tooling <[email protected]> Co-authored-by: Peter Ombwa <[email protected]> * Added examples for the cmdlets (#904) * Added examples for the cmdlets * Added more examples * Added examples for the cmdlets * Added permissions and minor edits Co-authored-by: Peter Ombwa <[email protected]> * Authentication Bug Fixes (#934) * Fallback to process scope when on WSL. * Ensure directory exists before opening a file. * Default to process scope on WSL. * Readme Update (#924) * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Add generation guide. * Update readme and contributing.md * Update SDK generation link. * Remove duplicate docs. * Merge branch 'bugFixes/WSLAuthentication' of https://github.com/microsoftgraph/msgraph-sdk-powershell into bugFixes/WSLAuthentication * Remove Powershell ISE from known issues. * Update code highlight * Add Timothy to codeowners. * Add directive to ensure we serialize DictionaryEntry types. (#942) * Weekly OpenApiDocs Download (#943) * Weekly OpenApiDocs Download * [run ci] Bump version number. Co-authored-by: Microsoft Graph DevX Tooling <[email protected]> Co-authored-by: Peter Ombwa <[email protected]> Co-authored-by: Peter Ombwa <[email protected]> * Update autorest local version. (#945) Update Autorest local version reference. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Microsoft Graph DevX Tooling <[email protected]> Co-authored-by: Eunice Waweru <[email protected]> Co-authored-by: finsharp <[email protected]>
1 parent 4b9ddf4 commit 9cd4853

File tree

173 files changed

+42974
-25155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+42974
-25155
lines changed

.azure-pipelines/generation-templates/generate-service-modules.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ parameters:
3232
jobs:
3333
- job: GenerateServiceModules
3434
displayName: Service module generation
35-
timeoutInMinutes: 360
35+
timeoutInMinutes: 600
3636
condition: and(succeeded(), ne(stageDependencies.DownloadOpenAPIDocs.GetLatestDocs.outputs['OpenAPIDocDiff.ModulesWithChanges'], ''))
3737
variables:
3838
Branch: ${{ parameters.Branch }}

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @peombwa @ddyett @georgend @shemogumbe
1+
* @peombwa @ddyett @georgend @shemogumbe @timayabi2020

CONTRIBUTING.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@ When contributing to this repository, please first open an an issue describing t
55
There are a few different recommended paths to get contributions into the released version of this SDK.
66

77
## Filing Issues
8+
89
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.
910

1011
## 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.
1618

1719
## Modifying Existing Cmdlets
20+
1821
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+
1923
- Identify cmdlets you want to modify, and the modules they reside in.
2024
- In the module’s `readme.md`, add your directive in the AutoREST configuration sections to modify the lower-level cmdlets.
2125

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.

README.md

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Microsoft Graph PowerShell SDK
2+
23
The Microsoft Graph PowerShell SDK is a collection of PowerShell modules that contain commands for calling Microsoft Graph service.
34

4-
# Modules
5+
## Modules
6+
57
The table below contains our Microsoft Graph rollup module. This module installs all the service modules as its dependencies.
68
Description | Module Name | PowerShell Gallery Link
79
----------------- | ----------------- | ------------------------
@@ -10,97 +12,130 @@ Microsoft Graph | `Microsoft.Graph` | [![Mg]][MgGallery]
1012
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.
1113

1214
## Installation
15+
1316
### PowerShell Gallery
1417

1518
All the modules are published on [PowerShell Gallery](https://www.powershellgallery.com/packages/Microsoft.Graph). Installing is as simple as:
1619

17-
```ps
20+
``` powershell
1821
Install-Module Microsoft.Graph
1922
```
2023

2124
If you are upgrading from our preview modules, run `Install-Module` with AllowClobber and Force parameters to avoid command name conflicts:
22-
```ps
25+
26+
``` powershell
2327
Install-Module Microsoft.Graph -AllowClobber -Force
2428
```
29+
2530
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.
2631

2732
## Usage
2833

2934
1. Authentication
30-
31-
The SDK supports two types of authentication: delegated access, and app-only access.
32-
- Delegated access via Device Code Flow.
3335

34-
```ps
36+
The SDK supports two types of authentication: delegated access and app-only access.
37+
- Delegated access.
38+
39+
``` powershell
40+
# Using interactive authentication.
3541
Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All"
3642
```
3743
44+
or
45+
46+
``` powershell
47+
# Using device code flow.
48+
Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All" -UseDeviceAuthentication
49+
```
50+
51+
or
52+
53+
``` powershell
54+
# Using your own access token.
55+
Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All" -AccessToken $AccessToken
56+
```
57+
3858
- App-only access via Client Credential with a certificate.
3959
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`.
4361
44-
```ps
62+
``` powershell
4563
# Using -CertificateThumbprint
4664
Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateThumbprint "YOUR_CERT_THUMBPRINT"
4765
```
4866
4967
or
5068
51-
```ps
69+
``` powershell
5270
# Using -CertificateName
5371
Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateName "YOUR_CERT_SUBJECT"
5472
```
5573
74+
or
75+
76+
``` powershell
77+
# Using -Certificate
78+
$Cert = Get-ChildItem Cert:\LocalMachine\My\$CertThumbprint
79+
Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -Certificate $Cert
80+
```
81+
5682
2. List users in your tenant.
5783
58-
```ps
84+
``` powershell
5985
Get-MgUser -Top 10 -Property Id, DisplayName, BusinessPhones | Format-Table Id, DisplayName, BusinessPhones
6086
```
6187
6288
3. Filter a user in your tenant.
6389
64-
```ps
90+
``` powershell
6591
$user = Get-MgUser -Filter "displayName eq 'Megan Bowen'"
6692
```
6793
6894
4. Create a new app registration.
6995
70-
```ps
96+
``` powershell
7197
New-MgApplication -DisplayName "ScriptedGraphPSApp" `
7298
-SignInAudience "AzureADMyOrg" `
7399
-Web @{ RedirectUris = "https://localhost"}
74100
```
75101
76102
5. Sign out of the current logged-in context i.e. app only or delegated access.
77103
78-
```ps
104+
``` powershell
79105
Disconnect-MgGraph
80106
```
107+
81108
## API Version
109+
82110
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.
83111
84-
```ps
112+
``` powershell
85113
Select-MgProfile -Name "beta"
86114
```
87115

88116
## Troubleshooting Permission Related Errors
89117

90118
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.
91119

92-
If permission related 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.
93121

94122
- You can try running `Disconnect-MgGraph`, then `Connect-MgGraph`. Then, run the code that encountered the permission issues to see if it works.
95123
- 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.
96124

97125
## 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.
99133

100134
## Issues
101-
If you find any bugs when using the Microsoft Graph PowerShell modules, please file an issue in our GitHub issues page.
102135

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 [[email protected]](mailto:[email protected]) 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 [[email protected]](mailto:[email protected]) with any additional questions or comments.
104139

105140
## License
106141

config/ModuleMetadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
],
2323
"releaseNotes": "See https://aka.ms/GraphPowerShell-Release.",
2424
"assemblyOriginatorKeyFile": "35MSSharedLib1024.snk",
25-
"version": "1.8.0"
25+
"version": "1.9.0"
2626
}

config/ModulesMapping.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"SchemaExtensions": "^schemaExtensions\\.",
3131
"Search": "^search\\.|^external\\.",
3232
"Security": "^security\\.",
33-
"Sites": "^sites.site$|^sites.itemAnalytics$|^sites.columnDefinition$|^sites.contentType$|^sites.drive$|^sites.list$|^sites.sitePage$|^sites.permission$|^users.site$|^groups.site$|^sites.Functions$|^sites.Actions$",
33+
"Sites": "^sites.site$|^sites.itemAnalytics$|^sites.columnDefinition$|^sites.contentType$|^sites.drive$|^sites.list$|^sites.sitePage$|^sites.permission$|^sites.store$|^users.site$|^groups.site$|^sites.Functions$|^sites.Actions$",
3434
"Teams": "^teams\\.|^chats\\.|^users.chat$|^appCatalogs.teamsApp$|^users.userTeamwork$|^teamwork\\.|^users.team$|^groups.team$",
3535
"Users": "^users.user$|^users.directoryObject$|^users.licenseDetails$|^users.notification$|^users.outlookUser$|^users.profilePhoto$|^users.userSettings$|^users.extension$|^users.oAuth2PermissionGrant$|^users.todo$",
3636
"Users.Actions": "^users.Actions$",
66.2 KB
Loading

openApiDocs/beta/Applications.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12905,6 +12905,8 @@ paths:
1290512905
- appRoleAssignmentRequired desc
1290612906
- appRoles
1290712907
- appRoles desc
12908+
- customSecurityAttributes
12909+
- customSecurityAttributes desc
1290812910
- description
1290912911
- description desc
1291012912
- disabledByMicrosoftStatus
@@ -12979,6 +12981,7 @@ paths:
1297912981
- appOwnerOrganizationId
1298012982
- appRoleAssignmentRequired
1298112983
- appRoles
12984+
- customSecurityAttributes
1298212985
- description
1298312986
- disabledByMicrosoftStatus
1298412987
- displayName
@@ -13144,6 +13147,7 @@ paths:
1314413147
- appOwnerOrganizationId
1314513148
- appRoleAssignmentRequired
1314613149
- appRoles
13150+
- customSecurityAttributes
1314713151
- description
1314813152
- disabledByMicrosoftStatus
1314913153
- displayName
@@ -19811,7 +19815,7 @@ components:
1981119815
createdDateTime:
1981219816
pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$'
1981319817
type: string
19814-
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.'
1981519819
format: date-time
1981619820
nullable: true
1981719821
defaultRedirectUri:
@@ -19828,7 +19832,7 @@ components:
1982819832
nullable: true
1982919833
displayName:
1983019834
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.'
1983219836
nullable: true
1983319837
groupMembershipClaims:
1983419838
type: string
@@ -19838,7 +19842,7 @@ components:
1983819842
type: array
1983919843
items:
1984019844
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).'
1984219846
info:
1984319847
$ref: '#/components/schemas/microsoft.graph.informationalUrl'
1984419848
isDeviceOnlyAuthSupported:
@@ -20745,6 +20749,8 @@ components:
2074520749
items:
2074620750
$ref: '#/components/schemas/microsoft.graph.appRole'
2074720751
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.
20752+
customSecurityAttributes:
20753+
$ref: '#/components/schemas/microsoft.graph.customSecurityAttributeValue'
2074820754
description:
2074920755
type: string
2075020756
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:
2075520761
nullable: true
2075620762
displayName:
2075720763
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.'
2075920765
nullable: true
2076020766
errorUrl:
2076120767
type: string
@@ -21904,6 +21910,11 @@ components:
2190421910
type: string
2190521911
additionalProperties:
2190621912
type: object
21913+
microsoft.graph.customSecurityAttributeValue:
21914+
title: customSecurityAttributeValue
21915+
type: object
21916+
additionalProperties:
21917+
type: object
2190721918
microsoft.graph.permissionScope:
2190821919
title: permissionScope
2190921920
type: object

0 commit comments

Comments
 (0)