File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,13 @@ function Convert-ImageToHtml
9
9
. PARAMETER $MakeHtml
10
10
An HTML file will be created using the same name as the image file.
11
11
. EXAMPLE
12
+ Convert a single image file to an HTML IMG tag and display the code.
12
13
PS C:\> Convert-ImageToHtml -$ImageFile c:\temp\picture.png -Verbose
13
14
. EXAMPLE
15
+ Convert a directory of images to HTML IMG tags and display the code.
14
16
PS C:\> Get-ChildItem *.png | select fullname | Convert-ImageToHtml -Verbose
15
17
. EXAMPLE
18
+ Convert a directory of images to HTML IMG tags, display the code, and write them to html files.
16
19
PS C:\> Get-ChildItem *.png | select fullname | Convert-ImageToHtml -Verbose -MakeHtml
17
20
. NOTES
18
21
Author: Scott Sutherland (@_nullbind)
@@ -59,8 +62,8 @@ function Convert-ImageToHtml
59
62
# Display image tag
60
63
$output
61
64
62
- if ($HtmlFile ){
63
- $output | Out-File " $HtmlFile "
65
+ if ($MakeHtml ){
66
+ $output | Out-File " $ImageFile .html "
64
67
}
65
68
}catch {
66
69
Write-Error " Something went wrong. Check your paths. :)" - ErrorId B1 - TargetObject $_
You can’t perform that action at this time.
0 commit comments