Install-Module -Name d365fo.tools -force -verbose doesnt work in virtual machine

CSA - HFR HERMES 0 Reputation points
2025-02-05T17:04:10.2933333+00:00

Hello,

The command line Install-Module -Name d365fo.tools -force -verbose doent work in powershell in our virtual machine (Azure devbox).

We have this error message :

PackageManagement\Install-Package : Package 'PSFramework' failed to download. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21 + ...          $null = PackageManagement\Install-Package @PSBoundParameters +                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : ResourceUnavailable: (C:\Users\Admin6...Framework.nupkg:String) [Install-Package], Exception     + FullyQualifiedErrorId : PackageFailedInstallOrDownload,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

image

Package are accessible from the web browser.

Could someone help me ?

Best regards.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,357 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,809 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Mounika Reddy Anumandla 2,265 Reputation points Microsoft Vendor
    2025-02-06T04:10:52.5366667+00:00

    Hi CSA - HFR HERMES,

    Welcome to the Microsoft Q&A Platform. Thank you for posting your query here.

    I have tried to download it in Windows (Windows Server 2019 Datacenter) and it worked.
    User's image

    Since you have mentioned that the packages are accessible from a web browser, it means the issue is likely related to PowerShell's ability to download them rather than network connectivity in general.

    Check PSFramework :C:\Program Files\WindowsPowerShell\Modules\PSFramework. If it does not exist download it https://www.powershellgallery.com/packages/PSFramework/1.0.19

    Check PowerShell Execution Policy

    Run the following to see if execution policies are preventing module installation:

    Get-ExecutionPolicy -List
    

    If the policy is restrictive (Restricted or AllSigned), temporarily set it to Unrestricted or Bypass:

    Set-ExecutionPolicy Bypass -Scope Process -Force
    

    Then try installing the module again.

    Alternate workaround: Install the module manually
    https://www.powershellgallery.com/packages/d365fo.tools/0.7.20
    https://learn.microsoft.com/en-us/powershell/gallery/how-to/working-with-packages/manual-download?view=powershellget-3.x

    Hope this helps!

    Let me know if you have further queries!

    If the comment is helpful, please click "upvote" to let us know.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.