Import-KFModule

Syntax

Import-KFModule
  [-AzureAD]
  [-MSAL]
  [-ExchangeOnline]
  [-MicrosoftTeams]
  [-SharePointOnline]
  [-PnP]
  [-Graph<Module>]
  [-ShowVersion]
  [-ThrowErrors[:$true]]

Support

>= kenaflow 4.0.29

Return

nothing.

Description

This cmdlet can be used to load some Microsoft 365 related PowerShell modules.

We integrate the binaries for compatibility reasons. We ask you not to install these modules by yourself.

Each module is loaded only once per session. If you request a module that is already loaded, the cmdlet writes a verbose log entry and does nothing.

Use -ShowVersion to write the module version to the kenaflow log after loading. (This is False by default.)

-PnP and -SharePointOnline cannot be used inside a SharePoint enabled workflow. kenaflow already provides SharePoint access there; the cmdlet throws an error in that case.

Parameters

-AzureAD

This loads the AzureAD PowerShell module.

Details here: https://docs.microsoft.com/en-us/powershell/azure/active-directory/install-adv2?view=azureadps-2.0

-MSAL

This loads the MSAL.PS PowerShell module (Microsoft Authentication Library for PowerShell). Use it to acquire OAuth tokens, e.g. for calling REST APIs yourself.

Details here: https://github.com/AzureAD/MSAL.PS

-ExchangeOnline

This loads the Exchange Online Management PowerShell module.

Details here: https://docs.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps#install-and-maintain-the-exo-v2-module

-MicrosoftTeams

This loads the Microsoft Teams PowerShell module.

Details here: https://docs.microsoft.com/en-us/microsoftteams/teams-powershell-overview

-SharePointOnline

This loads the SharePoint Online PowerShell module.

Not allowed inside a SharePoint enabled workflow.

Details here: https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/connect-sharepoint-online

-PnP

This loads the PnP PowerShell module. Telemetry and the update check of PnP PowerShell are disabled.

Not allowed inside a SharePoint enabled workflow.

Details here: https://pnp.github.io/powershell/

-Graph<Module>

There is no single -Graph switch. The Microsoft Graph PowerShell SDK is split into sub-modules, and you load each sub-module you need with its own switch. Microsoft.Graph.Authentication is always loaded together with the requested sub-module.

Available switches (each loads Microsoft.Graph.<Module>):

  • -GraphApplications
  • -GraphAuthentication
  • -GraphBackupRestore
  • -GraphBookings
  • -GraphCalendar
  • -GraphChangeNotifications
  • -GraphCloudCommunications
  • -GraphCompliance
  • -GraphCrossDeviceExperiences
  • -GraphDeviceManagement
  • -GraphDeviceManagementAdministration
  • -GraphDeviceManagementEnrollment
  • -GraphDeviceManagementFunctions
  • -GraphDevicesCloudPrint
  • -GraphDevicesCorporateManagement
  • -GraphDevicesServiceAnnouncement
  • -GraphDirectoryObjects
  • -GraphEducation
  • -GraphFiles
  • -GraphGroups
  • -GraphIdentityDirectoryManagement
  • -GraphIdentityGovernance
  • -GraphIdentityPartner
  • -GraphIdentitySignIns
  • -GraphMail
  • -GraphNotes
  • -GraphPeople
  • -GraphPersonalContacts
  • -GraphPlanner
  • -GraphReports
  • -GraphSchemaExtensions
  • -GraphSearch
  • -GraphSecurity
  • -GraphSites
  • -GraphTeams
  • -GraphUsers
  • -GraphUsersActions
  • -GraphUsersFunctions

Example: Import-KFModule -GraphUsers -GraphGroups -ShowVersion

Details here: https://learn.microsoft.com/en-us/powershell/microsoftgraph/overview

-ShowVersion

With this parameter the versions of the modules are written to the kenaflow log (with log level 'verbose').

[-ThrowErrors[:$true]]

This is a default parameter for all kenaflow cmdlets. If set to True (default!) the engine will pass exception within the cmdlet to the script for further handling.