Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/ModuleMetadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"guid": "fceec1eb-c2e8-4b2b-a120-0fab3f0d7b47",
"authors": "Microsoft",
"owners": "Microsoft",
"description": "Microsoft Graph PowerShell module",
Expand Down
42 changes: 0 additions & 42 deletions src/Applications/Applications/test/Applications.Tests.ps1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
# ------------------------------------------------------------------------------
Describe "Microsoft.Graph.Applications Module" {
BeforeAll {
$ModuleName = "Microsoft.Graph.Applications"
$ModulePath = Join-Path $PSScriptRoot "..\$ModuleName.psd1"
$PSModuleInfo = Get-Module $ModuleName
}

Context "On module import" {
It "Should have exported commands" {
$PSModuleInfo | Should -Not -Be $null
$PSModuleInfo.ExportedCommands.Count | Should -Not -Be 0
}

It 'Should be compatible with PS core and desktop' {
$PSModuleInfo.CompatiblePSEditions | Should -BeIn @("Core", "Desktop")
}

It 'Should point to script module' {
$PSModuleInfo.Path | Should -BeLikeExactly "*$ModuleName.psm1"
}

It 'Should have a definition' {
$PSModuleInfo.Definition | Should -Not -BeNullOrEmpty
}

It 'Should lock GUID' {
$PSModuleInfo.Guid.Guid | Should -Be "467f54f2-44a8-4993-8e75-b96c3e443098"
}

It "Module import should not write to streams when debug preference is not set" {
$ps = [powershell]::Create()
$ps.AddScript("Import-Module $ModulePath -ErrorAction SilentlyContinue").Invoke()

$ps.Streams.Information.Count | Should -Be 0
$ps.Streams.Debug.Count | Should -Be 0
$ps.Streams.Error.Count | Should -Be 0
$ps.Streams.Verbose.Count | Should -Be 0
$ps.Streams.Warning.Count | Should -Be 0
$ps.Streams.Progress.Count | Should -Be 0

$ps.Dispose()
}

It "Module import should write to streams when debug preference is set" {
$ps = [powershell]::Create()
$ps.AddScript("`$DebugPreference = 'Inquire'; Import-Module $ModulePath -ErrorAction SilentlyContinue").Invoke()

$ps.Streams.Information.Count | Should -Be 0
$ps.Streams.Debug.Count | Should -Be 0
$ps.Streams.Error.Count | Should -Be 0
$ps.Streams.Verbose.Count | Should -Be 0
$ps.Streams.Warning.Count | Should -Be 0
$ps.Streams.Progress.Count | Should -Be 0

$ps.Dispose()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,9 @@ Describe "Microsoft.Graph.Authentication module" {
$PSModuleInfo.ExportedAliases.Keys | Should -BeIn $ExpectedAliases
} | Should -Not -Throw
}

It 'Should lock GUID' {
$PSModuleInfo.Guid.Guid | Should -Be "883916f2-9184-46ee-b1f8-b6a2fb784cee"
}
}
}
4 changes: 3 additions & 1 deletion src/Authentication/Authentication/test/loadEnv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) {
}
$env = @{}
if (Test-Path -Path $envFilePath) {
# Load dummy auth configuration.
# Load dummy auth configuration. This is used to run Pester tests.
$env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json -AsHashTable
[Microsoft.Graph.PowerShell.Authentication.GraphSession]::Instance.AuthContext = New-Object Microsoft.Graph.PowerShell.Authentication.AuthContext -Property @{
ClientId = $env.ClientId
TenantId = $env.TenantId
AuthType = [Microsoft.Graph.PowerShell.Authentication.AuthenticationType]::UserProvidedAccessToken
AuthProviderType = [Microsoft.Graph.PowerShell.Authentication.AuthProviderType]::UserProvidedToken
}
}
46 changes: 42 additions & 4 deletions src/Graph/Graph/Microsoft.Graph.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,56 @@
<package>
<metadata>
<id>Microsoft.Graph</id>
<version>0.9.2</version>
<version>1.10.0</version>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>https://aka.ms/devservicesagreement</licenseUrl>
<projectUrl>https://github.com/microsoftgraph/msgraph-sdk-powershell</projectUrl>
<iconUrl>https://raw.githubusercontent.com/microsoftgraph/g-raph/master/g-raph.png</iconUrl>
<iconUrl>https://raw.githubusercontent.com/microsoftgraph/msgraph-sdk-powershell/master/documentation/images/graph_color256.png</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Microsoft Graph PowerShell module</description>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>MicrosoftGraph;Microsoft;Office365;Graph;PowerShell;GraphServiceClient;Outlook;OneDrive;AzureAD;GraphAPI;Productivity;SharePoint;Intune;SDK;</tags>
<tags>MicrosoftGraph Microsoft Office365 Graph PowerShell Outlook OneDrive AzureAD SharePoint Intune AzureAutomationNotSupported</tags>
<dependencies>
<dependency id="Microsoft.Graph.Authentication" version="0.9.1" />
<dependency id="Microsoft.Graph.Authentication" version="1.10.0" />
<dependency id="Microsoft.Graph.Calendar" version="1.10.0" />
<dependency id="Microsoft.Graph.DeviceManagement.Functions" version="1.10.0" />
<dependency id="Microsoft.Graph.Identity.Governance" version="1.10.0" />
<dependency id="Microsoft.Graph.ChangeNotifications" version="1.10.0" />
<dependency id="Microsoft.Graph.Users.Actions" version="1.10.0" />
<dependency id="Microsoft.Graph.SchemaExtensions" version="1.10.0" />
<dependency id="Microsoft.Graph.DeviceManagement.Enrolment" version="1.10.0" />
<dependency id="Microsoft.Graph.Bookings" version="1.10.0" />
<dependency id="Microsoft.Graph.Devices.CorporateManagement" version="1.10.0" />
<dependency id="Microsoft.Graph.Devices.ServiceAnnouncement" version="1.10.0" />
<dependency id="Microsoft.Graph.Users.Functions" version="1.10.0" />
<dependency id="Microsoft.Graph.Education" version="1.10.0" />
<dependency id="Microsoft.Graph.Notes" version="1.10.0" />
<dependency id="Microsoft.Graph.DirectoryObjects" version="1.10.0" />
<dependency id="Microsoft.Graph.Applications" version="1.10.0" />
<dependency id="Microsoft.Graph.People" version="1.10.0" />
<dependency id="Microsoft.Graph.Groups" version="1.10.0" />
<dependency id="Microsoft.Graph.CrossDeviceExperiences" version="1.10.0" />
<dependency id="Microsoft.Graph.Reports" version="1.10.0" />
<dependency id="Microsoft.Graph.Users" version="1.10.0" />
<dependency id="Microsoft.Graph.Search" version="1.10.0" />
<dependency id="Microsoft.Graph.Teams" version="1.10.0" />
<dependency id="Microsoft.Graph.Identity.SignIns" version="1.10.0" />
<dependency id="Microsoft.Graph.Files" version="1.10.0" />
<dependency id="Microsoft.Graph.WindowsUpdates" version="1.10.0" />
<dependency id="Microsoft.Graph.Compliance" version="1.10.0" />
<dependency id="Microsoft.Graph.DeviceManagement" version="1.10.0" />
<dependency id="Microsoft.Graph.DeviceManagement.Actions" version="1.10.0" />
<dependency id="Microsoft.Graph.Planner" version="1.10.0" />
<dependency id="Microsoft.Graph.Identity.DirectoryManagement" version="1.10.0" />
<dependency id="Microsoft.Graph.PersonalContacts" version="1.10.0" />
<dependency id="Microsoft.Graph.Financials" version="1.10.0" />
<dependency id="Microsoft.Graph.DeviceManagement.Administration" version="1.10.0" />
<dependency id="Microsoft.Graph.Mail" version="1.10.0" />
<dependency id="Microsoft.Graph.Sites" version="1.10.0" />
<dependency id="Microsoft.Graph.Security" version="1.10.0" />
<dependency id="Microsoft.Graph.CloudCommunications" version="1.10.0" />
<dependency id="Microsoft.Graph.Devices.CloudPrint" version="1.10.0" />
</dependencies>
<releaseNotes>See https://aka.ms/GraphPowerShell-Release.</releaseNotes>
</metadata>
Expand Down
46 changes: 42 additions & 4 deletions src/Graph/Graph/Microsoft.Graph.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Microsoft
#
# Generated on: 11/18/2020
# Generated on: 6/29/2022
#

@{
Expand All @@ -12,13 +12,13 @@
# RootModule = ''

# Version number of this module.
ModuleVersion = '1.1.0'
ModuleVersion = '1.10.0'

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

# ID used to uniquely identify this module
GUID = 'ba3e9757-d74f-45ea-9d0f-0287d0d45b9a'
GUID = 'fceec1eb-c2e8-4b2b-a120-0fab3f0d7b47'

# Author of this module
Author = 'Microsoft'
Expand Down Expand Up @@ -51,7 +51,45 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'Microsoft.Graph.Authentication'; ModuleVersion = '0.9.1'; })
RequiredModules = @(@{ModuleName = 'Microsoft.Graph.Authentication'; ModuleVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Calendar'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.DeviceManagement.Functions'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Identity.Governance'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.ChangeNotifications'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Users.Actions'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.SchemaExtensions'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.DeviceManagement.Enrolment'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Bookings'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Devices.CorporateManagement'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Devices.ServiceAnnouncement'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Users.Functions'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Education'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Notes'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.DirectoryObjects'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Applications'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.People'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Groups'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.CrossDeviceExperiences'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Reports'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Users'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Search'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Teams'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Identity.SignIns'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Files'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.WindowsUpdates'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Compliance'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.DeviceManagement'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.DeviceManagement.Actions'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Planner'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Identity.DirectoryManagement'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.PersonalContacts'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Financials'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.DeviceManagement.Administration'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Mail'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Sites'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Security'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.CloudCommunications'; RequiredVersion = '1.10.0'; },
@{ModuleName = 'Microsoft.Graph.Devices.CloudPrint'; RequiredVersion = '1.10.0'; })

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
# ------------------------------------------------------------------------------

Describe "Microsoft.Graph.Identity.SignIns module" {
BeforeAll {
$ModuleName = "Microsoft.Graph.Identity.SignIns"
$PSModuleInfo = Get-Module $ModuleName
}

Context "On module import" {
It 'Should be compatible with PS core and desktop' {
$PSModuleInfo.CompatiblePSEditions | Should -BeIn @("Core", "Desktop")
}

It 'Should point to script module' {
$PSModuleInfo.Path | Should -BeLikeExactly "*$ModuleName.psm1"
}

It 'Should have a definition' {
$PSModuleInfo.Definition | Should -Not -BeNullOrEmpty
}

It 'Should lock GUID' {
$PSModuleInfo.Guid.Guid | Should -Be "60f889fa-f873-43ad-b7d3-b7fc1273a44f"
}
}
}
28 changes: 28 additions & 0 deletions src/Reports/Reports/test/Microsoft.Graph.Reports.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
# ------------------------------------------------------------------------------

Describe "Microsoft.Graph.Reports module" {
BeforeAll {
$ModuleName = "Microsoft.Graph.Reports"
$PSModuleInfo = Get-Module $ModuleName
}

Context "On module import" {
It 'Should be compatible with PS core and desktop' {
$PSModuleInfo.CompatiblePSEditions | Should -BeIn @("Core", "Desktop")
}

It 'Should point to script module' {
$PSModuleInfo.Path | Should -BeLikeExactly "*$ModuleName.psm1"
}

It 'Should have a definition' {
$PSModuleInfo.Definition | Should -Not -BeNullOrEmpty
}

It 'Should lock GUID' {
$PSModuleInfo.Guid.Guid | Should -Be "0bfc88b7-a8ad-471a-8c86-5f0aa3c84217"
}
}
}
28 changes: 28 additions & 0 deletions src/Sites/Sites/test/Microsoft.Graph.Sites.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
# ------------------------------------------------------------------------------

Describe "Microsoft.Graph.Sites module" {
BeforeAll {
$ModuleName = "Microsoft.Graph.Sites"
$PSModuleInfo = Get-Module $ModuleName
}

Context "On module import" {
It 'Should be compatible with PS core and desktop' {
$PSModuleInfo.CompatiblePSEditions | Should -BeIn @("Core", "Desktop")
}

It 'Should point to script module' {
$PSModuleInfo.Path | Should -BeLikeExactly "*$ModuleName.psm1"
}

It 'Should have a definition' {
$PSModuleInfo.Definition | Should -Not -BeNullOrEmpty
}

It 'Should lock GUID' {
$PSModuleInfo.Guid.Guid | Should -Be "7ae8c25b-f1dd-466d-a022-b5489f919c70"
}
}
}
28 changes: 28 additions & 0 deletions src/Users/Users/test/Microsoft.Graph.Users.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
# ------------------------------------------------------------------------------

Describe "Microsoft.Graph.Users module" {
BeforeAll {
$ModuleName = "Microsoft.Graph.Users"
$PSModuleInfo = Get-Module $ModuleName
}

Context "On module import" {
It 'Should be compatible with PS core and desktop' {
$PSModuleInfo.CompatiblePSEditions | Should -BeIn @("Core", "Desktop")
}

It 'Should point to script module' {
$PSModuleInfo.Path | Should -BeLikeExactly "*$ModuleName.psm1"
}

It 'Should have a definition' {
$PSModuleInfo.Definition | Should -Not -BeNullOrEmpty
}

It 'Should lock GUID' {
$PSModuleInfo.Guid.Guid | Should -Be "71150504-37a3-48c6-82c7-7a00a12168db"
}
}
}
Loading