Skip to content

[BUG] PowerShell package updates fail with outdated PowerShellGet modules #5411

Description

@orb71

Please confirm these before moving forward

  • I have searched for my issue and have not found a work-in-progress/duplicate/resolved issue.
  • I have tested that this issue has not been fixed in the latest (beta or stable) release.
  • I have checked the FAQ section for solutions.
  • This issue is about a bug (if it is not, please use the correct template).

UniGetUI Version

2026.3.°

Windows version, edition, and architecture

Windows 11 Enterprise 26200.9445 x64

Describe your issue

While updating:

  • Microsoft.Graph.Authentication 2.39.0 → 2.40.0
  • Microsoft.Graph.Groups 2.39.0 → 2.40.0

UniGetUI failed with:

Cannot convert null to type System.DateTime.

The investigation showed that Windows PowerShell 5.1 was still using:

  • PowerShellGet 1.0.0.1
  • PackageManagement 1.0.0.1

In UniGetUI:

  • PowerShell 5.x exposes PackageManagement, but not PowerShellGet.
  • PowerShell 7.x exposes both modules, but installing both fails.

As a result, the PowerShell 5.x backend remains on outdated package-management modules without a working update path.

Steps to reproduce the issue

  1. In Windows PowerShell 5.1, verify that the following modules are installed:

    • PowerShellGet 1.0.0.1
    • PackageManagement 1.0.0.1
  2. In UniGetUI, try to update either Microsoft.Graph.Authentication or Microsoft.Graph.Groups from 2.39.0 to 2.40.0.

  3. Observe the following error:

    Cannot convert null to type "System.DateTime".

  4. Search UniGetUI for PowerShellGet and PackageManagement.

  5. Observe that:

    • PowerShell 5.x exposes only PackageManagement.
    • PowerShell 7.x exposes both modules.
  6. In PowerShell 7.x, try to install both modules.

  7. Observe the installation failure:

    A positional parameter cannot be found that accepts argument 'False'.

UniGetUI Log

[20/09/2026 11:38:39] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                      █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                      █ Name: PowerShell 5.x (aka PowerShell)
                      █ Executable name: "powershell.exe"
                      █ Executable path: "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe"
                      █ Call arguments: " -NoProfile -Command"
                      █ Version: Name                           Value
                      █          ----                           -----
                      █          PSVersion                      5.1
                      █          PSEdition                      Desktop
                      █
                      █ PowerShell 5.x is enabled and ready to go.
                      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[20/09/2026 11:38:39] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                      █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                      █ Name: PowerShell 7.x (aka PowerShell7)
                      █ Executable name: "pwsh.exe"
                      █ Executable path: "C:\Users\<USERNAME>\AppData\Local\Microsoft\WindowsApps\pwsh.exe"
                      █ Call arguments: " -NoProfile -Command"
                      █ Version: PowerShell 7.6.6
                      █
                      █ PowerShell 7.x is enabled and ready to go.
                      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[20/09/2026 11:40:38] Found 9 available packages from PowerShell7 with the query PowerShellGet
[20/09/2026 11:40:40] Found 50 available packages from PowerShell with the query PowerShellGet
[20/09/2026 11:48:15] Loaded operation parameters for package id=PowerShellGet on manager PowerShell7 and operation Install: Install-PSResource -Name PowerShellGet -Confirm:$false -TrustRepository -AcceptLicense -Scope CurrentUser
[20/09/2026 11:55:46] Found 8 available packages from PowerShell7 with the query PackageManagement
[20/09/2026 11:55:48] Found 49 available packages from PowerShell with the query PackageManagement
[20/09/2026 11:56:05] Loaded operation parameters for package id=PackageManagement on manager PowerShell7 and operation Install: Install-PSResource -Name PackageManagement -Confirm:$false -TrustRepository -AcceptLicense -Scope CurrentUser
[20/11/2026 11:59:12] Loaded operation parameters for package id=PackageManagement on manager PowerShell and operation Install: Install-Module -Name PackageManagement -Confirm:$false -Force -Scope CurrentUser -ErrorVariable UniGetUIOperationError

Package Managers Logs

Manager PowerShell 7.x with version:
PowerShell 7.6.6

——————————————————————————————————————————

Logged subprocess-based task on manager PowerShell7. Task type is ListSources
Subprocess executable: "C:\Users\<USERNAME>\AppData\Local\Microsoft\WindowsApps\pwsh.exe"
Command-line arguments: " -NoProfile -Command "if (Get-Command Get-PSResourceRepository -ErrorAction SilentlyContinue) { Get-PSResourceRepository | Format-Table -Property Name,Uri } else { Get-PSRepository | Format-Table -Property Name,@{N='SourceLocation';E={If ($_.Uri) {$_.Uri.AbsoluteUri} Else {$_.SourceLocation}}} }""
Process start time: 20/09/2026 11:38:39
Process end time:   20/09/2026 11:38:40

-- Process STDOUT
  Name     Uri
  ----     ---
  PSGallery https://www.powershellgallery.com/api/v2

Return code: SUCCESS (0)

——————————————————————————————————————————
Logged subprocess-based task on manager PowerShell7. Task type is ListInstalledPackages
Subprocess executable: "C:\Users\<USERNAME>\AppData\Local\Microsoft\WindowsApps\pwsh.exe"
Command-line arguments: " -NoProfile -Command "Write-Output '##SCOPE:AllUsers##'; Get-InstalledPSResource -Scope AllUsers | ForEach-Object { $_.Name + [char]9 + $_.Version + [char]9 + $_.Repository }; Write-Output '##SCOPE:CurrentUser##'; Get-InstalledPSResource -Scope CurrentUser | ForEach-Object { $_.Name + [char]9 + $_.Version + [char]9 + $_.Repository }""
Process start time: 20/09/2026 11:38:42
Process end time:   20/09/2026 11:38:44

-- Process STDOUT
  ##SCOPE:AllUsers##
  ##SCOPE:CurrentUser##
  Microsoft.PowerShell.PSResourceGet	1.2.0	PSGallery
  Microsoft.PowerShell.PSResourceGet	1.1.1	PSGallery

-- Process STDERR
  Get-InstalledPSResource: No match was found for package '*'.

Return code: SUCCESS (0)

——————————————————————————————————————————
Logged native task on manager PowerShell7. Task type is FindPackages
Process start time: 20/09/2026 11:40:36
Process end time:   20/09/2026 11:40:38

-- Task information
  Begin package search with url=https://www.powershellgallery.com/api/v2/Packages()?$filter=substringof('PowerShellGet',Id) and IsLatestVersion eq true&$orderby=DownloadCount desc&$skip=0&$top=50 on manager PowerShell7
  Found package PowerShellGet version 2.2.5 on source PSGallery
  Found package ADOPowershellGet version 0.2.4 on source PSGallery
  Found package PowerShellGetGUI version 1.0.0 on source PSGallery
  Found package CompatPowerShellGet version 0.0.4 on source PSGallery
  Found package OfflinePowerShellGetDeploy version 0.1.1 on source PSGallery
  Found package PowerShellGetCompat version 0.0.1 on source PSGallery
  Found package PowerShellGet-Test-Binary-Module version 1.0.0.3 on source PSGallery
  Found package Update-PowerShellGet version 1.0.0 on source PSGallery
  Found package Repair-PowerShellGetModuleRoleCapabilities version 1.0.0 on source PSGallery

The task reported success

——————————————————————————————————————————
Logged native task on manager PowerShell7. Task type is FindPackages
Process start time: 20/09/2026 11:55:45
Process end time:   20/09/2026 11:55:46

-- Task information
  Begin package search with url=https://www.powershellgallery.com/api/v2/Packages()?$filter=substringof('PackageManagement',Id) and IsLatestVersion eq true&$orderby=DownloadCount desc&$skip=0&$top=50 on manager PowerShell7
  Found package PackageManagement version 1.4.8.1 on source PSGallery
  Found package PackageManagementProviderResource version 1.0.3 on source PSGallery
  Found package cPowerShellPackageManagement version 1.0.1 on source PSGallery
  Found package AzureAutomationTools.PackageManagement version 0.6.0 on source PSGallery
  Found package ProActive.PowerShell.PackageManagement version 1.1.0 on source PSGallery
  Found package DPT.PackageManagement version 1.0.0 on source PSGallery
  Found package Gucu112.Powershell.PackageManagement version 0.1.2601.30 on source PSGallery
  Found package Shmuelie.PackageManagement version 0.3.0 on source PSGallery

The task reported success

Manager PowerShell 5.x with version:
Name                           Value
----                           -----
PSVersion                      5.1.26100.9444
PSEdition                      Desktop

——————————————————————————————————————————

Logged subprocess-based task on manager PowerShell. Task type is ListInstalledPackages
Subprocess executable: "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe"
Command-line arguments: " -NoProfile -Command Get-InstalledModule"
Process start time: 20/09/2026 11:38:42
Process end time:   20/09/2026 11:38:45

-- Process STDOUT
  Version    Name                                Repository
  -------    ----                                ----------
  2.40.0     Microsoft.Graph.Authentication      PSGallery
  2.40.0     Microsoft.Graph.Groups              PSGallery
  2.31.0     Microsoft.Graph.Identity.Directo... PSGallery

-- Process STDERR
  Cannot convert null to type "System.DateTime".
  At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7016 char:17
  +                 $InstalledDate = $null
  +                 ~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : MetadataError: (:) [], ArgumentTransformationMetadataException
      + FullyQualifiedErrorId : RuntimeException

  Cannot convert null to type "System.DateTime".
  At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7026 char:17
  +                 $UpdatedDate = $null
  +                 ~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : MetadataError: (:) [], ArgumentTransformationMetadataException
      + FullyQualifiedErrorId : RuntimeException

Return code: SUCCESS (0)

——————————————————————————————————————————
Logged native task on manager PowerShell. Task type is FindPackages
Process start time: 20/09/2026 11:40:36
Process end time:   20/09/2026 11:40:40

-- Task information
  Begin package search with url=https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&$orderby=Id&searchTerm='PowerShellGet'&targetFramework=''&includePrerelease=false&$skip=0&$top=50&semVerLevel=2.0.0 on manager PowerShell
  Found package PowerShellGet version 2.2.5 on source PSGallery

The task reported success

——————————————————————————————————————————
Logged native task on manager PowerShell. Task type is FindPackages
Process start time: 20/09/2026 11:55:45
Process end time:   20/09/2026 11:55:48

-- Task information
  Begin package search with url=https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&$orderby=Id&searchTerm='PackageManagement'&targetFramework=''&includePrerelease=false&$skip=0&$top=50&semVerLevel=2.0.0 on manager PowerShell
  Found package PackageManagement version 1.4.8.1 on source PSGallery
  Found package PowerShellGet version 2.2.5 on source PSGallery

The task reported success

Relevant information

Windows PowerShell 5.1 initially had:

  • PowerShellGet 1.0.0.1
  • PackageManagement 1.0.0.1

Manually upgrading them and PowerShell to:

  • PowerShellGet 2.2.5
  • PackageManagement 1.4.8.1

resolved the Microsoft.Graph update issue.

Additional UniGetUI findings:

  • PowerShell 5.x exposes PackageManagement, but not PowerShellGet.

  • PowerShell 7.x exposes both modules, but installation fails with:

    A positional parameter cannot be found that accepts argument 'False'.

  • Installing PackageManagement through PowerShell 5.x fails because UniGetUI does not pass -AllowClobber.

Screenshots and videos

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions