[CmdletBinding()] Param( [Parameter(Mandatory=$True,Position=1)] [string]$folderName ) Write-Host "Arg: $folderName" if(!(Test-Path -Path $folderName -PathType Container)) { Write-Host "$folderName is not a valid folder" exit 1 } [string]$htmlName $htmlName=$folderName + "\index.html" Write-Host "Generating $htmlName" Write-Output @" Pictures

Pictures

"@ | Out-File $htmlName [int]$cnt=1 Get-ChildItem $folderName | Foreach-Object{ $childName = $_.Name Write-Host "Found $childName" if ($childName -ne "index.html") { Write-Host "Adding $cnt $childName" Write-Output @"

Picture $cnt

"@ | Out-File $htmlName -NoClobber -Append $cnt++ } } Write-Output @" "@ | Out-File $htmlName -NoClobber -Append