Skip to content

Commit ca82c97

Browse files
authored
Update Convert-ImageToHtml.ps1
1 parent 5034b27 commit ca82c97

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Convert-ImageToHtml.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ function Convert-ImageToHtml
99
.PARAMETER $MakeHtml
1010
An HTML file will be created using the same name as the image file.
1111
.EXAMPLE
12+
Convert a single image file to an HTML IMG tag and display the code.
1213
PS C:\> Convert-ImageToHtml -$ImageFile c:\temp\picture.png -Verbose
1314
.EXAMPLE
15+
Convert a directory of images to HTML IMG tags and display the code.
1416
PS C:\> Get-ChildItem *.png | select fullname | Convert-ImageToHtml -Verbose
1517
.EXAMPLE
18+
Convert a directory of images to HTML IMG tags, display the code, and write them to html files.
1619
PS C:\> Get-ChildItem *.png | select fullname | Convert-ImageToHtml -Verbose -MakeHtml
1720
.NOTES
1821
Author: Scott Sutherland (@_nullbind)
@@ -59,8 +62,8 @@ function Convert-ImageToHtml
5962
# Display image tag
6063
$output
6164

62-
if($HtmlFile){
63-
$output | Out-File "$HtmlFile"
65+
if($MakeHtml){
66+
$output | Out-File "$ImageFile.html"
6467
}
6568
}catch{
6669
Write-Error "Something went wrong. Check your paths. :)" -ErrorId B1 -TargetObject $_

0 commit comments

Comments
 (0)