Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR : Import-VcIntuneApplication : FilePath error #149

Closed
Mrbibi38 opened this issue Nov 24, 2023 · 4 comments · Fixed by #163
Closed

ERROR : Import-VcIntuneApplication : FilePath error #149

Mrbibi38 opened this issue Nov 24, 2023 · 4 comments · Fixed by #163
Assignees
Labels

Comments

@Mrbibi38
Copy link

Expected Behavior

Authenticate to a target tenant, retrieve the list of Visual C++ Redistributables for the 2022 version, download the installers to C:\Temp\VcRedist and imports each Redistributable into the target Intune tenant as separate application with the following commands :

Connect-MSIntuneGraph -TenantID contoso.onmicrosoft.com
$Vc = Get-VcList -Export Unsupported | Where-Object { $_.Release -eq "2010" -and $_.Architecture -eq "x86" }
AVERTISSEMENT : This list includes unsupported Visual C++ Redistributables.
$VcList = Save-VcRedist -VcList $Vc -Path C:\Temp\VcRedist
Import-VcIntuneApplication -VcList $VcList

Like explained in the documentation : https://vcredist.com/import-vcintuneapplication/

Current Behavior

I've got the following path error when executing the Import-VcIntuneApplication -VcList $VcList command :

WARNING: Unable to detect expected 'vcredist_x86.exe.intunewin' file after IntuneWinAppUtil.exe invocation
Add-IntuneWin32App: Cannot validate the argument on the parameter 'FilePath'. Unable to bind the argument to the 'Path' parameter because it is an empty string.
At C:\Program Files\WindowsPowerShell\Modules\VcRedist\4.1.494\Public\Import-VcIntuneApplication.ps1:114:47
+             $Application = Add-IntuneWin32App @Win32AppArgs
+                                               ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData : (:) [Add-IntuneWin32App], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Add-IntuneWin32App

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Running the initial setup commands :
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name VcRedist, IntuneWin32App
  1. Step execution of the followings commands :
Connect-MSIntuneGraph -TenantID contoso.onmicrosoft.com
$Vc = Get-VcList -Export Unsupported | Where-Object { $_.Release -eq "2010" -and $_.Architecture -eq "x86" }
$VcList = Save-VcRedist -VcList $Vc -Path C:\Temp\VcRedist
Import-VcIntuneApplication -VcList $VcList

Context

  • VcRedist Version: Use Get-Module -ListAvailable VcRedist
ModuleType   Version    Name   
----------------------------------      
Script            4.1.494    VcRedist 
  • Operating System: Win11 Pro x64

Maybe I miss understand something or failed a command. If anybody can help ;)

@eg-RTech
Copy link

eg-RTech commented Dec 8, 2023

Also trying to run the tool and am receiving same error as above.
"WARNING: Unable to detect expected 'vc_redist.x86.exe.intunewin' file after IntuneWinAppUtil.exe invocation"

I noticed that when I run the WinAppUtil.exe tool manually it is now omitting the .exe. portion of 'vc_redist.x86.exe.intunewin' and only outputting 'vc_redist.x86.intunewin'

Maybe the file isn't being found because of the name change? Just a thought.

@ei-zascha
Copy link

I just noticed there's a Breaking Change discussion that addresses this:

Old syntax

$VcList = Get-VcList
Save-VcRedist -VcList $VcList -Path C:\Temp\VcRedist
Import-VcIntuneApplication -VcList $VcList

New syntax
Get-VcList | Save-VcRedist -Path C:\Temp\VcRedist | Import-VcIntuneApplication

So the command you're looking for should be:

Get-VcList -Export Unsupported | Where-Object { $_.Release -eq "2010" -and $_.Architecture -eq "x86" } | Save-VcRedist -Path C:\Temp\VcRedist | Import-VcIntuneApplication

Also, as an alternative workaround you can try adding a Note Property before the Import-VcIntuneApplication command:

$VcList | Add-Member -NotePropertyMembers @{Path="C:\Temp\VcRedist"} -PassThru

With the commands you're using:

Connect-MSIntuneGraph -TenantID contoso.onmicrosoft.com
$Vc = Get-VcList -Export Unsupported | Where-Object { $_.Release -eq "2010" -and $_.Architecture -eq "x86" }
$VcList = Save-VcRedist -VcList $Vc -Path C:\Temp\VcRedist
$VcList | Add-Member -NotePropertyMembers @{Path="C:\Temp\VcRedist"} -PassThru
Import-VcIntuneApplication -VcList $VcList

@alexhass
Copy link

alexhass commented Mar 1, 2024

@aizascha I have the same issue. I tested in Powershell 5.1 on windows 10 22H2.

$Vc = Get-VcList | Where-Object { $_.Release -eq "2022" }
$VcList = Save-VcRedist -VcList $Vc -Path C:\Temp\VcRedist
$VcList | Add-Member -NotePropertyMembers @{Path="C:\Temp\VcRedist"} -PassThru -force
Import-VcIntuneApplication -VcList $VcList
  1. Add-Member says the attribute already exist. I tried with force.
  2. It still fails with:
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

Powershell 7.4.1 tells me:

Import-VcIntuneApplication -VcList $VcList
OperationStopped: C:\Program Files\WindowsPowerShell\Modules\VcRedist\4.1.495\Public\Import-VcIntuneApplication.ps1:26
Line |
  26 |              throw [System.TypeLoadException]::New($Msg)
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | We can't load the IntuneWin32App module on PowerShell Core. Please use PowerShell 5.1.

How can this defect fixed?

@alexhass
Copy link

alexhass commented Mar 1, 2024

Get-VcList | Save-VcRedist -Path C:\Temp\VcRedist | Import-VcIntuneApplication
Object does not have valid Path property. Please ensure that output from Save-VcRedist is passed to this function.
At C:\Program Files\WindowsPowerShell\Modules\VcRedist\4.1.495\Public\Import-VcIntuneApplication.ps1:20 char:13
+             throw [System.Management.Automation.PropertyNotFoundExcep ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : RuntimeException

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants