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

Import-VcMdtApplication: WARNING: Failed to create folder: VcRedists, with: A parameter cannot be found that matches parameter name 'Comments'. #136

Open
xenadmin opened this issue Jun 22, 2023 · 2 comments

Comments

@xenadmin
Copy link

xenadmin commented Jun 22, 2023

Expected Behavior

On a fresh MDT server, I want to use the VCRedist module to import the VC redists.

Current Behavior

PS C:\Windows\system32> $VcList = Get-VcList | Save-VcRedist -Path "C:\Windows\Temp\VcRedist"

PS C:\Windows\system32> Import-VcMdtApplication -VcList $VcList -MdtPath "C:\MDTBuildLab"
WARNING: Failed to create folder: VcRedists, with: A parameter cannot be found that matches parameter name 'Comments'.
New-Item : A parameter cannot be found that matches parameter name 'Comments'.
At C:\Program Files\WindowsPowerShell\Modules\VcRedist\4.1.484\Private\New-MdtApplicationFolder.ps1:52 char:26
+                 New-Item @params | Out-Null
+                          ~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-Item], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.NewItemCommand

grafik

Failure Information (for bugs)

grafik

PS C:\Windows\system32> Import-VcMdtApplication -VcList $VcList -MdtPath "C:\MDTBuildLab" -Verbose
VERBOSE: Get MDT details from registry at: HKLM:SOFTWARE\Microsoft\Deployment 4
VERBOSE: Loading MDT module from: C:\Program Files\Microsoft Deployment Toolkit\.
VERBOSE: Loading module from path 'C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1'.
VERBOSE: Importing cmdlet 'Add-MDTPersistentDrive'.
VERBOSE: Importing cmdlet 'Disable-MDTMonitorService'.
VERBOSE: Importing cmdlet 'Enable-MDTMonitorService'.
VERBOSE: Importing cmdlet 'Get-MDTDeploymentShareStatistics'.
VERBOSE: Importing cmdlet 'Get-MDTMonitorData'.
VERBOSE: Importing cmdlet 'Get-MDTOperatingSystemCatalog'.
VERBOSE: Importing cmdlet 'Get-MDTPersistentDrive'.
VERBOSE: Importing cmdlet 'Import-MDTApplication'.
VERBOSE: Importing cmdlet 'Import-MDTDriver'.
VERBOSE: Importing cmdlet 'Import-MDTOperatingSystem'.
VERBOSE: Importing cmdlet 'Import-MDTPackage'.
VERBOSE: Importing cmdlet 'Import-MDTTaskSequence'.
VERBOSE: Importing cmdlet 'New-MDTDatabase'.
VERBOSE: Importing cmdlet 'Remove-MDTMonitorData'.
VERBOSE: Importing cmdlet 'Remove-MDTPersistentDrive'.
VERBOSE: Importing cmdlet 'Restore-MDTPersistentDrive'.
VERBOSE: Importing cmdlet 'Set-MDTMonitorData'.
VERBOSE: Importing cmdlet 'Test-MDTDeploymentShare'.
VERBOSE: Importing cmdlet 'Test-MDTMonitorData'.
VERBOSE: Importing cmdlet 'Update-MDTDatabaseSchema'.
VERBOSE: Importing cmdlet 'Update-MDTDeploymentShare'.
VERBOSE: Importing cmdlet 'Update-MDTLinkedDS'.
VERBOSE: Importing cmdlet 'Update-MDTMedia'.
VERBOSE: Performing the operation "Mapping" on target "C:\MDTBuildLab".
VERBOSE: Found MDT drive: DS001
VERBOSE: Restoring drive 'DS001' with path 'C:\MDTBuildLab'
VERBOSE: Deployment share at 'C:\MDTBuildLab' opened successfully.
VERBOSE: Restoring drive 'DS002' with path 'C:\MDTProduction'
VERBOSE: Deployment share at 'C:\MDTProduction' opened successfully.
VERBOSE: Performing the operation "Create" on target "VcRedists".
WARNING: Failed to create folder: VcRedists, with: A parameter cannot be found that matches parameter name 'Comments'.
New-Item : A parameter cannot be found that matches parameter name 'Comments'.
At C:\Program Files\WindowsPowerShell\Modules\VcRedist\4.1.484\Private\New-MdtApplicationFolder.ps1:52 char:26
+                 New-Item @params | Out-Null
+                          ~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-Item], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.NewItemCommand

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

Steps to Reproduce

Just follow the examples from: https://vcredist.com/import-vcmdtapplication/

Context

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

  • VcRedist Version: 4.1.484
  • PowerShell Version:
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      17763  3770
  • Operating System: Windows Server 2019
@xenadmin
Copy link
Author

I compared different environments, and noticed that the command:
Import-VcMdtApplication -VcList $VcList -MdtPath $MdtPath -Verbose
somehow seems to need the DS099 drive. So I created it manually before executing the command:

Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"
New-PSDrive -Name "DS099" -PSProvider MDTProvider -Root "C:\MDTBuildLab"

and everything starting working once again. I'm not sure why and what I did here. Maybe you know if this is a bug or an error from my side? You can decide if this needs fixing in the code, or if it was a mistake from me, and it can be closed.

I leave it here, if someone else ever searches for this specific error.

@aaronparker
Copy link
Owner

The code probably needs some better error checking for multiple MDT drives.

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

No branches or pull requests

2 participants