Sample_EXE.ps1
Remove-Module -Name IntuneWin32App -Force # Import module Import-Module -Name F:\GoogleDrive\Scripts\PowerShell\Intune\Modules\IntuneWin32App\IntuneWin32App.psd1 # Package MSI as .intunewin file #New-IntuneWin32AppPackage # Get MSI meta data from .intunewin file $IntuneWinFile = "C:\Temp\IntuneWinAppUtil\Output\Enable-BitLockerEncryption.intunewin" $IntuneWinMetaData = Get-IntuneWin32AppMetaData -FilePath $IntuneWinFile # -Raw to get XML, otherwise object # Create custom display name like 'Name' and 'Version' $DisplayName = "Enable BitLocker Encryption 1.0" # Create PowerShell script detection rule $DetectionScriptFile = "C:\Temp\IntuneWinAppUtil\Output\Get-BitLockerEncryptionDetection.ps1" $DetectionRule = New-IntuneWin32AppDetectionRule -PowerShellScript -ScriptFile $DetectionScriptFile -EnforceSignatureCheck $false -RunAs32Bit $false # Create custom return code $ReturnCode = New-IntuneWin32AppReturnCode -ReturnCode 1337 -Type retry # Convert image file to icon $ImageFile = "C:\Temp\IntuneWinAppUtil\Logos\BitLocker.png" $Icon = New-IntuneWin32AppIcon -FilePath $ImageFile # Add new EXE Win32 app $InstallCommandLine = "powershell.exe -ExecutionPolicy Bypass -File .\Enable-BitLockerEncryption.ps1" $UninstallCommandLine = "cmd.exe /c" Add-IntuneWin32App -TenantName configmgrse.onmicrosoft.com -FilePath $IntuneWinFile -DisplayName $DisplayName -Description "Enable BitLocker Encryption" -Publisher "SCConfigMgr" -InstallExperience system -RestartBehavior suppress -DetectionRule $DetectionRule -ReturnCode $ReturnCode -InstallCommandLine $InstallCommandLine -UninstallCommandLine $UninstallCommandLine -Icon $Icon -Verbose # Add assignment to Win32 app #Add-IntuneWin32AppAssignment |