Skip to content

stan754/IntuneGraph

Repository files navigation

PowerShell Gallery Version GitHub License PowerShell Gallery Downloads

IntuneGraph

Powershell Module to upload intunewin to Intune.

Important

This module is a community project and might not work for everyone!

The sourcecode is open but make sure to test the module before implementing this somewhere there is NO support available

Getting Started

To run from the source code clone or download this repo to your local machine.

Prerequisites

The only dependency for this module is the Microsoft.Graph.Authentication Powershell module. Which can be installed using:

Install-Module Microsoft.Graph.Authentication -Scope CurrentUser -Repository PSGallery -Force

Import

Tip

The module can now also be installed from PSGallery!

Install-Module IntuneGraph -Scope CurrentUser -Repository PSGallery -Force

After installing the prerequisites the module should be ready to use and can be imported using:

Import-Module '.\IntuneGraph'

Usage

To start using the module import it into a script and run:

Connect-MgGraph -Scopes DeviceManagementApps.ReadWrite.All

After connecting you can start uploading to Intune like this:

Import-Module '.\IntuneGraph'

$SourceFile = "C:\Path\To\Package.intunewin"

$FileRule = Get-DetectionRule -File -Path "C:\Program Files\Application" -FileOrFolderName "application.exe" -FileDetectionType exists -check32BitOn64System False

$ReturnCodes = Get-DefaultReturnCode

Add-Win32Lob `
  -SourceFile "$SourceFile" `
  -publisher "Publisher name" `
  -description "Short description" `
  -detectionRules @($FileRule) `
  -returnCodes $ReturnCodes
  -installCmdLine "powershell.exe .\install.ps1" `
  -uninstallCmdLine "powershell.exe .\uninstall.ps1"

Why

When I was looking for a solution to upload intunewin files to Intune I could not find any good explanation. The only code and documentation that I found online had dependencies on deprecated modules which is not a good start. With this module I hope to bundle everything into a simple module.

License

This code is licensed under the MIT License. See the LICENSE file for the license.

This code is based on the sample code provided by Microsoft:

See the LICENSE-MIT-MICROSOFT file for the original license.

About

No description, website, or topics provided.

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE-MIT-MICROSOFT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •