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

Issues with PowerShell 7 (Application_LOB_Add.ps1) #275

Open
breakpoint7 opened this issue Jun 18, 2024 · 0 comments
Open

Issues with PowerShell 7 (Application_LOB_Add.ps1) #275

breakpoint7 opened this issue Jun 18, 2024 · 0 comments

Comments

@breakpoint7
Copy link

Most of these scripts were initially built with PowerShell 5 and do not work with PowerShell 7 as-is.

If you find yourself working through this, two key changes you need to make:

  1. Fix the header in UploadAzureStorageChunk to specify the content type as follows:
    $headers = @{
    "x-ms-blob-type" = "BlockBlob"
    "Content-Type" = "text/plain; charset=iso-8859-1"
    };

More detail on this problem covered here: Add-IntuneWin32App.ps1 'CommitFile' failed error with PowerShell 7.4.0 · Issue #128 · MSEndpointMgr/IntuneWin32App (github.com)

  1. Add a Content-Type header to the call to FinalizeAzureStorageUpload
    try
    {
    $headers = @{
    "Content-Type" = "application/json"
    };
    Invoke-RestMethod $uri -Method Put -Body $xml -Headers $headers; }
    catch
    {
    Write-Host -ForegroundColor Red $request;
    Write-Host -ForegroundColor Red $_.Exception.Message;
    throw;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant