Get-ADTINIValue Issue in ADT v4.0.4

I have an issue with the Get-ADTINIValue function in PSADT v4.0.4

Here is the command I am using:
Get-adtINIvalue -FilePath "$env:temp\contentservers.ini" -section 'contentservers' -key '00958'

Get-adtINIvalue : Exception calling "GetSectionKeyValue" with "3" argument(s): "Either lpAppName or lpKeyName must be <null>."
At line:1 char:1
+ Get-adtINIvalue -FilePath "$env:temp\contentservers.ini" -section 'co ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ADTIniValue], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentException,Get-ADTIniValue

Please always check GitHub first and foremost for issues, it’s the source of truth for problems unlike the forums: [Bug] PSADT.Configuration.Inifile GetSectionKeyValue and GetSectionKeyValuePairs throw exception · Issue #1212 · PSAppDeployToolkit/PSAppDeployToolkit · GitHub.

I did check. That bug references Get-ADTinivalue as the correct method of addressing the issue. However that is the method that has the error. Do you have more information?

I am unable to post in git hub due to corporate policy.

Your issue is the same as the GitHub issue:

There’s nothing more to add that isn’t in the GitHub issue, that its resolution is pending some other upcoming refactoring within our C# code. It should be addressed for 4.1.0 in Q2 2025.

1 Like