VMware Cloud Community
dwchan
Enthusiast
Enthusiast
Jump to solution

iso upload to content library is mark as file

I am writing this PowerCLI to upload my iso to my Content Library, that part works well.  However, once it is finished, it is marked or recognize as file versus iso

$ConLibName = 'Repo'  # name of my Repository/folder I created within CL

$SourceWindowsIsoPath = 'D:\LabSources\ISOs\Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.iso'  # my original ISO - Windows 2016

$SourceWindowsIsoFullName = $SourceWindowsIsoPath.split("\")[-1]   # I used split pull out the file name 
$DestinationWindowsIsoPath = $BuildPath + '\FinalISO\' + ($SourceWindowsIsoFullName -replace ".iso","") + '-custom.iso'  # Here is where my update path and the new filename I wash it through with MS ADK
$DestinationWindowsISO = ($SourceWindowsIsoFullName -replace ".iso","") + '-custom'  # I remember the file extension '.iso' as my name within CL, just looks cleaner

where I execute the line below

New-ContentLibraryItem -ContentLibrary $ConLibName -Name $DestinationWindowsISO -Files $DestinationWindowsIsoPath

All the parameters are set and reporting back correctly

PS C:\Users\Administrator> echo $ConLibName
Repo

PS C:\Users\Administrator> echo $DestinationWindowsISO
Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh-custom

PS C:\Users\Administrator> echo $DestinationWindowsIsoPath

G:\CustomizedWindowsISO\FinalISO\Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh-custom.iso

And the file is upload, just for whatever reason, CL is reporting the file versus ISO.  If I did it manually, it works fine.  Any input or feedback would be appreciated as I am completely stuck on this one

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

This is a new feature in PowerCLI 12.1.
You need to upgrade


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

Did you try the ItemType parameter on the New-ContentLibraryItem cmdlet?

With -ItemType iso this works for me (PowerCLI 12.1)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
dwchan
Enthusiast
Enthusiast
Jump to solution

I have not, so like explicitly setting it.  Will try it.  Thank you again and stay tune

0 Kudos
dwchan
Enthusiast
Enthusiast
Jump to solution

I am on PowerCLI 12.0.0, don't see why this would be an issue.  I tried the following command

New-ContentLibraryItem -ContentLibrary $ConLibName -Name $DestinationWindowsISO -ItemType ISO -Files $DestinationWindowsIsoPath

with the following error

New-ContentLibraryItem : A parameter cannot be found that matches parameter name 'ItemType'.
At line:1 char:81
+ ... entLibrary $ConLibName -Name $DestinationWindowsISO -ItemType ISO -Fi ...
+ ~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-ContentLibraryItem], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,VMware.VimAutomation.ViCore.Cmdlets.Commands.ContentLibrary.NewContentLi
braryItem

0 Kudos
LucD
Leadership
Leadership
Jump to solution

This is a new feature in PowerCLI 12.1.
You need to upgrade


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
dwchan
Enthusiast
Enthusiast
Jump to solution

LOL, go figure.  What is the best way to update PowerCLI?  From PowerShell or install as an executable?

0 Kudos
dwchan
Enthusiast
Enthusiast
Jump to solution

I updated PowerCLI 12.1, all issues related to CL seems to be resolved.  Thank you so much

0 Kudos
LucD
Leadership
Leadership
Jump to solution

It looks as if that answered your question.
Can you mark the thread as such?

It makes it easier for others to find threads that contain a valid answer.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos