{"id":50143,"date":"2010-05-02T00:01:00","date_gmt":"2010-05-02T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/05\/02\/hey-scripting-guy-weekend-scripter-converting-all-types-of-image-files-to-jpeg-format\/"},"modified":"2010-05-02T00:01:00","modified_gmt":"2010-05-02T00:01:00","slug":"hey-scripting-guy-weekend-scripter-converting-all-types-of-image-files-to-jpeg-format","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-weekend-scripter-converting-all-types-of-image-files-to-jpeg-format\/","title":{"rendered":"Hey, Scripting Guy! Weekend Scripter: Converting All Types of Image Files to JPEG Format"},"content":{"rendered":"<p><a class=\"addthis_button\" href=\"http:\/\/www.addthis.com\/bookmark.php?v=250&amp;pub=scriptingguys\"><img decoding=\"async\" alt=\"Bookmark and Share\" src=\"http:\/\/s7.addthis.com\/static\/btn\/v2\/lg-share-en.gif\" width=\"125\" height=\"16\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p class=\"Readeraidonly\">This week saw the kickoff and first week of the <a href=\"http:\/\/www.bit.ly\/2010sgall\">2010 Scripting Games<\/a>. The Scripting Wife is in the midst of things, so we decided to give her a break and let her catch her breath. You can catch up with her progress by reviewing the <a href=\"http:\/\/bit.ly\/ScriptingWife\">articles in the archive<\/a>. <\/p>\n<p class=\"MsoNormal\">Microsoft Scripting Guy Ed Wilson here. <a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2010\/05\/01\/hey-scripting-guy-weekend-scripter-converting-png-files-to-jpeg-format.aspx\">Yesterday<\/a>, I wrote a quick script that will convert a .png file to a .jpg file. As I was looking at it again, I decided that it would be pretty cool to expand upon it a little bit because I can see myself using it on a regular basis. In fact, it will convert .bmp or other image file formats to a .jpg format as well. If you use a different format enumeration value, it will save to image types besides .jpg.<\/p>\n<p class=\"MsoNormal\">I created a function, added help to the function, and configured it in such a way that it accepts piped input. The resulting script is pretty useful, and the advanced function itself is ready to be copied into a profile or a module. <\/p>\n<p class=\"CodeBlockScreenedHead\"><strong>ConvertTo-JpgFunction.ps1<\/strong><\/p>\n<p class=\"CodeBlockScreened\"><font><font face=\"Lucida Sans Typewriter\">#Requires -version 2.0<br \/>Param($path = &#8220;C:\\fso&#8221;)<\/p>\n<p>Function ConvertTo-Jpg<br \/>{<br \/><span>&nbsp;<\/span>&lt;#<br \/><span>&nbsp; <\/span>.Synopsis<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>Creates copies of images into jpg files. The new<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>image file has the same name as original, but new extension. New<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>images are automatically stored in same directory as originals.<br \/><span>&nbsp;&nbsp; <\/span>.Example<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>ConvertTo-Jpg -sourceFile &#8220;C:\\fso\\image.png&#8221;<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>Creates image.jpg from image.png<br \/><span>&nbsp;&nbsp; <\/span>.Example<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>Get-ChildItem -Path c:\\fso -Include *.png -Recurse | ConvertTo-Jpg<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>Creates .jpg images from all png images in c:\\fso directory<br \/><span>&nbsp;&nbsp; <\/span>.Parameter SourceFile<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>The image file to be converted to JPG<br \/><span>&nbsp;&nbsp; <\/span>.Inputs<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>[string]<br \/><span>&nbsp;&nbsp; <\/span>.Outputs<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>[Drawing.Image]<br \/><span>&nbsp;&nbsp; <\/span>.Notes<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>NAME:<span>&nbsp; <\/span>ConvertTo-Jpg<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>AUTHOR: Ed Wilson<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>AUTHOR BOOK: Windows PowerShell 2.0 Best Practices, Microsoft Press 2010<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>LASTEDIT: 1\/31\/2010<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>KEYWORDS: Weekend Scripter, Multimedia, Graphics<br \/><span>&nbsp;&nbsp; <\/span>.Link<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Http:\/\/www.ScriptingGuys.com<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Http:\/\/www.bit.ly\/HSGBlog<br \/><span>&nbsp;<\/span>#&gt;<br \/><span>&nbsp;<\/span>#Requires -Version 2.0<br \/><span>&nbsp;<\/span>[CmdletBinding()]<br \/><span>&nbsp;<\/span>param(<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>[Parameter(Mandatory = $True,valueFromPipeline=$true)]<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$SourceFile<br \/>) #end param<br \/><span>&nbsp;<\/span>BEGIN {<br \/><span>&nbsp;&nbsp; <\/span>Try<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>{<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$drawing = &#8220;system.drawing.image&#8221; -as [type]<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$imageFormat = &#8220;System.Drawing.Imaging.ImageFormat&#8221; -as [type]<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>[reflection.assembly]::GetAssembly($drawing) | Out-Null<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>}<br \/><span>&nbsp;&nbsp; <\/span>Catch [system.Exception]<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>{ <br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8220;Assembly not loaded. Loading now.&#8221;<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Add-Type -AssemblyName system.drawing<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$imageFormat = &#8220;System.Drawing.Imaging.ImageFormat&#8221; -as [type]<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>}<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>} #end begin<br \/><span>&nbsp;<\/span>PROCESS {<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>$saveFile = Join-Path -Path $_.directory -ChildPath ($_.BaseName + &#8220;.jpg&#8221;)<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>If(!(Test-Path -Path $saveFile))<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>{<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$image = [drawing.image]::FromFile($sourceFile)<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$image.Save($saveFile, $imageFormat::jpeg)<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>}<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>Else { &#8220;$saveFile already exists. Skipping &#8230;&#8221; }<br \/><span>&nbsp;&nbsp; <\/span>} #end process<br \/>} #end function ConvertTo-Jpg<\/p>\n<p># *** Entry Point to Script ***<\/p>\n<p>If(!$path) { &#8220;You must supply path to images for processing&#8221;;exit }<br \/>Get-ChildItem -Path $path -Include *.png -Recurse | ConvertTo-Jpg<\/font><\/font><\/p>\n<p class=\"MsoNormal\">Keep in mind that in addition to the <b>ConvertTo-Jpg<\/b> function, there is also code in the script itself. The script accepts command-line input that allows you to call the script and pass a folder for the parameter. The script then checks to see if the folder exists, and if it does, it calls <b>Get-ChildItem<\/b> to retrieve all of the .png files in the folder, and then passes the collection to the <b>ConvertTo-Jpg<\/b> function. The <b>$path<\/b> parameter is assigned a default value of c:\\fso that probably will not exist on your computer. This is shown here:<\/p>\n<p class=\"CodeBlockScreened\"><font><font face=\"Lucida Sans Typewriter\">Param($path = &#8220;C:\\fso&#8221;)<\/font><\/font><\/p>\n<p class=\"MsoNormal\">The entry point to the script is shown here:<\/p>\n<p class=\"CodeBlockScreened\"><font><font face=\"Lucida Sans Typewriter\">If(!$path) { &#8220;You must supply path to images for processing&#8221;;exit }<br \/>Get-ChildItem -Path $path -Include *.png -Recurse | ConvertTo-Jpg<\/font><\/font><\/p>\n<p class=\"MsoNormal\">The help section of the <b>ConvertTo-Jpg<\/b> function is seen here. Adding help tags to a function was discussed in <a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2010\/01\/07\/hey-scripting-guy-january-7-2010.aspx\"><font face=\"Segoe\">a recent Hey, Scripting Guy! post<\/font><\/a>:<\/p>\n<p class=\"CodeBlockScreened\"><font><font face=\"Lucida Sans Typewriter\">&lt;#<br \/><span>&nbsp; <\/span>.Synopsis<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>Creates copies of images into jpg files. The new<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>image file has same name as original, but new extension. New<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>images are automatically stored in same directory as originals.<br \/><span>&nbsp;&nbsp; <\/span>.Example<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>ConvertTo-Jpg -sourceFile &#8220;C:\\fso\\image.png&#8221;<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>Creates image.jpg from image.png<br \/><span>&nbsp;&nbsp; <\/span>.Example<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>Get-ChildItem -Path c:\\fso -Include *.png -Recurse | ConvertTo-Jpg<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>Creates .jpg images from all png images in c:\\fso directory<br \/><span>&nbsp;&nbsp; <\/span>.Parameter SourceFile<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>The image file to be converted to JPG<br \/><span>&nbsp;&nbsp; <\/span>.Inputs<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>[string]<br \/><span>&nbsp;&nbsp; <\/span>.Outputs<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>[Drawing.Image]<br \/><span>&nbsp;&nbsp; <\/span>.Notes<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>NAME:<span>&nbsp; <\/span>ConvertTo-Jpg<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>AUTHOR: Ed Wilson<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>AUTHOR BOOK: Windows PowerShell 2.0 Best Practices, Microsoft Press 2010<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>LASTEDIT: 1\/31\/2010<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>KEYWORDS: WeekEnd Scripter, Multimedia, Graphics<br \/><span>&nbsp;&nbsp; <\/span>.Link<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Http:\/\/www.scriptingguys.com<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Http:\/\/www.bit.ly\/hsgblog<br \/><span>&nbsp;<\/span>#&gt;<\/font><\/font><\/p>\n<p class=\"MsoNormal\">The next lines of code ensure the function is running on Windows PowerShell 2.0, turn on cmdlet binding, and define the <b>$sourceFile<\/b> parameter as mandatory:<\/p>\n<p class=\"CodeBlockScreened\"><font><font face=\"Lucida Sans Typewriter\">#Requires -Version 2.0<br \/><span>&nbsp;<\/span>[CmdletBinding()]<br \/><span>&nbsp;<\/span>param(<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>[Parameter(Mandatory = $True,valueFromPipeline=$true)]<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$SourceFile<br \/>) #end param<\/font><\/font><\/p>\n<p class=\"MsoNormal\">The <b>BEGIN<\/b> section of the function uses <b>Try\/Catch<\/b> to ensure that the <b>System.Drawing<\/b> .NET Framework assembly is loaded and the <b>ImageFormat<\/b> type is created. These concepts were discussed yesterday. <b>Try\/Catch<\/b> was discussed in <a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2010\/03\/11\/hey-scripting-guy-march-11-2010.aspx\"><font face=\"Segoe\">a recent Hey, Scripting Guy! post<\/font><\/a>. To determine if the <b>System.Drawing<\/b> .NET Framework assembly has been loaded, the <b>GetAssembly<\/b> static method from the <b>Reflection.Assembly<\/b> class is used. This method requires a type, and that is why the <b>drawing<\/b> type is created. This section of the script is shown here:<\/p>\n<p class=\"CodeBlockScreened\"><font><font face=\"Lucida Sans Typewriter\">BEGIN {<br \/><span>&nbsp;&nbsp; <\/span>Try<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>{<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$drawing = &#8220;system.drawing.image&#8221; -as [type]<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$imageFormat = &#8220;System.Drawing.Imaging.ImageFormat&#8221; -as [type]<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>[reflection.assembly]::GetAssembly($drawing) | Out-Null<br \/><span>&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;<\/span>}<br \/><span>&nbsp;&nbsp; <\/span>Catch [system.Exception]<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>{ <br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8220;Assembly not loaded. Loading now.&#8221;<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Add-Type -AssemblyName system.drawing<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$imageFormat = &#8220;System.Drawing.Imaging.ImageFormat&#8221; -as [type]<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>}<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>} #end begin<\/font><\/font><\/p>\n<p class=\"MsoNormal\">In the <b>PROCESS<\/b> section of the function, the script uses the <b>Join-Path<\/b> cmdlet to create the path to the new image file that will be created. It uses the <b>directory<\/b> property from the current item on the pipeline for the parent path, and the <b>basename<\/b> property to get the file name portion of the path. The .jpg file extension is concatenated onto the <b>basename<\/b> property to complete the <b>childpath<\/b>. The <b>Test-Path<\/b> cmdlet is then used to see if the file already exists. If it does not, the image is converted to the new file format. This part of the script works the same as the script from yesterday. <\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PROCESS {<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>$saveFile = Join-Path -Path $_.directory -ChildPath ($_.BaseName + &#8220;.jpg&#8221;)<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>If(!(Test-Path -Path $saveFile))<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>{<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$image = [drawing.image]::FromFile($sourceFile)<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$image.Save($saveFile, $imageFormat::jpeg)<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>}<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>Else { &#8220;$saveFile already exists. Skipping &#8230;&#8221; }<br \/><span>&nbsp;&nbsp; <\/span>} #end process<br \/>} #end function ConvertTo-Jpg<\/font><\/span><\/p>\n<p class=\"MsoNormal\">The results from running the script are seen in the following image.<\/p>\n<p class=\"Fig-Graphic\"><img decoding=\"async\" title=\"Image of results of running script\" alt=\"Image of results of running script\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/telligent.evolution.components.attachments\/13\/7619\/00\/00\/03\/32\/95\/82\/WES-5-2-10-1.JPG\" width=\"600\" height=\"441\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/telligent.evolution.components.attachments\/13\/7619\/00\/00\/03\/32\/95\/82\/WES-5-2-10-1.JPG\"><font face=\"Segoe\"><\/font><\/a><\/p>\n<p class=\"MsoNormal\">&nbsp;<\/p>\n<p class=\"MsoNormal\">The 2010 Scripting Games continue tomorrow. We will be revealing Events 6\u201310 tomorrow through Friday. If you want to know exactly what we will be looking at tomorrow, follow us on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> or <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\">Facebook<\/a>. If you have any questions, send e-mail to us at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\"><font face=\"Segoe\">scripter@microsoft.com<\/font><\/a> or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\"><font face=\"Segoe\">Official Scripting Guys Forum<\/font><\/a>. See you tomorrow. Until then, peace.<\/p>\n<p class=\"MsoNormal\">&nbsp;<\/p>\n<p><b><span>Ed Wilson and Craig Liebendorfer, Scripting Guys<\/span><\/b><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; This week saw the kickoff and first week of the 2010 Scripting Games. The Scripting Wife is in the midst of things, so we decided to give her a break and let her catch her breath. You can catch up with her progress by reviewing the articles in the archive. Microsoft Scripting Guy Ed [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[122,123,3,61,45],"class_list":["post-50143","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-graphics","tag-multimedia","tag-scripting-guy","tag-weekend-scripter","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>&nbsp; This week saw the kickoff and first week of the 2010 Scripting Games. The Scripting Wife is in the midst of things, so we decided to give her a break and let her catch her breath. You can catch up with her progress by reviewing the articles in the archive. Microsoft Scripting Guy Ed [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/50143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=50143"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/50143\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=50143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=50143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=50143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}