I am writing a script in powershell/powercli that lets you upload files to the vShpere content library from a chosen folder/file location. The script works fine with .iso, .mf, .vmdk, .nvram, but when it gets to a .ovf file it throws this error:
New-ContentLibraryItem : 6/22/2022 New-ContentLibraryItem An error occurred while trying to update content library item's files. For more details check the inner exception.
At line:60 char:9
-
New-ContentLibraryItem -ContentLibrary $ExistingRepo -Name $i ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (:) [New-ContentLibraryItem], VimException
- FullyQualifiedErrorId : ViCore.Cis.ApiFacade.Impl.ContentLibrary.UpdateItemFilesSession.CloseServerSession.Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.ContentLibrary.NewContentLibraryItem
I've hit a dead end trying to google how to get the .ovf file into the content library without logging in and doing it manually. Is there a way around this error? should I be using a different command for .ovf files?