VMware Cloud Community
dwchan
Enthusiast
Enthusiast

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 finish, it is mark 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 what ever reason, CL is reporting it being a file versus ISO.  If I did it manually, it works fine.  Any input or feedback would be appreciated as I am stuck

Reply
0 Kudos
0 Replies