Error Attempting to use PSAppDeployToolkit.WinGet 1.0.4 Extension

I haven’t used a v4 extension yet and saw this WinGet extension and was excited to try it. When testing out this extension to attempt installing “Microsoft.WindowsTerminal” I am getting a strange error in the log.

The command I am using is:

Invoke-ADTWinGetOperation -Id Microsoft.WindowsTerminal -DeployMode Silent

My question is, am I doing something wrong with how I am using this module? or is this a bug?

Here are the errors from the Log the extension creates:

[Install] :: Installer failed with exit code: 0x80070032 : The request is not supported.
[Install] :: Failed to install the specified WinGet package.
Error Record:
-------------
 
Message               : Cannot convert value "Installer failed with exit code: 0x80070032 : The request is not supported." to type "System.Int32". Error: "Input string was not in a correct format."
InnerException        : System.Management.Automation.PSInvalidCastException: Cannot convert value "Installer failed with exit code: 0x80070032 : The request is not supported." to type "System.Int32". Error: "Input string was not in a correct format." ---> System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.ComponentModel.Int32Converter.FromString(String value, NumberFormatInfo formatInfo)
at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
--- End of inner exception stack trace ---
at System.Management.Automation.LanguagePrimitives.ConvertStringToInteger(Object valueToConvert, Type resultType, Boolean recursion, PSObject originalValueToConvert, IFormatProvider formatProvider, TypeTable backupTable)
at CallSite.Target(Closure , CallSite , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
 
FullyQualifiedErrorId : InvalidCastFromStringToInteger,Install-ADTWinGetPackage
ScriptStackTrace      : at Invoke-ADTWinGetDeploymentOperation<End>, C:\Resources\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 1925
at Install-ADTWinGetPackage<Process>, C:\Resources\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 3032
at Install-ADTDeployment, C:\Resources\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 3214
at Invoke-ADTWinGetOperation, C:\Resources\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 3303
at Install-ADTDeployment, C:\Resources\Invoke-AppDeployToolkit.ps1: line 177
at <ScriptBlock>, C:\Resources\Invoke-AppDeployToolkit.ps1: line 334
 
PositionMessage       : At C:\Resources\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1:3214 char:17
+ ...     $null = & $Script:CommandTable.'Install-ADTWinGetPackage' -Id $Id ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
Error Inner Exception(s):
-------------------------
 
Message        : Cannot convert value "Installer failed with exit code: 0x80070032 : The request is not supported." to type "System.Int32". Error: "Input string was not in a correct format."
InnerException : System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.ComponentModel.Int32Converter.FromString(String value, NumberFormatInfo formatInfo)
at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Message : Input string was not in a correct format.

[Install] :: Error Record:
-------------
 
Message               : Cannot convert value "Installer failed with exit code: 0x80070032 : The request is not supported." to type "System.Int32". Error: "Input string was not in a correct format."
InnerException        : System.Management.Automation.PSInvalidCastException: Cannot convert value "Installer failed with exit code: 0x80070032 : The request is not supported." to type "System.Int32". Error: "Input string was not in a correct format." ---> System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.ComponentModel.Int32Converter.FromString(String value, NumberFormatInfo formatInfo)
at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
--- End of inner exception stack trace ---
at System.Management.Automation.LanguagePrimitives.ConvertStringToInteger(Object valueToConvert, Type resultType, Boolean recursion, PSObject originalValueToConvert, IFormatProvider formatProvider, TypeTable backupTable)
at CallSite.Target(Closure , CallSite , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
 
FullyQualifiedErrorId : InvalidCastFromStringToInteger,Install-ADTWinGetPackage
ScriptStackTrace      : at Invoke-ADTWinGetDeploymentOperation<End>, C:\Resources\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 1925
at Install-ADTWinGetPackage<Process>, C:\Resources\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 3032
at Install-ADTDeployment, C:\Resources\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 3214
at Invoke-ADTWinGetOperation, C:\Resources\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 3303
at Install-ADTDeployment, C:\Resources\Invoke-AppDeployToolkit.ps1: line 177
at <ScriptBlock>, C:\Resources\Invoke-AppDeployToolkit.ps1: line 334
 
PositionMessage       : At C:\Resources\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1:3214 char:17
+ ...     $null = & $Script:CommandTable.'Install-ADTWinGetPackage' -Id $Id ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
Error Inner Exception(s):
-------------------------
 
Message        : Cannot convert value "Installer failed with exit code: 0x80070032 : The request is not supported." to type "System.Int32". Error: "Input string was not in a correct format."
InnerException : System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.ComponentModel.Int32Converter.FromString(String value, NumberFormatInfo formatInfo)
at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Message : Input string was not in a correct format.

[Finalization] :: [WindowsTerminal_1.22.11141.0] install completed with exit code [60001].

I figured out I was using the wrong command. I switched it to:

$terminal = Find-ADTWinGetPackage -Id 'Microsoft.WindowsTerminal'
Install-ADTWinGetPackage -Id $terminal.Id -Force -Verbose

But I still get the same errors as above.

Here is the output of $terminal

PS E:\DevOps\PSADT-Projects\VMSetup> Find-ADTWinGetPackage -Id 'Microsoft.WindowsTerminal'

Name             Id                        Version      Source
----             --                        -------      ------
Windows Terminal Microsoft.WindowsTerminal 1.22.11141.0 winget

when i run winget from a powershell prompt WindowsTerminal installs:

PS C:\WINDOWS\system32> winget install --id Microsoft.WindowsTerminal -e
Found Windows Terminal [Microsoft.WindowsTerminal] Version 1.22.11141.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
This package requires the following dependencies:
  - Packages
      Microsoft.UI.Xaml.2.8 [>= 8.2306.22001.0]
Successfully verified installer hash
Starting package install...
  ██████████████████████████████  100%
Successfully installed

I’m on annual leave at the moment and need to focus on PSAppDeployToolkit 4.1.0 before I swing back onto my own module, but I’ll look at this when I can. If you have the chance to report it on my GitHub repository for it, I’d be appreciative.

1 Like

The [PSAppDeployToolkit.WinGet 1.0.4] is not working in the latest 4.1.0 version of PSADT, i get several error messages.

[2025-07-10T11:19:03.2017770+02:00] [Execution] [Invoke-AppDeployToolkit.ps1] [Error] :: An unhandled error within [Invoke-AppDeployToolkit.ps1] has occurred.
Error Record:
-------------

Message               : Unable to find type [PSADT.OperatingSystem.OSHelper].
InnerException        : System.Management.Automation.ParentContainsErrorRecordException: Unable to find type [PSADT.OperatingSystem.OSHelper].
                           at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)

FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
ScriptStackTrace      : at <ScriptBlock>, C:\Software\Filezilla_PSADT\Media\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 4350
                        at <ScriptBlock><Process>, C:\Software\Filezilla_PSADT\Media\Invoke-AppDeployToolkit.ps1: line 373
                        at <ScriptBlock>, C:\Software\Filezilla_PSADT\Media\Invoke-AppDeployToolkit.ps1: line 367
                        at <ScriptBlock>, <No file>: line 1

PositionMessage       : At C:\Software\Filezilla_PSADT\Media\Invoke-AppDeployToolkit.ps1:373 char:17
                        +                 Import-Module -Name $_.FullName -Force
                        +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2025-07-10T11:19:03.2098699+02:00] [Finalization] [Close-ADTSession] [Error] :: [FileZilla_3.69.1_EN_01] install completed in [0.6136969] seconds with exit code [60001].

The Cannot convert value "Installer failed with exit code: 0x80070032 : The request is not supported." to type "System.Int32". Error: "Input string was not in a correct format." issue is patched out via - Improve exit code parsing from last WinGet log line within `Invoke-… · mjr4077au/PSAppDeployToolkit.WinGet@d654483 · GitHub and will be part of the upcoming patch version.

The Unable to find type [PSADT.OperatingSystem.OSHelper]. issue is patched out via - Get module working against the upcoming PSAppDeployToolkit 4.1.0 re… · mjr4077au/PSAppDeployToolkit.WinGet@fc42d9d · GitHub and will also be part of the upcoming patch release.

2 Likes