aaronparker / vcredist

Lifecycle management for the Microsoft Visual C++ Redistributables
https://vcredist.com
MIT License
129 stars 18 forks source link

Add-IntuneWin32App : Cannot validate argument on parameter 'FilePath'. Cannot bind argument to parameter 'Path' because it is an empty string. #161

Closed alexhass closed 6 months ago

alexhass commented 6 months ago

Expected Behavior

Successful import of app.

Current Behavior

Import-VcIntuneApplication -VcList $VcList
WARNING: Unexpected error occurred while packaging Win32 app. Return code from invocation: -532462766

Name                           Value
----                           -----
RequirementRule                {applicableArchitectures, minimumSupportedWindowsRelease, minimumFreeDiskSpaceInMB}
FilePath
AppVersion                     14.38.33135.0
Publisher                      Microsoft
InformationURL                 https://visualstudio.microsoft.com/vs/support/
UninstallCommandLine           "%ProgramData%\Package Cache\{c649ede4-f16a-4486-a117-dcc2f2a35165}\VC_redist.x64.exe" /uninstall /quiet /norestart
RestartBehavior                basedOnReturnCode
InstallCommandLine             VC_redist.x64.exe /install /quiet /norestart
Verbose                        True
Notes                          Package created with VcRedist on 2024-03-01; https://vcredist.com
Description                    Visual C++ Redistributable Packages install runtime components of Visual C++ Libraries.. Microsoft Visual C++ Redistributable for Visual Studio 20...
PrivacyURL                     https://go.microsoft.com/fwlink/?LinkId=521839
DisplayName                    Microsoft Visual C++ Redistributable for Visual Studio 2022 14.38.33135.0 x64
DetectionRule                  {@odata.type, operator, detectionValue, check32BitOn64System...}
Icon                           iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AABZ70lEQVR4AezBgQAAAACAoP2pF6kCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYvfsAiurc3z...
CompanyPortalFeaturedApp       False
InstallExperience              system
Add-IntuneWin32App : Cannot validate argument on parameter 'FilePath'. Cannot bind argument to parameter 'Path' because it is an empty string.
At C:\Program Files\WindowsPowerShell\Modules\VcRedist\4.1.495\Public\Import-VcIntuneApplication.ps1:115 char:47
+             $Application = Add-IntuneWin32App @Win32AppArgs
+                                               ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Add-IntuneWin32App], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Add-IntuneWin32App```

Failure Information (for bugs)

Please help provide information about the failure if this is a bug by issuing the command using the -Verbose command.

Paste the verbose output from the command here

If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

$VcList = Get-VcList | Where-Object { $_.Release -eq "2022" }
Save-VcRedist -VcList $VcList -Path C:\Temp\VcRedist
Import-VcIntuneApplication -VcList $VcList

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

* Get-Module -ListAvailable VcRedist

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     4.1.495    VcRedist                            {Export-VcManifest, Get-InstalledVcRedist, Get-VcList, Import-VcConfigMgrApplication...}
Get-PSVersion
Get-PSVersion : The term 'Get-PSVersion' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ Get-PSVersion
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-PSVersion:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.4046
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.4046
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Failure Logs

Please include any relevant log snippets or files here.

alexhass commented 6 months ago

Found the bug in IntuneWin32App.

Here is a workaround until IntuneWin32App 1.4.4 gets released:

Uninstall-Module -Name IntuneWin32App
Install-Module -Name IntuneWin32App -MaximumVersion 1.4.2
aaronparker commented 6 months ago

IntuneWin32App 1.4.4 has been released