Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added M365 connections to shared #2090

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8c42981
Added M365 connections to shared
iserrano76 May 9, 2024
c649f72
split in functions
iserrano76 Jun 18, 2024
4d11e96
Fix Spell
iserrano76 Jun 18, 2024
94c8466
Merge branch 'main' into M365-Connection
iserrano76 Jun 18, 2024
263fdc3
Merge branch 'microsoft:main' into M365-Connection
iserrano76 Jun 19, 2024
a01e021
Added EXO Connection script
iserrano76 Jun 25, 2024
00d7a60
Fix requested Changes
iserrano76 Jun 25, 2024
638d5c4
Merge branch 'main' into M365-Connection
iserrano76 Jun 25, 2024
c4aea20
Merge branch 'microsoft:main' into M365-Connection
iserrano76 Jul 24, 2024
07362dd
Simplify with functions and split Graph and EXO
iserrano76 Jul 25, 2024
34d9c86
Merge branch 'main' into M365-Connection
dpaulson45 Nov 4, 2024
c888a58
Merge branch 'main' into M365-Connection
iserrano76 Nov 6, 2024
b9e8291
Merge branch 'microsoft:main' into M365-Connection
iserrano76 Nov 11, 2024
e7b64d1
Changes requested
iserrano76 Nov 18, 2024
129ee01
Merge branch 'main' into M365-Connection
iserrano76 Nov 18, 2024
2199981
Added docs
iserrano76 Nov 26, 2024
b6685e5
Merge branch 'main' into M365-Connection
iserrano76 Nov 26, 2024
665eee0
added examples
iserrano76 Nov 26, 2024
63c065c
Merge branch 'main' into M365-Connection
iserrano76 Nov 26, 2024
11011db
Merge branch 'main' into M365-Connection
iserrano76 Nov 27, 2024
d4e7f88
added changes requested
iserrano76 Nov 27, 2024
9954010
fix tipo
iserrano76 Nov 27, 2024
5637cdb
Merge branch 'main' into M365-Connection
iserrano76 Jan 21, 2025
61598b0
Verbose intalled module and parameter in singular
iserrano76 Jan 22, 2025
a7755af
Merge branch 'M365-Connection' of https://github.com/iserrano76/CSS-E…
iserrano76 Jan 22, 2025
30f6346
fix after modify plural
iserrano76 Jan 22, 2025
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
2 changes: 1 addition & 1 deletion Shared/M365/EXOConnection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function Connect-EXOAdvanced {
)

#Validate EXO 3.0 is installed and loaded
$requestModule = Request-Module -Modules "ExchangeOnlineManagement" -MinModuleVersion $MinModuleVersion
$requestModule = Request-Module -Module "ExchangeOnlineManagement" -MinModuleVersion $MinModuleVersion

if (-not $requestModule) {
Write-Host "We cannot continue without ExchangeOnlineManagement Powershell module" -ForegroundColor Red
Expand Down
2 changes: 1 addition & 1 deletion Shared/M365/GraphConnection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function Connect-GraphAdvanced {
)

#Validate Graph is installed and loaded
$requestModule = Request-Module -Modules $Modules -MinModuleVersion $MinModuleVersion
$requestModule = Request-Module -Module $Modules -MinModuleVersion $MinModuleVersion
if (-not $requestModule) {
Write-Host "We cannot continue without $Modules Powershell module" -ForegroundColor Red
return $null
Expand Down
7 changes: 4 additions & 3 deletions Shared/ModuleHandle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@ function Request-Module {
[OutputType([bool])]
param (
[Parameter(Mandatory = $true)]
[string[]]$Modules,
[string[]]$Module,
[Parameter(Mandatory = $false)]
[System.Version]$MinModuleVersion = $null
)

$noFoundError = $true
foreach ($module in $Modules) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You broke this loop because you changed the parameter name to be $Module instead of $Modules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for point to this, I am modifying the parameter to singular as you recommend in a previous PR from the Development Guidelines.
I will fix this and rebase

Write-Verbose "Checking $Modules PowerShell Module"
Write-Verbose "Checking $module PowerShell Module"
$getParams = @{
Name = $module
ErrorAction = 'SilentlyContinue'
}
Write-Verbose "Checking $module"
if ($MinModuleVersion) {
$getParams["MinimumVersion"] = $MinModuleVersion
Write-Verbose "with minimum version $minModuleVersion"
Expand Down Expand Up @@ -78,6 +77,8 @@ function Request-Module {
Write-Host "Installation process fails. Error: `n$_" -ForegroundColor Red
$noFoundError = $false
}
} else {
Write-Verbose "Found $module module installed"
}
}
return $noFoundError
Expand Down