Open TheCloudCrafter opened 2 years ago
Looking at the sample I realized I skipped out on the beginning. So I added that to my code and got a new (400) Bad Request error.
Test-AuthToken
$baseUrl = "https://graph.microsoft.com/beta/deviceAppManagement/"
$logRequestUris = $true;
$logHeaders = $false;
$logContent = $true;
$azureStorageUploadChunkSizeInMb = 6l;
$sleep = 30
Testing if SourceFile 'C:\PATH\acroread.intunewin' Path is valid...
Creating JSON data to pass to the service...
Creating application in Intune...
POST https://graph.microsoft.com/deviceAppManagement/mobileApps
{
"msiInformation": null,
"description": "This free PDF reader app lets you view, comment, fill out, and sign PDF forms to help you move
through your workflow quickly and efficiently.",
"displayName": "Adobe Acrobat Reader 2020 MUI",
"minimumSupportedOperatingSystem": {
"v10_1607": true
},
"fileName": "IntunePackage.intunewin",
"@odata.type": "#microsoft.graph.win32LobApp",
"privacyInformationUrl": null,
"notes": "",
"informationUrl": null,
"installExperience": {
"runAsAccount": "system"
},
"owner": "",
"installCommandLine": "powershell.exe -executionpolicy Bypass .\\install.ps1",
"publisher": "Adobe",
"runAs32bit": false,
"uninstallCommandLine": "powershell.exe -executionpolicy Bypass .\\uninstall.ps1",
"setupFilePath": "AcroRead.msi",
"developer": "",
"isFeatured": false,
"detectionRules": {
"productVersion": null,
"productCode": "{23170F69-40B1-2702-1604-000001000000}",
"productVersionOperator": "notConfigured",
"@odata.type": "#microsoft.graph.win32LobAppProductCodeDetection"
},
"returnCodes": [
{
"returnCode": 0,
"type": "success"
},
{
"returnCode": 1707,
"type": "success"
},
{
"returnCode": 3010,
"type": "softReboot"
},
{
"returnCode": 1641,
"type": "hardReboot"
},
{
"returnCode": 1618,
"type": "retry"
}
]
}
POST https://graph.microsoft.com/beta/deviceAppManagement/mobileApps
The remote server returned an error: (400) Bad Request.
Aborting with exception: System.Net.WebException: The remote server returned an error: (400) Bad Request.
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
I tried another package and looking at this thread I don't understand why my output JSON always says:
"fileName": "IntunePackage.intunewin",
This one actually says the real intunewin.
"fileName": "Deploy-Application.intunewin",
https://github.com/microsoftgraph/powershell-intune-samples/issues/123
My sourcefile is 'acroread.intunewin' and passes the filecheck fine. I find it odd it gets renamed...
I've been learning powershell and I'm responsible for creating packages across multiple tenants. I'm trying to leverage Upload-Win32Lob and I can't seem to get it working. Any assistance would be immensely appreciated. I'm new to automation and this would make my life loads easier.
Here is my inputs with a few paths and fluff omitted:
Here is my error: