# base html $html = @" "@ # Filename $file = '.\index.html' # Make index.html if it doesn't exist if (-Not (Test-Path -Path $file)) { New-Item -Path $file -ItemType File } # Generate image html Get-ChildItem -Path ".\images\*" -File -Include ('*.png', '*.jpg') | ForEach-Object { $html = $html + @"
"@ } # Write file contents Get-ChildItem -File -Path $file | Set-Content -Value $html